[Kernel][WIP] Optimize exact single-request Qwen3.8 QSA and router - #507
Closed
yangzhuxinyzx wants to merge 3 commits into
Closed
Conversation
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
This was referenced Sep 5, 2026
Contributor
Author
|
Integration audit requested by the repository owner: the complete head bbdf0af is already an ancestor of main 95205a2 through #525 (verified with git merge-base --is-ancestor). Closing this stale stacked Draft as already integrated, not rejected. Its base is still the old HC feature branch; merging it there would not deliver anything new to main. #532 supplies the missing current-source runtime builder and reproducibility acceptance; #510 remains a separate unaccepted experiment. |
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.
Purpose
Implement three lossless follow-ups to the measured single-request no-MTP TP4
V100 baseline: current-source QSA decode top-k runtime parity, 32-bit FP16
router ordering keys, and pre-resolved sparse KV addresses.
Stacked on #506 to retain the 96.411 tok/s HC baseline. Final integration is
main at base755baae1d075ee04fa9096b23fc0225b23589a86. Does not duplicate batched
HC/QSA #504 or Page4 ordering #494: this scope is M1, exact existing FP16
arithmetic/order, and source-overlay runtime binding.
AI assistance: OpenAI Codex. Human review/testing is required. Keep Draft until
endpoint/quality gates pass; operator speedups are not endpoint claims.
Test Plan
rows, followed by changed-input/poisoned CUDA Graph replays.
the2304/2305 specialization boundary; M2 generic fallback unchanged.
order, invalid entries, page relocations and attention/merge arithmetic.
natural-output checks plus262143-input/1-output boundary case. No resident API.
Test Result
Targeted Ruff passes, CPU49 passed/1 GPU-only skip.
48-call control0.252652 ->candidate0.203530ms.
control0.258196 ->decode0.111665ms.
12-call attention/merge including resolver:8K0.345016 ->0.318909ms,
32K0.384205 ->0.367094ms,256K0.365860 ->0.323968ms.
changing-length graph test:128 replays/1536 row comparisons, exact through
fast/fallback boundaries, ReLU ties, close/nonfinite scores and padded rows.
The earlier timing table uses separate K/V buffers; the new test is quality-only.
aggregate98.965175, TPOT10.104565ms. Frozen baseline96.411020/10.372258ms;
observed0.267694ms/token improvement, not a fully deterministic A/B claim.
top-k0.307393 ->0.175693ms; router0.486903 ->0.356512; sparse partial+merge
plus resolver0.553787 ->0.527498ms. These are diagnostic GPU service sums,
not additive endpoint wall time. Keep the recorded rank-skew outlier.
exact boundary completes. These are health/boundary checks, not retrieval.
clean old-source4ae6 control reproduces the same early-EOS513-token hash,
even BEFORE the long request. It also varies after the long request.
This proves that symptom exists without these optimizations, not that all
output drift is harmless. Old control96.107235/96.083709 tok/s before/after.
Existing open PR [Bugfix][SM70] Stabilize QSA page4 order under KV relocation #494 is a relevant allocation-order suspect, not a proven
cause for every NVFP4 difference. Keep Draft pending the integration/quality gate.
repeatability control. All workers/samplers/operator jobs/queues exited;
GPU0–3 released, unrelated GPU4–7 service untouched. No main merge or API.
-100 tok/s and the previous complete-HC1.5ms target remain unmet.
See docs/design/sm70_qwen38_exact_decode_followup.md for contracts, rejected
drifting first timing, sidecar hashes, public reproduction scripts and evidence.