Skip to main content

multiaxis_rope_qk

Function multiaxis_rope_qk 

Source
pub fn multiaxis_rope_qk(
    query: &mut [f32],
    key: &mut [f32],
    cos: &[f32],
    sin: &[f32],
    config: MultiaxisRopeConfig,
)
Expand description

Applies three-axis half-split RoPE to query and key tensors.

Query and key use [batch, seq_len, heads, head_dim] layout. The cosine and sine tables contain temporal, height, and width sections. Each section rotates first-half head dimensions with their matching second-half dimensions.