Skip to main content

Module rope

Module rope 

Source
Expand description

RoPE-aware bit allocation for KV-cache quantization.

Provides CPU-side, deterministic infrastructure for assigning variable bit-widths to RoPE frequency blocks. The greedy energy heuristic is experimental and inspired by block-level frequency analysis; it does not claim equivalence with any published algorithm.

Structs§

RopeBitAllocation
Bit-width assignment for every RoPE block in a head.
RopeBlock
A contiguous pair of head dimensions forming one RoPE frequency block.
RopeBlockEnergy
Energy estimate for one RoPE block.

Functions§

allocate_rope_bits
Greedily allocate bits across RoPE blocks.
rope_block_energies
Compute per-block energy from a set of key vectors.
rope_blocks
Partition head_dim into contiguous 2-D RoPE blocks.