[Kernel][WIP] Continue exact single-token HC latency optimization - #506
Merged
Merged
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>
Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Keep aligned low-rank rows packed, preserve unaligned output support and the existing protocol. Full-HC scalar/vector owner-DSO gate: 1.971644 -> 1.899800 ms, bitwise on all ranks with auxiliary sum2. Public standalone oracle queued; full-model target remains pending. Assisted-by: OpenAI Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
This was referenced Sep 5, 2026
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
Continue the single-request/no-MTP Qwen3.8 HC <=1.5 ms work after #481 merged.
Integration base: public/main
755baae1d0; integration merge4b6c2daa1f.This is separate from #504's batched HC scope. Do not merge/promote on the
basis of microbenchmark numbers: the 1.5 ms full-HC target is NOT achieved.
Implementation
8f74e4b88b: only SM70, FP16,N=1, HC=4, H=2560. Other shapes/dtypes/architectures and prefill unchanged.
Only move the weight load; no public flag or extra weight copy.
dependency, not a new implementation claim in this PR.
Test Plan and Result
(1.93%); all intermediate/final FP16 bits match on 4 ranks x16 inputs and
after timing. Up fusion fixed on both sides. No new communication here.
e76a9c8ca3succeeds:two thinking-enabled natural-EOS official-sampling checks pass (118/110
outputs). 8K/513 untraced pure decode 93.433729 tok/s, 10.702773 ms/token;
prefill 1.162319 s. This is one measured repeat, not an endpoint campaign.
old HC bucket 2.658072 -> 2.165077 ms; complete semantic HC
2.701252 -> 2.208302 ms. Rank-max mean 2.237414, rank-average p50 2.188509.
Outliers are retained. GPU service sums are not additive wall critical path.
V2, FP16 A/KV, checkpoint-native NVFP4, no online QPN8, no MTP, no prefix
cache, max context262144, q8192, dual graphs, hybrid PLE; Torch2.10.0+cu128.
Evidence and Remaining Gates
Retained worktree:
/home/ymzx/桌面/1cat-vllm/worktrees/v100-qwen38-nomtp-token-trace-20260903-173451.Artifacts
.artifacts/hc_norm_prefetch/registered_result.jsonand.artifacts/hc_trace_20260905_retry1/include contract, logs, quality/result,raw/converted trace and per-token tables. Hashes and rejected variants are
recorded in
docs/design/sm70_v100_migration_control.md.First full-model attempt failed BEFORE generation because the quality harness
passed tokenizer Mapping keys as IDs. CPU-validated correction precedes the
single successful retry; preserve the failed logs. Do not call it a model
quality failure or hide the startup.
The 256K INPUT quality boundary, repeated endpoint evidence, integration-head
GPU validation and <=1.5 ms acceptance remain pending. The new trace includes
earlier W13/W2 changes too; do not attribute all endpoint gains to HC. Next
bounded candidate is H8/512-thread fused-up scheduling, not the rejected
H8/256-thread geometry. No numerical contract change is allowed.
AI assistance: OpenAI Codex. Commits are DCO-signed; human review is required.
H8 scheduling screen completed
At
2c2ec3f38d, full-HC production 1.948767 ms, private H4 control 1.970251,private H8/512 candidate 1.953417. Although geometry improves the private
control by 0.016835 ms, the candidate does not beat production and is NOT
ported/admitted. All 4 ranks x16 inputs, 512 actual auxiliary sum2 replays and
post-wrap generation195841 checks are bitwise. Both fused kernels 30 registers,
zero spills. Artifact
.artifacts/hc_up_h8_threads/result.json. All testprocesses exited and GPUs0-3 returned to 141/7/7/7 MiB. No further model start.
Current down counters and vector output scatter (4ae6a00)
The old NCU report measured 324 replicated down rows. A focused current
81-live-row/grid88/block128 profile instead finds 6.51% achieved occupancy,
216.88 GB/s, 91.84% no-eligible scheduler cycles and long-scoreboard 63.9%.
Clock-control none/cache-control all; cold NCU duration is not endpoint timing.
Existing trace collective-ordinal analysis shows 4.888424 us/call remain after
the last rank starts (5.620995 us total average service).
SASS identifies scalar scatter/routing overhead. Keep contiguous low-rank rows
packed as 16-byte output stores; separately scatter injection/padding, retain
unaligned scalar fallback. No arithmetic/protocol/IPC/epoch/up/norm change.
Paired full-HC test with old scalar and new vector in the SAME owner DSO:
1.971644 -> 1.899800 ms, saving 0.071844 ms (3.64%). All four ranks pass
raw-bit aligned/unaligned/guard tests, 16 changing full-HC inputs, 512 actual
auxiliary sum2 replays and post-timing bitwise checks. The source and independent
model-free public verifier are committed. The public verifier's additional
eight-alignment/reference GPU run is queued behind another task's reservation,
not yet claimed passed. This turn performed NO full-model start.
Evidence
.artifacts/hc_down_ncu_20260905/and.artifacts/hc_down_vector_scatter/; result/binary/source hashes in worklog.Do not subtract the micro gain directly from the previous 2.208302-ms model
trace. Full-model/256K/1.5-ms gates remain pending. An explicit down load-ahead
attempt was rejected offline because compiler rescheduling erased the intended
lookahead; no redundant GPU experiment was run for it.