Repository navigation
cuda: opt-in KV pool sizing after warm-up for dense Qwen3.5 - #4591
Merged
Merged
Conversation
Owner
Author
|
GB10 A/B with the switch on (Qwen3.8-27B MLX 4-bit with its DFlash2 drafter; base = this PR with the switch off, new = on via a local flip-default commit; two runs each arm):
Two asks before it can go further: log the pool's page count before and after the second sizing (one info line), and say why the calibration reruns. If the lane prices don't depend on the pool's size, the second sizing shouldn't trigger it. Then the number that decides it is the gain in pages (or in the longest context that fits at a given (Our chat resume cell didn't reach the prompt cache in either arm on this setup, so it reports no resume numbers; that is our harness, not this PR.)
|
ashhart
force-pushed
the
lead/e191-pool-after-warmup
branch
from
November 22, 2026 18:53
1d784f7 to
d455322
Compare
ashhart
force-pushed
the
lead/e191-pool-after-warmup
branch
from
November 23, 2026 03:58
d455322 to
b18b418
Compare
This was referenced Nov 23, 2026
ashhart
force-pushed
the
lead/e191-pool-after-warmup
branch
from
November 23, 2026 06:30
b18b418 to
ff5812c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
TF_CUDA_POOL_AFTER_WARMUP=1(opt-in, default off) lets dense Qwen3.5 on CUDA size its KV page pool a second time, after warm-up, from the free memory it then measures, instead of keeping only the pool planned before warm-up.--prompt-cache-gib 0). Any other mode keeps today's path with the switch set.attachbuilds the larger one; no live page moves. Graph tables are restaged each forward, so captured graphs stay valid. A final probe after growth refuses the start if memory changed meanwhile./memoryand/v1/memoryreport the decision (device.pool_after_warmup: measured free, reserve, room, page counts before and after), and the start-up line appends it. Off or ineligible, both are unchanged.No kernel, arithmetic, sampling or verification change: tokens cannot change, only how many pages exist.
Checks
test-cuda-pool-after-warmup-host(23 cases: grow and stay decisions, reserve, cap, refusal and overflow edges, live leases and promises blocking replacement) andtest-cuda-pool-report-host(45) pass;compile-cuda-testsfor Linux compiles; fmt, ast-check, the 600-line cap; no pinned file changes.Still to run (before landing)
On a GB10, Qwen3.8-27B with DFlash2 at
--parallel 4 --context 65536 --prompt-cache-gib 0: main, this PR off, and this PR on. Start-up line and/memoryfor each; token capacity on, level off; tokens equal across the three at levels 1, 2 and 4.