Skip to content

kv: charge QSA index-key state per block when the KV pool extends into the display carveout (ported from Enntity) - #254

Closed
AzeezIsh wants to merge 3 commits into
stack/literal-tool-xmlfrom
stack/qsa-aux-kv-budget
Closed

AzeezIsh wants to merge 3 commits into
stack/literal-tool-xmlfrom
stack/qsa-aux-kv-budget

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #243. GitHub closed #243 automatically during a restack: its branch briefly pointed at a commit its base already contained. It's the same branch (stack/qsa-aux-kv-budget), now corrected; the history and receipts are on #243.

Replaces #231. GitHub closed #231 automatically when a restack force-pushed its base branch, and once the head was force-pushed afterwards it couldn't be reopened. The branch is the same (stack/qsa-aux-kv-budget); #231 has the history and receipts.

Stack: main ← #198 ← #223 ← #224 ← #226 ← #227 ← #229 ← #230 ← this.

Summary

  • Ports Enntity 4d75b9ec (AGPL-3.0) with credit. When the KV pool grows into the GB10 display carveout (main's strix-hip train: the validated gfx1151 stack (build fix + suballoc + carveout + hipBLASLt) #197 mechanism), each added block now also pays the per-token auxiliary state: QSA's 768 B/token indexer keys, i.e. 12,288 B per 16-token block. Before this, that share wasn't budgeted. KvShape gains auxiliary_block_bytes / with_per_token_aux.
  • Capacity change, by design: qwen4_exp with QSA gets fewer carveout blocks than before (parent rc16 boot: 76,595 blocks). Models without per-token aux are unchanged (new test). No outputs change.

Test plan (vs parent #230)

  • kv_carveout 8/8, including Enntity's qwen_carveout_growth_reserves_indexer_state_for_every_added_token and carveout_growth_is_unchanged_without_per_token_aux
  • one rc16 boot: KV-blocks line vs the parent's boot log; greedy C1 == serial refs (job J37)

Tracking: #220.

Generated with Devin

Port of Enntity/atlas 4d75b9e (AGPL-3.0-only).

The carveout path charged no per-token auxiliary bytes, so a QSA model's
pooled index keys grew unbudgeted when the KV pool extended into the
display heap. KvShape gains auxiliary_block_bytes + with_per_token_aux;
the factory calls it with aux_bytes_per_token (QSA indexer carry, 0 for
non-QSA models, so their block count is unchanged).

Capacity delta (qwen4_exp, rc16 profile): aux 768 B/token x block_size 16
= 12,288 B charged per block the carveout adds beyond the budget, so the
pool extends to fewer blocks than before for the same budget — the
correct, previously-unaccounted share. Parent value to compare:
'76595 blocks x 16 tok/block' (rank0-j34-spark.log).
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

This can't be re-cut onto main yet. Its one commit edits factory/build/kv_carveout.rs (KvShape, with_per_token_aux), and that module only exists in #199's build reorg, so it isn't on main. It stays parked with the GLM stack (#242) and lands after it.

@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Superseded by #282: the full display-carveout port onto main, which includes this commit's QSA charge (4d75b9ec2). I'll close this once #282 merges.

@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Landed as part of #282 (the display-carveout port includes this QSA charge, 4d75b9e).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant