pub struct DflashKvTail {
pub layers: Vec<(CudaSlice<f32>, CudaSlice<f32>)>,
pub base: usize,
pub rows: usize,
pub len: usize,
pub row_bytes: usize,
}Expand description
A DFlash draft-KV tail, per drafter layer, ready to ride a cross-request prefix-cache
entry: (k, v) f32 rows covering absolute positions [base, base + rows).
Only the tail travels, and that is a fact about this export rather than an optimisation:
every DFlash2 draft layer is sliding_attention (the port asserts it at load), so a round
at context pos reads rows [pos - window + 1, pos + block) and nothing older. Storing
the whole history for a 30k-token prompt would be ~1,229 MB — MORE than the ~1,057 MB of
trunk planes it would ride with; the tail is ~85 MB.
Fields§
§layers: Vec<(CudaSlice<f32>, CudaSlice<f32>)>§base: usizeAbsolute position of the first stored row.
rows: usizeRows stored per layer.
len: usizeLogical length the KV had when exported (= pos), so an import can restore the same
absolute row addressing the rope positions were baked against.
row_bytes: usizeBytes per row per layer, carried so an import cannot disagree about the geometry.