Repository navigation
Conversation
… at 8.9 and NVFP4 runs W4A16 below it - build.MIN_CAPABILITY is 8.0 (bf16 MMA, ldmatrix, cp.async) and build.FP8 is 8.9; build.has() asks the GPU, and the refusal names the missing feature. - The FP8 prompt kernels (qmm_prefill8.cu) build from 8.9; below it qmm_prefill8_none.cu refuses them by name, so bf16 prompts work. - The NVFP4 lane matmuls and experts build from 8.0 (bf16 MMA, e4m3 scales converted in software); the checkpoint-math extension stays at 8.9, and precision.own_math already runs W4A16 below it. - capacity.floor: 8.0 for every format with bf16 prompts, 8.9 with --prefill-fp8. - Tests: Ampere builds and refuses FP8, an sm_70 GPU is refused by name, the floor follows prompt precision; the FP8-prompt cases in tests/cuda skip below 8.9.
This was referenced Oct 4, 2026
Closed
Owner
|
Thank you, @gilby. Splitting the floor by feature, bf16 paths from 8.0 and FP8 from 8.9, with every refusal naming what's missing and no arithmetic change on 8.9 and up, is the right shape for this. The A40 receipts make it concrete. The Python engine is frozen (#286), so this won't merge. Zig CUDA builds every kernel for one target list, GB10 at sm_121 by default, so Ampere waits for Zig CUDA to take more targets. When it does, your per-feature floor is the rule we'd give its build, kernel by kernel, with your credit. RTX 30 cards, which are sm_86, are tracked in #139. |
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
Part of #311. CUDA builds and runs from compute capability 8.0 instead of 8.9 for every path that
needs only bf16 tensor cores; FP8 stays at 8.9:
build.MIN_CAPABILITYis 8.0 (bf16 MMA,ldmatrix,cp.async) andbuild.FP8is 8.9;build.has()asks the GPU,and a refusal names the missing feature.
qmm_prefill8.cu) build from 8.9; below itqmm_prefill8_none.curefuses them by name, sobf16 prompts work.
extension stays at 8.9, and
precision.own_mathalready runs W4A16 below it.capacity.floor: 8.0 for every format with bf16 prompts, 8.9 with--prefill-fp8.No kernel arithmetic changes: sm_89+ builds the same code as before, and below 8.9 the existing W4A16 / bf16-prompt
paths run.
Receipt
RadixArk/Qwen3.8-27B-NVFP4-BF16-LMHead@ 009632f withz-lab/Qwen3.8-27B-DFlash2@ 50307d4. Server:tensorfold serve <checkpoint> --backend cuda --drafter <drafter> --context 65536 --parallel P(P = 1 and 4). Startup: "startup estimate 27.88 GiB within39.72 GiB" (31.07 at
--parallel 4), "precision: full (NVIDIA A40, SM 8.6 has neither the block-scaled FP4 nor the FP8 mma):bf16 activations, the stored weights". SM clock median 1,425 MHz under load, 73 °C peak, no throttling.
tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: v0.6.5 refuses: "TensorFold's CUDA kernels need compute capability 8.9 or newer (FP8 MMA); this GPU (NVIDIA A40) is 8.6". Onthis branch:
token_shadrafted =="draft": falseon two prompts (6972e271bc22, 077d971998da), the same in two runs.--levels 2,4 --alone --serialat--parallel 4: 0 failed, alone 6/6 and 12/12, serial 4/4 and 1/1, 0 unequal in all 8 cells.tools/bench_openai.py: before is the refusal above. After,--tokens 256 --reps 5,medians of two runs: fibonacci-raw greedy 43.4 / 43.1, sampled 49.2 / 49.4; gpu-chat greedy 29.0 / 28.7, sampled
26.0 / 26.1 tok/s. Concurrent aggregate (greedy, N=2 / N=4): code 49.9 / 79.7, chat 37.5 / 55.0.
tools/prefill_cold.py: after, 3 reps, median: 2k 1,194 tok/s, 8k 1,265, 16k 1,243.No before (refused).
test_glm5_prompt_kernels::test_fused_index_scores_are_the_three_ops, fails on v0.6.5 too. CUDA on v0.6.5 (one DGX Spark, GB10, sm_121 unchanged):pytest tests/cuda tests/test_cuda_build.py -k "qwen27 or qwen36 or nvfp4 or b16 or qmm or moe or build or distributed or dflash or dspark or exl3 or graph": 681 passed, 0 failed, 81 skipped.pytest tests/cuda tests/test_cuda_build.py -k "qwen27 or nvfp4 or b16 or qmm or build or distributed"on the e4m3 change stacked on this one (this branch plus one kernel helper):371 passed, 0 failed, 59 skipped (one GPU visible). On one DGX Spark (GB10), the CUDA selection above: unchanged
behaviour on sm_121 (same build, same kernels).
--context 65536 --parallel 1: fresh == resumed (2,296 of 2,301 tokens from the prompt cache) =="draft": false,token_sha8b07e71904c8; 19 × 23 drafted =="draft": false7773d573571d. Fail-before: this branch's tests on v0.6.5's tree, on the A40: thetests/cudafiles error at collection (nobuild.has),tests/test_cuda_build.py3 failed, 19 passed; on this branch 62 passed, 25 skipped, 0 failed; without CUDA 22 passed, 3 skipped. On one DGX Spark (GB10),tools/prefill_cold.py(2k / 8k / 16k, 3 reps, median tok/s; runs v0.6.5, this, this, v0.6.5, each side the mean of its two) onRadixArk/Qwen3.8-27B-NVFP4-BF16-LMHead+z-lab/Qwen3.8-27B-DFlash2at--context 131072 --parallel 1, a checkpoint v0.6.5 serves: v0.6.5 → this 2,590 → 2,600 / 2,851 → 2,853 / 2,735 → 2,741.Metal untouched.
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.tests/test_cuda_build.pyfails 3; all pass here and skip without CUDA. See the v0.6.5 check.)