Expand description
ALiBi (Attention with Linear Biases) kernel.
Matches alibi-kernel-v1.yaml.
scores[i,j] += -m_h * |i - j| where m_h = 2^(-8h/H).
Each function provides one of three backends:
fn alibi_bias_scalar(...)– Pure Rust scalar reference (ground truth)unsafe fn alibi_bias_avx2(...)– AVX2 SIMD implementationfn alibi_ptx() -> &'static str– PTX assembly source string
Functions§
- alibi_
bias_ ⚠avx2 - AVX2 ALiBi bias – delegates to scalar.
- alibi_
bias_ scalar - Add ALiBi bias to attention scores (scalar reference).
- alibi_
ptx - PTX assembly for ALiBi bias addition.
- alibi_
slope - Compute ALiBi slope for head
hofnum_headstotal.