rope

Function rope 

Source
pub fn rope(
    gpu: &dyn GpuBackend,
    kernel: KernelHandle,
    q: DevicePtr,
    k: DevicePtr,
    positions: DevicePtr,
    seq_len: u32,
    num_q_heads: u32,
    num_kv_heads: u32,
    head_dim: u32,
    rotary_dim: u32,
    theta: f32,
    stream: u64,
) -> Result<()>
Expand description

2026-09-25: Apply rotary position embeddings to Q and K in place, rows packed (num_q_heads * head_dim and num_kv_heads * head_dim elements apart). positions is a device u32[seq_len].