Repository navigation
CUDA: native TFQ3 (3/4/5-bit 2D-FWHT) runtime + drafters for Qwen3.8-27B, GLM-5.3-Flash, and Flash Next - #4986
Conversation
01e0286 to
4ae547e
Compare
|
Rebased onto Live NVIDIA GB10 (
|
4ae547e to
b69a8bd
Compare
|
@ashhart four error-path defects in the CUDA TFQ3 loader, read at
A possible fix for 1 and 2: commit to the store transactionally. Reserve |
b69a8bd to
92bdd18
Compare
92bdd18 to
13e34e9
Compare
e144319 to
b1c334f
Compare
Reject misaligned tensor offsets and orphan table sidecars; preserve finite table refusals. Co-authored-by: jschmied <[email protected]>
Keep explicit output-sign periods repeating across narrowed views. Add boundary, rounding and loader regression checks.
…release SMs Measured on a GB10 with nvcc 13.0.88 by tf-cuda-test kernel-contract-limits over the release fatbins: 14 RECORD lines, five SM slots each. Later compilers keep their independent pending selection.
b1c334f to
98fb9b9
Compare
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're credited as a TensorFold contributor. |
Summary
Adds native CUDA runtime and speculative-drafter support for TFQ3 (3/4/5-bit
2D-AffineCoset/half4+ randomized 2D FWHT-128) checkpoints across all three shipped TFQ3 model families (sm_80+):zig/src/cuda/tfq3*.zig,zig/kernels/cuda/tfq3*.cu,tfq3_common.cuh):PWV3(pw_v3_tables.bin),TFPN(dense/non-MoE.tffpw), andTFPW(routed MoE.tffpw) v3 shards.mma.sync.aligned.m16n8k16.row.col.f32.f16.f16.f32dense kernels (tf_tfq3_wmma_sk8_{3,4,5}bwith 3Dgrid.zfor single-launch bit-exact verify acrossrows = 1..64andtf_tfq3_wmma_fused_{3,4,5}bfor wide-Nlm_headand prefill), plus fused routed MoE kernels (tf_tfq3_moe_gu_swiglu,tf_tfq3_moe_down) supporting mixed 3/4/5-bit HeatAlloc experts.qwen3_5) CUDA TFQ3 + DFlash2 + DSpine:DFlash2andDSpine+ copies.glm) CUDA TFQ3 + MTP + DFlash2:nonmoe.tffpw+layer_03..44.tffpw+ MLX/BF16 residuals, wires KDA/DSA/MLP/MoE TFQ3 projections, and shares the TFQ3lm_head(DraftHead) with both built-inMTP(layers.45) and externalDFlash2drafters at zero extra VRAM.flashnext) CUDA TFQ3 + MTP + 3b/4b/8b PLE:layer_00..47.tffpwand MTP draftermtp_00.tffpwlayers, dequantizes MLX 8-bit/32 non-MoE weights, and adds MLX 3-bit/32 (plus 4b/8b) PLE n-gram row dequantization.Verification (NVIDIA GB10,
sm_121, CUDA 13.0)Qwen3.8-27B-TFQ3(tensorfold-native serve, greedytemp=0,max_tokens=256):thinking=False, 100% bit-exactsha=738f62e12436):--no-drafts15.1 tok/s →+ DFlash252.5 tok/s (3.48×, 4.65 tok/round) →+ DSpine56.6 tok/s (3.75×, 5.12 tok/round).thinking=True, 100% bit-exactsha=1454fc526024):--no-drafts15.1 tok/s →+ DFlash243.8 tok/s (2.90×) →+ DSpine45.6 tok/s (3.02×).Qwen3.8-27B-MLX-4bit): bit-exactnodraft == DFlash2(15.0→62.0 tok/s).GLM-5.3-FlashTFQ3 shards + liveGLM-5.3-Flash-DFlash2:nonmoe.tffpwdense 4b/5bsk8+fused(lm_head, MLP, attention, shared expert):cos = 0.9999999–1.0000000vsfp64, bit-exactr1 == r16(0diffs),215–244 GB/s.layer_03.tffpwMoE (288 experts, 3b/4b/5b,act=0, lim=7.0,top_k=8):cos = 0.9999967–0.9999989vsfp64, bit-exactr1 == r16(0/32,768diffs).GLM-5.3-Flash-DFlash2(bits=40.93 GiB and BF16 2.11 GiB) wired to real TFQ3DraftHead: passes fulldflash_load+ingest+ 5-layer pass + TFQ3 head + top-16 selection end-to-end.Qwen3.8-Flash-NextTFQ3 shards + 3-bit PLE:layer_00.tffpwtarget MoE &mtp_00.tffpwMTP drafter MoE (512 experts, 3b/4b/5b,act=1, lim=0.0,top_k=10):cos = 0.9999984–0.9999995vsfp64, bit-exactr1 == r16(0/25,600diffs).[2500012, 15]/[2500012, 5]) unpacking.zig fmt --checkclean;tools/zig/check_cuda_sources.py12/12 passed acrosssm_80, sm_86, sm_89, sm_90, sm_120, sm_121.test-cuda-host,test-kernel-symbols-host,test-cuda-release-flags-host, GLM/Qwen3.5/Flash-Next host suites).