compintell / Tapir.jl

https://compintell.github.io/Tapir.jl/
MIT License
93 stars 2 forks source link

gemm foreigncall rule performance #138

Closed willtebbutt closed 2 months ago

willtebbutt commented 2 months ago

An example was shown on slack which highlights that there are some type instabilities in the foreigncall rule for gemm. To replicate, look at the IR for the pullback generated when runningTapir.build_rrule(BLAS.gemm!, 'N', 'N', false, randn(5, 5), randn(5, 5), false, randn(5, 5)).

This is a very slightly awkward example to write a test for, because it involves creating a lot of pointers. This likely speaks to a more general lack of good JET-based inference checks on hand-written rules for BLAS and LAPACK.

willtebbutt commented 2 months ago

This is resolved by #155