feat(qwen35moe): pooled chunked prefill + snapshot/restore over KVFlash

Closed
DU
4mo ago
+1202-239

What

Pooled chunked prefill for qwen35moe (Qwen3.6-35B-A3B) over KVFlash: when the
prompt exceeds the resident pool, prefill loops hybrid_forward_batch over
chunk-sized slices with live eviction instead of refusing. Plus pooled
snapshot/restore (save/restore the bounded pool across requests) and a
complexity-only refactor (dedup the two identical restore chunk loops, extract
chunked_prefill, inline a single-caller helper — net −25 LOC, behaviour-identical).

Stacking

This is the tip of the KVFlash-MoE stack and depends on:

  • #428 — pool-sized KV reservation (keeps experts hot / placement gate)
  • #429 — pager serialize/deserialize (snapshot/restore serde)

Until those merge this PR's diff includes their commits; rebasing after they land
leaves only the prefill-snapshot + refactor commits.

Tests

test_kvflash_moe_paged.sh — GPU silent-corruption gate: a sink fact in the
first (protected) chunk is recalled after the middle is evicted, and the greedy
(temp-0) answer is identical across two pool sizes. Green on RTX 3090 / Q3_K_M.