Skip to content

qmmf: opt-in half-column tiles on many-SM GPUs - #4533

Merged
ashhart merged 4 commits into
mainfrom
lead/qmmf-half-bn
Nov 24, 2026
Merged

ashhart merged 4 commits into
mainfrom
lead/qmmf-half-bn

Conversation

@ashhart

@ashhart ashhart commented Nov 22, 2026

Copy link
Copy Markdown
Owner

What this changes

Small decode GEMVs underfill GPUs with many SMs (170 on sm_120). With TF_QMMF_HALF_BN=1, the FP4, FP8 and FP8-group qmmf paths use 32-column tiles (and a higher half-tile threshold, chosen by SM count), splitting only along the output columns, never K, so every output's accumulation is unchanged. Default off.

Checks

  • Host build; the device check compares BN=32 and BN=64 outputs byte for byte for every format and served shape at rows 1 to 16. fmt, ast-check, lean, 600-line cap.

Still to run

An sm_120 GPU and a GB10: the byte check, then Qwen3.8-27B one-stream served A-B-B-A with tokens compared.

@joshuaswarren

Copy link
Copy Markdown
Contributor

sm_120 lane-half-n check (RTX 5060 Ti eGPU, aarch64 Linux, driver 615.78.08, kernel 7.1.12-2 lab build, -Dsm=120), branch ashhart/lead/qmmf-half-bn @ e4f9cb9:

./zig-out/bin/tf-cuda-test lane-half-n exited 0 in the queued run (zig build + contract). The guard receipt does not carry payload stdout, so I reran the same binary to capture the output: every cell that printed shows the expected 64-col vs half-tile timing pair — e.g. fp4 rows 1/16 n=17408 k=5120 (sk 1): 127.3–128.9 us vs 129.5–131.9 us; fp8 same shapes: 210.8–213.9 vs 218.4–220.2 us. fp4 completed all 20 cells; fp8 got through ~12 before the run was cut short.

Disclosure: that rerun died mid-fp8 with CUDA_ERROR_LAUNCH_FAILED (CudaContextLost) at 12:42:58 local, coincident with a driver-level GPU hang (NVRM GSP rpcSendMessage 0xf, FULLCHIP_RESET asserts; device dropped from nvidia-smi, driver now cannot unload). A second contract job was launching on the same GPU in that window, so whether my rerun, the concurrent job, or prior GPU state triggered the hang is unresolved — flagging it here rather than hiding it. The queued rc=0 run is consistent with a full pass; I will rerun the byte check once the GPU recovers and update this thread.

@joshuaswarren

Copy link
Copy Markdown
Contributor

Follow-up after the host recovered (fresh boot, same driver 615.78.08 / kernel 7.1.12-2 lab / -Dsm=120 build): reran the same binary end to end.

PASS lane-half-n: 4800 FP4, FP8 and FP8G calls at rows 1-16, both outputs, adversarial values: bytes equal

All fp4, fp8 and fp8g cells completed this time, including the fp8 region where the earlier run was cut short — so that crash was the already-failing GPU, not this kernel. Representative timing (64-col vs half-tile): fp8 17408x5120 sk1: 210.8-213.9 us vs 218.3-220.2 us; fp8g 17408x5120 sk1: 225.0-226.8 vs 231.6-233.8 us; small shapes mostly equal (6.9 vs 6.9 us), a few half-tile wins (fp8 5120x6144 rows 1: 56.0 vs 55.4 us).

@ashhart
ashhart force-pushed the lead/qmmf-half-bn branch 2 times, most recently from 80794fd to 4e4437f Compare November 24, 2026 07:43
TF_QMMF_HALF_BN=1 (default off) loads the 32-column half tile for FP4, FP8
and FP8G, as MXFP8 and BF16 already have it, and sets the half-tile threshold
to two blocks an SM unless TF_QMMF_HALF_BELOW is set (340 on 170 SMs, 96 on
GB10's 48). Columns split, never K: each output keeps its slices, mma chain,
scale order and cluster sum. Off, no instance loads and nothing changes.
…column tile

Bytes at rows 1-16 for Qwen3.8-27B's decode shapes and column edges, bf16 and
fp32 out, adversarial weights, scales, inputs and tensor scales; warm times.
@ashhart
ashhart merged commit 834237b into main Nov 24, 2026
1 check failed
@ashhart
ashhart deleted the lead/qmmf-half-bn branch November 24, 2026 09:52
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.

2 participants