rope_proportional

Function rope_proportional 

Source
pub fn rope_proportional(
    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,
    rope_angles: u32,
    theta: f32,
    stream: u64,
) -> Result<()>
Expand description

Proportional RoPE (Gemma-4 full-attention layers).

Rotation pairs are (i, i + head_dim/2) for i in [0, rope_angles). Frequency denominator is head_dim (not rotary_dim).