Expand description
Absolute position embeddings kernel.
Matches absolute-position-v1.yaml.
output[t] = token_embed[t] + pos_embed[t] — learned additive positional encoding.
Each function provides one of three backends:
fn abs_position_scalar(...)– Pure Rust scalar reference (ground truth)unsafe fn abs_position_avx2(...)– AVX2 SIMD implementationfn abs_position_ptx() -> &'static str– PTX assembly source string
Functions§
- abs_
position_ ⚠avx2 - AVX2 absolute position embeddings – delegates to scalar.
- abs_
position_ ptx - PTX assembly for absolute position embeddings.
- abs_
position_ scalar - Add learned position embeddings to token embeddings (scalar reference).