Skip to main content

Module rope

Module rope 

Source

Functionsยง

apply_interleaved_rope
Apply interleaved (paired) rotary embeddings in place on host data.
apply_llama_rope
Llama-style rotary embedding apply on [b, heads, seq, head_dim] with prebuilt [max_seq, head_dim] cos/sin tables (positions start..).
build_rope_tables
Build cos/sin tables from explicit inv_freq ([half]).
rope_tables
Build Llama-style RoPE cos/sin tables for positions [0, max_seq).