How FlashRNN backends work
mainFlashRNN provides different backends optimized for different hardware and constraints:
cuda_fused: This is the high-performance option. It fuses matrix multiplication with pointwise non-linearity into a single CUDA kernel usingwmmainstructions and custom caching on SRAM/registers. This provides a $2\times$ to $5\times$ speedup over the standardcudabackend by reducing I/O overhead for the recurrent matrix $\mathbf{R}$ and biases $\mathbf{b}$.cuda: A basic CUDA implementation that alternates between matrix multiplication and pointwise non-linearity. It has no restrictions on head dimension $d_{head}$.triton: Uses Triton kernels. It is highly efficient but imposes a constraint on the head dimension: $d_{head} \leq 64$.vanilla: A standard, non-optimized implementation.