[Kernel][SM70] Improve Qwen3.8 no-MTP concurrency - #474
Merged
yangzhuxinyzx merged 7 commits intoSep 5, 2026
Merged
yangzhuxinyzx merged 7 commits into
yangzhuxinyzx merged 7 commits into
Conversation
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Retain raw storage and dynamic dispatch as independent opt-ins pending full-model quality. Record corrected engine-interval accounting and unmet concurrency targets. Co-authored-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Add benchmark-only multi-row W13 Split-K and grouped W2 with a shared integer route plan. Preserve production defaults pending endpoint and model-quality gates. Record 22 GPU tests and the 2.470 ms 48-route microbenchmark projection. Co-authored-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Trace the HC sharding communication fallback, retain the generic push admission as opt-in, and reject under-covering block overrides. Add mixed-size graph and finite-bit correctness coverage; full-chain performance and model-quality gates remain pending. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Screen a minimal covering grid for opt-in ordinary push collectives while preserving sum2 launches. Extend mixed-size graph tests, add rotating weight allocations, and record the failed complete-chain performance gate instead of promoting a hot-cache-only win. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
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
Improve Qwen3.8-Flash-Next NVFP4 TP4/V100 no-MTP concurrency using measured batch kernels. Frozen C1 reference: 70 tok/s; C4/C8/C16 targets: 238/420/728 aggregate tok/s. Integration base:
45a58ab6749096248dc15b1263bdf5faf51f5c70.This is an AI-assisted WIP checkpoint. Human line-by-line review and quality admission are required before promotion or merge. It is not a release-ready speed claim.
Current checkpoint:
cc22156c2b(DCO-signed). Grouped-MoE implementation remains94dd55c899; the latest native experiment adds opt-in small-message push admission and rejects unsafe batch block-count overrides. Integration was fetched before publication (54478b9d289e); this experiment deliberately retains its frozen base rather than silently incorporating newer main changes. Synchronization and clean-wheel validation remain required before merge.The measured prepared-scale C1 is 80.657 tok/s and must be protected within 1%; the 70 tok/s reference is only the fixed concurrency-efficiency denominator, not permission to regress single-request performance.
Scope and related PRs
_C, with fake ops and productionapplydispatch behindVLLM_SM70_NVFP4_MOE_GROUPED_DECODE=1(default off). Local shape and CPU metadata gates preserve single-token, prefill/mixed/verify fallbacks; no TP/KV/max-seqs/chunk binding. This differs from the rejected split singleton/repeated W2 implementation and avoids repeated planning.Test Plan
Test Result
Single-HC TP4 trace identifies a 10,752-byte intermediate reduction missing the push whitelist: local down/up GEMMs are faster, but pull communication and publication erase the saving. Profiled service is diagnostic, not endpoint latency.
New
VLLM_SM70_TP4_PUSH_ALLREDUCE_SMALL_MESSAGESstays default off. It admits captured, fully-connected TP4 SM70 FP16 aligned messages within the existing 80-KiB buffer; no model/maxseq/chunk/KV binding and no communicator ABI change. When enabled, ordinary collectives use the smallest covering grid, including 40 instead of 80 CTAs for the 80-KiB payload. Flag-off geometry and sum2 admission/geometry remain unchanged.Fixed an unsafe pre-existing tuning override: block count below
ceil(bytes/2048)could leave output tails unwritten. The undersized override now falls back to the established safe launch.New four-rank native gate passes 13 message sizes, three graph orders, eight cycles for each of random/signed-zero/special-value inputs. Finite outputs are bitwise equal to a rank-ordered FP32/FP16 oracle; poisoned outputs, tail canaries and rank skew are covered. Includes an intentionally undersized block override. Not a model-quality score pass. Existing CPU allocator/dispatch suite: 21 passed.
Extended native gate: 64 cycles per pattern, four graph sequences, 13 sizes, all four ranks passed, including interleaved ordinary/sum2 calls with shared push storage. v4 DSO SHA256:
348b782113785d374d397362b37cc93dc06f445d595b7cd4a0d5e5f3fdaf3888.Foreign-worker-contaminated timing attempts were discarded. Valid v4 HC hot-single-pair results were M4 31.235 -> 27.187 us, M8 31.872 -> 28.843 us, M16 33.781 -> 32.486 us. Rotating 16 distinct allocations of the same real weights instead gives 31.370 -> 31.198, 32.018 -> 33.462, and 33.947 -> 36.520 us: the apparent benefit does not survive a layer-like weight working set. This is a cache-footprint microbenchmark, not an actual 16-layer model or endpoint result. Raw timing outliers are retained.
HC sharding is rejected for production; no endpoint run or promotion for this version. Keep generic push opt-in, and next screen fused local pointwise/disjoint-publication work with the rotating-weight case. No new accepted endpoint gain or model-quality pass is claimed.
Rebuilt native
_C; 52 focused admission/native tests passed.108 CPU regression tests passed, 6 GPU-only cases skipped in that CPU run. These overlap the focused suite and are not a summed test count.
Four timing-accounting regression tests passed.
All applicable staged pre-commit hooks passed, including mypy, formatting, header checks and DCO sign-off. WIP implementation checkpoint:
d20a077bf4.New grouped MoE tests: 22 GPU tests passed, including M1--M16 changing-route graph replay, poisoned buffers, all-singleton/repeated/invalid experts, exact grouped W2 versus native W2, and same-split W13 in both physical layouts. This is separate operator evidence, not a model-score pass.
Actual layer-0/rank-0 weights, all 512 experts: raw/prepared outputs bitwise equal at M1--M16 and M784 prefill after separating storage from dispatch. Independent dynamic-QPN mode also matches between storage formats at M1--M16. Synthetic activations; this is not a model-quality score.
Earlier boundary audit: all 30 combinations of layers 0/23/47, ranks 0/3 and M1/4/8/16/784 passed.
Initial raw-on M3/M7 differences (up to
2.38e-7) were traced to an unintended TurboMind-to-QPN dispatch change. That coupling is removed.Remaining full-model C1 completion-hash difference is unresolved. Autotuned prefill reduction is a hypothesis, not a confirmed cause. Raw storage stays off.
Timing correction — targets remain unmet
Legacy fixed-width
get_output()blocking wait excludes processing between receives and overestimates throughput. Original raw records are retained. Corrected aggregate uses emitted tokens divided by summed consecutive eligible engine timestamp intervals; input, seed and frozen 70 tok/s reference are unchanged.These paired diagnostics predate the latest admission fix. Raw saves about 1.73 GiB/worker but adds only 1.66%/0.80% aggregate throughput at C8/C16 in that pair. Both arms use identical pinned custom-AR/FlashQLA sidecars; this is not a clean-wheel gate. The original request-level baseline and fixed-width steady-state results remain distinct contracts.
Evidence and risks
HC follow-up: no candidate admitted
Offline complete-graph attribution splits dense service into HC projections 3.558 ms, GDN inputs 2.023 ms and other roles, 9.334 ms total inside the old model graph (excludes outside-graph LM-head/sampling). HC postops add 1.074 ms. It also corrects the old residual interpretation: service overlap is 1.334 ms and no-kernel gaps 1.929 ms in the complete graph. Wall minus service is not a closed CPU/GPU-idle decomposition.
New benchmark-only FP16 tensor-core HC fusion and batched output-sharding screens all fail the performance gate. Actual layer-0 attention-HC weights, synthetic inputs, CUDA graphs, full Mix chain including both projections/epilogues/communications as applicable:
These are operator screens, not full-model latency. Changed-input/poisoned-workspace graph replay matches candidate eager results, but candidate-versus-control reductions differ and model scores remain untested. A vector-load follow-up had foreign GPU interference and unstable samples; its timings are not admissible. The distributed screens check process exclusivity before/after each timing group. No performance or quality promotion, new default, runtime dispatch or endpoint run results from this work. All staged pre-commit hooks pass, and task-owned GPU workers/locks are released.
This batch screen borrows the output-sharding idea from related #481, not its M1 kernel or communicator ABI. Local GEMM, scatter and collective costs must be broken down before a fused compute/publication design; do not repeat these losing implementations unchanged. Raw JSON/log names and commands are retained in the worklog.
Guarded production engine result
The source-build control/candidate/control run completed on the fixed TP4/V100 no-MTP 8K/256 workload. Same native
_CSHA25676f106f86f7e7bdf5f8a51b64378fee7ee09ba8a6d3cb51e699a944985711858, prepared scales, FP32 GDN state, FP16 KV, prefix/Mamba align, 256K max length, 2048 prefill chunk, max-seqs16. Only grouped decode differs.C16 complete step: disabled 29.566/29.589 ms, enabled 27.371 ms; 2.207 ms actual saving. Full-graph M8/M16 route hits confirmed. C1 protected; concurrency targets remain unmet. This is not a clean-wheel or model-quality gate. All task workers exited and GPUs were released.
Production loader/apply audit on real weights confirms M8/M16 hits, exact M1/M4/M8 and M17/M32/M784 fallbacks, M16 max abs
2.38419e-7and relative L21.38547e-4, and exact graph/eager repetition. Mixed-NVFP4/dispatch CPU suites, the final 33-test dispatch suite and the 22 native GPU tests pass (CPU suites overlap, not additive). All applicable staged pre-commit hooks pass. No new quantization is introduced, but C16 FP32 association differs. Final CPU-integer metadata hardening fails closed for tensor metadata; the engine experiment predates this defensive check and whitespace-only CUDA formatting, neither changes the screened host-integer route.All C1 completion hashes agree. Multi-request completions vary even between the two disabled controls; the cause and quality effect are not established. Quality scores, including actual decode-path rather than prefill-only perplexity, remain mandatory before enablement. No quality-pass or release-ready claim.
Latest grouped-MoE screen (benchmark-only)
1.90735e-6, relative L21.97128e-4; no model-quality scores have passed yet.Detailed commands, artifact names, binary SHA256s, prior rejected variants, overlap with #481 and all pending gates are in
docs/design/sm70_qwen38_nomtp_concurrency.md.Portable diagnostic:
benchmarks/kernels/verify_sm70_nvfp4_moe_raw_storage.py --model <checkpoint-dir> --layers 0,23,47 --ranks 0,3 --tokens 1,4,8,16,784 --out raw-storage.json(one idle SM70 GPU).No model files, generated libraries, profiler captures, environment caches or private credentials are included. Keep Draft; do not merge until quality, throughput, clean-wheel and human-review gates pass.