Files
Strata/engine
Niko1221 418f142af4 ling32: scratch regrow, the prefill scratch exists only while a prompt is prefilled and the pool regrows for decode (tier B / C, opt-in)
- engine: every row-dependent buffer (activations, logits, KDA chunk scratch, MLA workspaces, grouped-MoE work, lookahead snapshots) lives in a ScratchSet; a small `dec` set (decode_rows = 64 rows) is always resident, a `big` set of the prompt chunk is allocated by the first prefill-sized forward (the existing allocation retry makes the tier store release chunks of pool slots when the card has no room) and freed by the first decode-sized forward, which also frees the span rows and tells the store to take the memory back
- store: ExpertProvider::grow_bytes / ExpertStore::grow_bytes re-allocate released chunks of small dynamic slots (empty, lowest chunk first, keeping 192 MiB free: STRATA_L32_REGROW_RESERVE_MB)
- planner / main: --regrow on|off (or STRATA_L32_REGROW=1; default off), --decode-rows N; with regrow the plan counts decode_rows rows of scratch instead of the chunk (tier A and runs without lazy KV keep the full chunk); a speculative request (MTP, not plain) keeps its sets and does not regrow
- test: ling32_regrow_regress (same dump and ids with regrow on and off: tier B, two prompts, injected allocation failure, tier C, MTP speculation; STRATA_L32_KV_FORCE_RELEASE=1 makes the big set take one chunk even where the card has room)
2026-12-02 23:51:28 +01:00
..