pub struct CompressorWeights {
pub wkv: DenseWeight,
pub wgate: DenseWeight,
pub norm: DenseWeight,
pub ape: DevicePtr,
pub ratio: usize,
pub proj_dim: usize,
pub is_csa: bool,
pub pool: DevicePtr,
pub pool_blocks: usize,
pub ring: DevicePtr,
pub prev_win: DevicePtr,
pub stage: DevicePtr,
}Expand description
2026-09-25: DeepSeek-V4 compressed-attention compressor weights, one per layer
with a non-zero compress_ratios entry. CSA layers use a 2×ratio
overlapping window, HCA layers a single window.
Fields§
§wkv: DenseWeight2026-09-25: wkv: [proj_dim, hidden].
wgate: DenseWeight2026-09-25: wgate: same shape as wkv.
norm: DenseWeight§ape: DevicePtr2026-09-25: ape, [ratio, proj_dim] FP32.
ratio: usize2026-09-25: Compression ratio for this layer; is_csa is ratio < 128.
proj_dim: usize2026-09-25: Output width of wkv/wgate: 2 * head_dim for CSA,
head_dim for HCA.
is_csa: bool2026-09-25: CSA (2×ratio overlapping window) when true, HCA (single window) when false.
pool: DevicePtr2026-09-25: Persistent flat compressed-KV pool, [pool_blocks × hd_mla]
FP8-E4M3 with hd_mla = qk_nope_head_dim + qk_rope_head_dim. Prefill
fills blocks [0, n / ratio); decode appends after them.
pool_blocks: usize2026-09-25: Pool capacity in blocks:
max_position_embeddings.div_ceil(ratio).
ring: DevicePtr2026-09-25: Decode-time ring of compressor inputs, [ratio × hidden] BF16.
Each decode token’s normed is written to slot pos % ratio.
prev_win: DevicePtr2026-09-25: CSA only: the previous completed window’s inputs,
[ratio × hidden] BF16. NULL for HCA.
stage: DevicePtr2026-09-25: CSA only: [2×ratio × hidden] BF16 staging for the
overlapped window. NULL for HCA.
Trait Implementations§
Source§impl Clone for CompressorWeights
impl Clone for CompressorWeights
Source§fn clone(&self) -> CompressorWeights
fn clone(&self) -> CompressorWeights
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more