- crunch-rope-f32 n head-size base cos sin xprocedure
- crunch-rope-f64 n head-size base cos sin xprocedure
Rotate the first n elements of x in place as consecutive pairs. Pair p of each head of head-size elements is rotated by the angle with cosine cos[base + p] and sine sin[base + p]: the interleaved rotary position embedding of Llama, with base selecting the row of the token position.
These two kernels have no morphism op. They are meant for code that works outside compiled SSA programs, such as attention over a growing key/value cache.