Repository navigation
[Perf] speculative: Fuse draft write-window gathering and KV translation - #44972
Merged
Merged
Conversation
ch-wan
requested review from
BBuf,
DarkSharpness,
HaiShaw,
HydraQYH,
Qiaolin-Yu,
Ying1123,
alphabetc1,
celve,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann,
yizhang2077 and
yuan-luo
October 18, 2026 07:22
3 of 4 tasks
This was referenced Oct 18, 2026
ch-wan
force-pushed
the
cheng/dev/speculative-write-location-fusion
branch
from
October 18, 2026 08:13
e9d09e3 to
5d4099c
Compare
ch-wan
force-pushed
the
cheng/dev/unified-conv-state-updates
branch
from
October 18, 2026 08:13
67271ce to
b8d1cee
Compare
ch-wan
force-pushed
the
cheng/dev/speculative-write-location-fusion
branch
from
October 18, 2026 09:02
5d4099c to
f64aab0
Compare
ch-wan
force-pushed
the
cheng/dev/unified-conv-state-updates
branch
2 times, most recently
from
October 18, 2026 12:40
ea86492 to
aa99e41
Compare
ch-wan
force-pushed
the
cheng/dev/speculative-write-location-fusion
branch
from
October 18, 2026 12:41
f64aab0 to
d2e166d
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.
This PR is part of a stack (oldest at bottom):
Current head
d2e166dcff, based on main2a83471676. Stack predecessor: #44971. The Files changed tab isolates this PR from its predecessor.Motivation
Uniform draft writes first gathered a write window and then translated FULL/SWA locations in separate operations. Precomputed write locations also bypassed the normal per-space cache in KVLocPlan.
Modifications
Virtual table lengths are runtime bounds, invalid IDs use safe sink addresses, and FULL/SWA bounds are checked independently. A GPU test covers table-size changes, sink IDs and JIT-cache reuse.
CI registration updates
Updated
est_timein 2 affected test files from observed file-level CI timings, including process/import cost and margin. Existing estimates with sufficient margin are retained. The expanded weekly configurator test also passed all 11 cases in a 30.1-second CPU measurement.The full uniform-extend producer/plan matrix runs in
extra-a-test-1-gpu-small; direct translation and JIT-reuse regressions remain in base CI.The CI registry check validated 2,960 registrations before landing. An AST comparison confirmed that this follow-up changes registration metadata only. Runtime test measurements elsewhere in this description refer to their stated earlier revisions.
Accuracy Tests
Earlier combined stack
b550cacde6adds a test-fixture correction in #43326: the Gemma4 read-stream fixture declares its FULL address space, and the HiSparse registry test uses realCacheInitParamsfor the retained-window calculation. Both complete test files pass locally with GPUs hidden: 4 Gemma4 tests and 26 registry tests. Pre-commit passed. The five descendant patches are unchanged (git range-diff); this follow-up changes no production code. The earlier 455-test run did not cover these two files; GitHub CI has not yet been revalidated for this head.Validation before the test-fixture follow-up, on combined stack
4cf27a551c: 455 tests and 921 subtests passed on B300, plus the two widened-history regressions against Rust TreeCore. The new FULL-fallback metadata cases cover eager execution and CUDA graph replay. New allocation-reclaim, explicit-prefill and JIT-reuse regressions fail on the previous code and pass with the fixes. These are combined-stack checks, not independent model reruns of each PR.130 tests and 19 subtests passed on B300 at the previous head
e9d09e3adb, covering uniform write plans, KVLocPlan, translator draft disposition, DSPARK draft blocks, and kernel exports/dispatch.Speed Tests and Profiling
Performance validation is reported for the final combined stack below; this run does not attribute an isolated throughput gain to this PR.
Prior combined-stack E2E output/acceptance and throughput results: #44973. These measurements include all five changes before the review updates.
Checklist
CI States
Latest PR Test (Base): 🚫 Run #39128333630
Latest PR Test (Extra): 🚫 Run #39128333628
Latest PR Test (AMD ROCm 10): 🚫 Run #39128333588