chickadee » nanograd-components » rope-rotate-rows

make-rope-embedding max-seq-len head-size #!key (base 10000.0) (dtype 'f32)procedure
rope-rotate-rows x rope start-posprocedure
apply-rope-rotation Q K rope posprocedure

make-rope-embedding precomputes the RoPE tables. rope-rotate-rows rotates all rows of a (seq_len, d) matrix whose first row is at position start-pos. apply-rope-rotation rotates a single query and key of shape (n_heads, head_size).