Skip to content

[Kernel][SM70] Scale NVFP4 E4M3 decode batches - #282

Merged
yangzhuxinyzx merged 3 commits into
mainfrom
codex/v100-qwen38-nvfp4-b8-scaling-20260824-210500
Aug 24, 2026
Merged

yangzhuxinyzx merged 3 commits into
mainfrom
codex/v100-qwen38-nvfp4-b8-scaling-20260824-210500

Conversation

@yangzhuxinyzx

@yangzhuxinyzx yangzhuxinyzx commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Purpose

Scale two exact SM70 inference-engine operator contracts without model/checkpoint/architecture identity checks:

  • FP8-E4M3, GQA-6, D256 paged-XQA decode for B2-B16, including paired KV loads and long-context graph routes.
  • Combined top-k/top-p masking for B8/B16 x 248,320 logits tensors using an eight-warp launch.

Qwen3.8-27B NVFP4 is the matched performance and quality workload only; it does not participate in runtime admission. Gates use SM70 capability, FP8 format, batch/tensor shape, paged-KV layout, graph context, and sampler settings.

Rollback switches:

  • VLLM_FLASH_V100_E4M3_BATCH_XQA=0 restores scalar paged attention for B2-B16.
  • VLLM_FLASH_V100_E4M3_BATCH_XQA_OPTIMIZED=0 keeps XQA but restores scalar KV loads, the original E4M3 converter, and baseline CTA routing. B1 always keeps the original converter.
  • VLLM_SM70_TOPK_TOPP_B8_B16_8_WARPS=0 restores the prior Triton launch heuristic.

Base: onecat/main@f6a5b57b645867d87f83ada43231f2dd25b40a4a
Head: 5d05b74bb56f9d665b0f5c4788df3b17ef1fa6d3

Audit fixes

  • Rebases cleanly over generic prefix-anchored SWA from [Attention][Core] Add generic prefix-anchored SWA on SM70 #281; both original [Kernel][SM70] Scale NVFP4 E4M3 decode batches #282 patches are git range-diff equivalent after rebase.
  • Keeps the fast packed E4M3 converter inside batch optimized instances only, so B1 and rollback paths retain main SASS.
  • Prevents Flash-V100-only E4M3 graph variants from being captured when FLASHINFER_SM70 is explicitly selected.
  • Leaves all pre-existing XQA kernels unchanged: 115/115 common instances are SASS-identical, zero changed or missing; only six batch-optimized instances are added.

Performance contract

Four V100-SXM2-32GB, TP4, compressed-tensors NVFP4 weights, FP16 activations, FP8-E4M3 KV, Flash-V100, prefix cache, Mamba align, no speculation, FULL decode graphs. Official SPEED-Bench low_entropy, temperature 1.0, top-k 20, top-p 0.95, natural EOS, seed 20260822, 512 output cap, one warmup plus three measured repeats. Only steady full-batch pure decode is reported; TTFT, prefill, and endpoint throughput are excluded.

Context B Control tok/s Candidate tok/s Speedup Candidate efficiency FP8 reference efficiency
1K 1 72.65 72.62 1.000x 100.0% 100.0%
1K 8 402.98 465.24 1.154x 80.1% 87.4%
1K 16 641.95 772.44 1.203x 66.5% 72.3%
16K 1 63.10 63.00 0.998x 100.0% 100.0%
16K 8 186.97 356.52 1.907x 70.7% 67.7%
16K 16 222.61 527.00 2.367x 52.3% 49.1%

The geometric-mean scaling-efficiency gap to FP8 is 2.2% at B8 and 1.0% at B16. At 16K, NVFP4 exceeds the matched FP8 efficiency by 4.4%/6.5% at B8/B16.

Test plan and result

  • Final-head focused CPU engine policy/dispatcher/sampler tests: 24 passed.
  • [Attention][Core] Add generic prefix-anchored SWA on SM70 #281 prefix-anchored compatibility regressions on this head: 32 passed.
  • Final-head SM70 source build with CUDA 12.0 / Torch CUDA 12.8 minor-version warning: passed and linked.
  • Changed-file pre-commit including Ruff, clang-format, Markdown, mypy, SPDX, config and docs gates: passed.
  • Same-toolchain SASS comparison to the [Attention][Core] Add generic prefix-anchored SWA on SM70 #281 main build: 115/115 common XQA instances identical, six new, zero changed/missing.
  • V100 operator evidence on the same optimized math/routes: 8 attention comparisons (B2/B16 at p64/p128/p256 and B8/B16 long context), within one FP16 ULP and mean absolute error <= 1e-5; 2 sampler comparisons (B8/B16), bitwise equal to rollback.
  • Matched GSM8K main/test, 32 prompts each at B1/B8/B16: 22/32 to 23/32 at B8, 23/32 unchanged at B16, zero invalid outputs.

No full-model end-to-end or throughput run was repeated after the final current-main rebase; the audited performance patches are equivalent, the measured optimized instances are unchanged, and the requested merge scope is source plus focused validation.

@yangzhuxinyzx

Copy link
Copy Markdown
Contributor Author

CI note: the repository-wide pre-commit job failed on existing all-files debt, not on this PR's files. The job ran pre-commit ... --all-files, and Ruff format/clang-format/Markdown/SPDX plus legacy policy hooks changed or flagged unrelated base files. Intersecting the CI-generated diff headers with this PR's 12 changed paths gives zero matches. The same baseline failure is present on merged PRs #278 and #279.

For this head, the changed-file pre-commit suite passes locally in full (Ruff check/format, typos, clang-format, Markdown, mypy, SPDX, config/docs gates), along with 36 focused CPU tests and 10 focused SM70 GPU tests. The PR remains Draft pending the queued post-rebase TP4 full-model smoke.

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Keep the original E4M3 converter on B1 and non-optimized XQA paths, prevent Flash-V100-only E4M3 graph variants under an explicit FlashInfer backend, and record the post-rebase build, regression, and SASS audit evidence.

Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
@yangzhuxinyzx
yangzhuxinyzx force-pushed the codex/v100-qwen38-nvfp4-b8-scaling-20260824-210500 branch from b7ad29d to 5d05b74 Compare August 24, 2026 17:31
@yangzhuxinyzx
yangzhuxinyzx marked this pull request as ready for review August 24, 2026 17:31
@yangzhuxinyzx

Copy link
Copy Markdown
Contributor Author

Final audit note: pre-run-check passed. The repository-wide manual pre-commit job failed because its all-files formatter rewrote 228 pre-existing main-branch files; that set has zero overlap with this PR's 12 changed files. The complete changed-file pre-commit suite passes on the final head. Additional current-main evidence: 24 focused engine-policy tests, 32 #281 compatibility regressions, successful SM70 compile/link, and 115/115 common XQA SASS instances identical with only six new optimized instances. The all-files baseline drift is not attributed to #282.

@yangzhuxinyzx
yangzhuxinyzx merged commit acc0f6f into main Aug 24, 2026
1 of 2 checks passed
@yangzhuxinyzx
yangzhuxinyzx deleted the codex/v100-qwen38-nvfp4-b8-scaling-20260824-210500 branch August 26, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant