Module predictor

Module predictor 

Source
Expand description

2026-09-25: GPU side of the high-speed-swap block predictor. Loads the q_lowrank_project, kv_lowrank_project and predictor_score PTX from build.rs and owns the projection P and the per-token low-rank keys A_g.

Owner: storage, high-speed swap. Invariants:

  • P is written once, in the constructor, from projection_seed.

project_q computes Q @ P; project_kv_block computes K @ P for every token of one block; score_blocks gives each block the max, over query heads and tokens, of the projected dot product. HighSpeedSwap uses the scores only to rank eviction victims (EvictionPolicy::record_score); attention reads every block.

Structs§

Predictor
PredictorDims
StoragePtx

Constants§

STORAGE_PTX

Functions§

read_k_lr_slot
2026-09-25: Copy the A_g slot of (layer, block) to the host, as BF16 [num_kv_heads, block_size, r], and synchronise the stream.