Repository navigation
CUDA: pair Qwen3.8 FP8 GDN QKV and Z projections - #4664
Draft
Maharajahu wants to merge 2 commits into
Draft
Maharajahu wants to merge 2 commits into
Maharajahu wants to merge 2 commits into
Conversation
This branch has not been deployed
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
Qwen3.8-27B NVFP4 now uses one CUDA launch for the two scalar-FP8 Gated DeltaNet QKV and Z projections when the SM120 forward has exactly 16 rows. Each cluster still processes one output tile with the existing 128-thread tile, two K slices, accumulation order, and BF16 output rounding. The paired entry uses the existing qmmf body.
mainat833d8ec46562a4f34d4d81fc1b945a55aba51009.atc overlap --json: rerun on 2026-11-22 at 20:06 UTC against that base. The broad report was partial due to GitHub coverage and time limits. Direct merge-tree comparisons confirmed that the detected conflict on MiMo-V2.6-Flash on CUDA (2x GB10) with DFlash as the drafter #728 is inherited from pristinemain. The earlier selected check also classified CUDA: #1764's BF16 prompt tile for Qwen ModelOpt, Nemotron and Dory, plus two exact Qwen prompt kernels (#1762) #2008 and Ling-3.1-flash on CUDA, on one or two GB10s #2340 as inherited, and the selected Qwen overlaps as clean.Checks on this head
e39457e4b0b85071c427def1bc6dda99eebe8f80. Its sole difference from the code and measurement commit91b97a4862218ab511e48b9a33a2216c761350e2is the Unreleased changelog entry for this PR.tools/pr_check.py --base origin/main --pr 4664reported 0 errors and 0 warnings on the pushed head.zig build test test-golden -Dcpu=baseline -Doptimize=ReleaseFaston Windows: 775/775 steps succeeded, 2,717 tested cases passed and 96 skipped in this incremental invocation. Remaining steps were reused from cache.zig fmt --check build.zig zigandgit diff --check origin/main..HEADpassed.zig build -Dgpu=sm_120 -Dnvcc=PATH -Doptimize=ReleaseFast: 151/151 steps on WSL2.zig build check-pdl-loads -Dsm=120 -Dnvcc=PATH: 0 early reads in 212 functions from nine CUDA images. The PDL Python suite passed 18/18.Receipt
482ca0f3832238542f8f5295dde86b5f22711d80and DFlash250307d4c4cde6860d4eee73e2547cd786fe8e8a4.462f5eca3e2a6c8095c2d2c7504a37d8e3768925. Its delta to the final merge base is two DeepSeek test files and changelog. Candidate served binary:91b97a4862218ab511e48b9a33a2216c761350e2.min_rows=16on both binaries.ff6166226c1b344d61efb8feaf76f6f2760c9a9f998639333554d1024b2ad8f1.python3 tools/bench_qwen_fp8_pair.py SERVER MODEL DRAFTER OUTPUT --suite decode-prefill --tokens 128 --reps 3. For the concurrency cells use--suite concurrent --context 8192 --parallel 4 --tokens 128 --reps 1.CUDA launch strategies on SM120
This follow-up uses the same RTX 5090, FP8 weights, activation inputs, and compiled qmmf image for all three arms. The separate arms run the existing 128-thread scalar FP8 kernels. Each trial measures a CUDA Graph with 96 projection pairs and rotates across eight weight banks.
Two streams recovered 2.78 µs of the sequential baseline. The fused launch saved a further 2.09% versus two streams. All 60 output comparisons were byte-identical over 524,288 bytes per case, with guard bytes intact.
Three-way microbenchmark timing samples, µs per pair
{"successive":[58.19633102,58.2816658,58.17699814,58.43832779,57.99833679,57.93099976,57.95733261,57.88133621,57.97133255,57.89700317,57.90233231,58.1713295,57.93600082,58.2183342,58.01133347,57.89466858,57.9106636,57.93033218,58.02433395,58.01533127,58.0356636,57.96033096,57.98600388,57.93233109,57.93533325,58,57.98933411,57.87333298,57.99633408,58.03466797,57.93466568,58.0146637,57.9786644,57.95899963,58.00700378,57.97200012],"two_streams":[55.56466675,55.25999832,55.87600327,55.31433105,55.18133545,55.49699783,55.06433487,54.98899841,55.19266129,54.875,55.23733521,55.48066711,55.22066879,55.29533386,55.21966553,55.20633316,55.20000076,55.16433334,55.19733047,55.33833313,55.30866623,55.19067001,55.02633286,55.08533096,54.94466782,55.08466721,55.26433182,54.95632935,55.16333389,55.08333206,55.0316658,55.22599792,55.03133774,55.03700256,55.21666336,55.22900009],"fused":[54.23466873,54.23266602,54.16666794,54.07600021,54.09199905,54.00033188,54.04299927,54.02099991,54.01233292,53.99399948,54.0316658,54.0890007,54.0423317,54.04699707,54.02033615,54.07799911,54.04166794,54.11999893,54.07733154,54.03666687,54.02532959,54.07633591,53.98266602,54.01199722,54.04966736,54.04566956,54.03066635,54.02499771,54.04866409,54.06700134,54.04666519,54.16900253,54.07733154,54.0870018,54.11300278,53.9560051]}Served A/B
The cold fixture IDs, token fingerprints, and output hashes matched across the tested binaries. Full token hashes matched for the smoke and five cold lengths. Greedy drafted replies matched
"draft": false. The four-stream cells matched their standalone twins for both prompts.Median decode at 128K capacity, in tok/s. The base replay has two 128-token repetitions per cell and the pushed head has three.
First-request TTFT in seconds. The full cold run covered 130,816 prompt tokens, leaving room for output within the 131,072-token capacity. Every tested TTFT difference was within 0.3%.
Single-sample aggregate decode at 8K context, in tok/s.
Raw timing samples and response fingerprints
{"base":{"smoke_token_sha256":"5b5aee39478f3b3b0c8257bbdfb48a12cad3f409a4c935ddddc2775575600a5c","decode":{"fibonacci-raw":{"median_tok_s":269.54258873236984,"samples_tok_s":[269.57,269.52],"token_fingerprints":["54154e1e4a68","54154e1e4a68"],"output_sha256":["f6681fc4096a2afee8f614093d34ba8f087f823dea549555a572289beab77c32","f6681fc4096a2afee8f614093d34ba8f087f823dea549555a572289beab77c32"]},"gpu-chat-no-think":{"median_tok_s":216.64565603579535,"samples_tok_s":[213.94,219.35],"token_fingerprints":["562daa043166","562daa043166"],"output_sha256":["0b49d927e63c55f7fb2515ad72a89a9fd407ae3cc3c97ecd2f46e512a70f0300","0b49d927e63c55f7fb2515ad72a89a9fd407ae3cc3c97ecd2f46e512a70f0300"]}},"prefill":{"2048":{"fixture_sha256":"3e753c1250a8a57743cd8a46ac68893ce736ed218cfbb9681901f249a197c3f0","ttft_s":[0.5206635350000397,0.510511772999962,0.510897340000156],"token_sha256":["31902dd2f98a4f4165d466fccc3a6a4cfc7133fd19fa2bcf0f4bc5b925547321","31902dd2f98a4f4165d466fccc3a6a4cfc7133fd19fa2bcf0f4bc5b925547321","31902dd2f98a4f4165d466fccc3a6a4cfc7133fd19fa2bcf0f4bc5b925547321"]},"8192":{"fixture_sha256":"61a7b455f4ffad1969ff2ac6f8821460e72d5aa40bf27677660b1c662964b4c9","ttft_s":[2.1197655820001273,2.110145384999896,2.11296506199983],"token_sha256":["9d2a4c21b5778520ccbfbd5c7e50ca875fe3af74569031396d6eec90e0ce4033","9d2a4c21b5778520ccbfbd5c7e50ca875fe3af74569031396d6eec90e0ce4033","9d2a4c21b5778520ccbfbd5c7e50ca875fe3af74569031396d6eec90e0ce4033"]},"32768":{"fixture_sha256":"cc804f8d47e3ccda74480aa8c2c7c2b8e47ea7022298b5684a1027beca33fe19","ttft_s":[9.549979567000037,9.545949171000075,9.54899315800003],"token_sha256":["ebf2cdf53eb4759b0bc0295346663c592f4c54e9b53e76136defa79240e8c579","ebf2cdf53eb4759b0bc0295346663c592f4c54e9b53e76136defa79240e8c579","ebf2cdf53eb4759b0bc0295346663c592f4c54e9b53e76136defa79240e8c579"]},"65536":{"fixture_sha256":"623649f8d5c589d936ef0268ea99d3875d816cda654f45e07fca1ffd40fb8e0e","ttft_s":[21.818554001999928,21.838143159999845,21.869441111000015],"token_sha256":["c4fc9684a1493647375040f2784276e19b00dcc06436bf27ebb5ea2a743fcde9","c4fc9684a1493647375040f2784276e19b00dcc06436bf27ebb5ea2a743fcde9","c4fc9684a1493647375040f2784276e19b00dcc06436bf27ebb5ea2a743fcde9"]},"130816":{"fixture_sha256":"a12db87248d24d12b51c6822cc2e69a8c4fab770ba6cb231f5653f47cfc60861","ttft_s":[54.64548565600012,54.64436188500008,54.58184911399985],"token_sha256":["3b6c238a525e554b1e22aec63af8e0154051aff4f756e148f802270d98ebabdd","3b6c238a525e554b1e22aec63af8e0154051aff4f756e148f802270d98ebabdd","3b6c238a525e554b1e22aec63af8e0154051aff4f756e148f802270d98ebabdd"]}},"concurrency":[{"prompt":"code","streams":1,"aggregate_tps":259.7,"alone":{"equal":1,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":102,"plain_drafted":0}},{"prompt":"code","streams":4,"aggregate_tps":575.6,"alone":{"equal":4,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":102,"plain_drafted":0}},{"prompt":"chat","streams":1,"aggregate_tps":214.9,"alone":{"equal":1,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":96,"plain_drafted":0}},{"prompt":"chat","streams":4,"aggregate_tps":377.4,"alone":{"equal":4,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":96,"plain_drafted":0}}]},"head":{"smoke_token_sha256":"5b5aee39478f3b3b0c8257bbdfb48a12cad3f409a4c935ddddc2775575600a5c","decode":{"fibonacci-raw":{"median_tok_s":272.95153905114984,"samples_tok_s":[274.12,272.17,272.95],"token_fingerprints":["54154e1e4a68","54154e1e4a68","54154e1e4a68"],"output_sha256":["f6681fc4096a2afee8f614093d34ba8f087f823dea549555a572289beab77c32","f6681fc4096a2afee8f614093d34ba8f087f823dea549555a572289beab77c32","f6681fc4096a2afee8f614093d34ba8f087f823dea549555a572289beab77c32"]},"gpu-chat-no-think":{"median_tok_s":223.16334009990223,"samples_tok_s":[223.16,223.46,222.68],"token_fingerprints":["562daa043166","562daa043166","562daa043166"],"output_sha256":["0b49d927e63c55f7fb2515ad72a89a9fd407ae3cc3c97ecd2f46e512a70f0300","0b49d927e63c55f7fb2515ad72a89a9fd407ae3cc3c97ecd2f46e512a70f0300","0b49d927e63c55f7fb2515ad72a89a9fd407ae3cc3c97ecd2f46e512a70f0300"]}},"prefill":{"2048":{"fixture_sha256":"3e753c1250a8a57743cd8a46ac68893ce736ed218cfbb9681901f249a197c3f0","ttft_s":[0.5220763049999277,0.5111275899998873,0.5111758099999406],"token_sha256":["31902dd2f98a4f4165d466fccc3a6a4cfc7133fd19fa2bcf0f4bc5b925547321","31902dd2f98a4f4165d466fccc3a6a4cfc7133fd19fa2bcf0f4bc5b925547321","31902dd2f98a4f4165d466fccc3a6a4cfc7133fd19fa2bcf0f4bc5b925547321"]},"8192":{"fixture_sha256":"61a7b455f4ffad1969ff2ac6f8821460e72d5aa40bf27677660b1c662964b4c9","ttft_s":[2.121812794000107,2.1150687259998904,2.118147386999908],"token_sha256":["9d2a4c21b5778520ccbfbd5c7e50ca875fe3af74569031396d6eec90e0ce4033","9d2a4c21b5778520ccbfbd5c7e50ca875fe3af74569031396d6eec90e0ce4033","9d2a4c21b5778520ccbfbd5c7e50ca875fe3af74569031396d6eec90e0ce4033"]},"32768":{"fixture_sha256":"cc804f8d47e3ccda74480aa8c2c7c2b8e47ea7022298b5684a1027beca33fe19","ttft_s":[9.56337090199986,9.553508738000119,9.55587532100003],"token_sha256":["ebf2cdf53eb4759b0bc0295346663c592f4c54e9b53e76136defa79240e8c579","ebf2cdf53eb4759b0bc0295346663c592f4c54e9b53e76136defa79240e8c579","ebf2cdf53eb4759b0bc0295346663c592f4c54e9b53e76136defa79240e8c579"]},"65536":{"fixture_sha256":"623649f8d5c589d936ef0268ea99d3875d816cda654f45e07fca1ffd40fb8e0e","ttft_s":[21.85170700300023,21.86398734000022,21.880697990000044],"token_sha256":["c4fc9684a1493647375040f2784276e19b00dcc06436bf27ebb5ea2a743fcde9","c4fc9684a1493647375040f2784276e19b00dcc06436bf27ebb5ea2a743fcde9","c4fc9684a1493647375040f2784276e19b00dcc06436bf27ebb5ea2a743fcde9"]},"130816":{"fixture_sha256":"a12db87248d24d12b51c6822cc2e69a8c4fab770ba6cb231f5653f47cfc60861","ttft_s":[54.67429834099994,54.66572791699991,54.66712659599989],"token_sha256":["3b6c238a525e554b1e22aec63af8e0154051aff4f756e148f802270d98ebabdd","3b6c238a525e554b1e22aec63af8e0154051aff4f756e148f802270d98ebabdd","3b6c238a525e554b1e22aec63af8e0154051aff4f756e148f802270d98ebabdd"]}},"concurrency":[{"prompt":"code","streams":1,"aggregate_tps":273.1,"alone":{"equal":1,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":101,"plain_drafted":0}},{"prompt":"code","streams":4,"aggregate_tps":574.5,"alone":{"equal":4,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":101,"plain_drafted":0}},{"prompt":"chat","streams":1,"aggregate_tps":217.2,"alone":{"equal":1,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":96,"plain_drafted":0}},{"prompt":"chat","streams":4,"aggregate_tps":378.4,"alone":{"equal":4,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":96,"plain_drafted":0}}],"serial_128k":[{"prompt":"code","streams":1,"aggregate_tps":273.3,"alone":{"equal":1,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":102,"plain_drafted":0}},{"prompt":"chat","streams":1,"aggregate_tps":221.7,"alone":{"equal":1,"unequal":0,"failed":0},"serial":{"equal":1,"unequal":0,"failed":0,"accepted":96,"plain_drafted":0}}]}}TraceView coding benchmark at 128K
Both runs used the same TraceView task and Nsight inputs, Qwen3.8-27B NVFP4, Codex CLI 0.171.0-alpha.13, low reasoning, and the RTX 5090. The cutoff for both was the request that starts the first demo recording. The timings cover implementation, tests, and Chromium verification.
BLACKFURY ran natively on Windows with nine draft nodes, up to 2,048 rows per prefill pass, and its own FP8 fusion. The upstream run used WSL2, 15 draft nodes, and up to 4,096 prefill rows. It reported zero reused input and spent 1192.6 seconds in active prefill. Treat these as whole-configuration results for an autonomous workload. The controlled CUDA comparison above isolates the launch strategy.
The upstream run completed 16 product tests and 20 independent numerical checks on the provided captures. Its output also passed 20 numerical checks on a held-out capture.
CUDA kernel contract
The paired launch names the two existing scalar FP8 lane launches as its replacement. The test covers non-finite input, repeatability, guard bytes, and exact replacement bytes in both projections. The planted Z scale mismatch was detected at byte 327,680, the start of the Z output.
Exit 0 on RTX 5090. The entry's measured pinned nvcc 13.0.88 records for SM120 and SM121 are 40 registers/thread, 1,024 static shared bytes (reserved), 24,576 dynamic shared bytes, zero local bytes, 128 launch bound, and a two-block cluster. SM121 runtime was not run.
Checklist