Module flashinfer

Module flashinfer 

Source
Expand description

2026-09-25: Host-side FFI to the FlashInfer ragged (varlen) BF16 prefill attention wrapper in cuda/flashinfer_ragged_prefill.cu: several requests’ attention in one launch, delimited by qo_indptr/kv_indptr. hd128 holds the head_dim-128 entry.

Owner: gpu-runtime. Invariants:

  • The FFI and workspaces exist only under cfg(metrale_flashinfer), which build.rs sets only when FLASHINFER_HOME is set at build time. Without it available() is false and every entry point returns an error.
  • The only caller, the batched first-chunk prefill in metrale-model-layers (qwen3_attention/prefill/paged.rs), also requires METRALE_FLASHINFER_PREFILL=1.

Functions§

available
2026-09-25: Whether the FlashInfer wrapper was compiled in (FLASHINFER_HOME was set at build time).
ragged_prefill_bf16_hd128
2026-09-25: Ragged batched prefill attention, BF16, head_dim 128, GQA.
ragged_prefill_bf16_hd256
2026-09-25: Ragged batched prefill attention, BF16, head_dim 256, GQA, optionally causal.