docs.rs failed to build luma-flash-attn-0.3.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
luma-flash-attn
Flash Attention CUDA kernels for luma (f32/f16/bf16, causal, GQA, forward only).
Entry points
flash_attn_func— batched attention,q/k/vof shape(batch, seq, heads, head_size).flash_attn_varlen_func— packed variable-length attention.flash_attn_with_kvcache— attention over a paged KV cache (decode whenseqlen_q == 1, prefill when> 1).
Usage
use Cuda;
use flash_attn_func;
use FloatDType;
use Tensor;
let dev = new.unwrap;
let = ;
let nums = vec!;
let q = from_slice.unwrap;
let k = q.clone;
let v = q.clone;
let out = flash_attn_func.unwrap;
assert_eq!;
Notes
head_sizemust be 32/64/128;q_headsmust be a multiple ofkv_heads(GQA).- Causal only, and there is no backward pass (inference only).
- Each entry point documents prefill / decode usage in its rustdoc;
start_pos(onflash_attn_func) andblock_table(onflash_attn_varlen_func) let you run decode over a concatenated or paged KV cache. - Built with
nvcc; without it the crate falls back to a stub that errors at runtime.
License
MIT — see LICENSE.