Repository navigation
Conversation
GLM's MLA absorb and expand spent prompt chunks shuffling partials through warp trees (the LSU pipe at 83%), so prompt blocks now form the partials main spread over lanes inside one thread, each the same FMA chain, and add them in main's tree shape before main's last shuffles; decode windows keep main's loops, whose weight loads stay 16 bytes wide. Every output keeps its bits; prompt blocks run 1.75x faster and cold prompts take 4 to 6% less time on two GB10.
GLM's tf_glm_absorb_q and tf_glm_expand_v changed without a contract entry, so a rig after the mla image's checks both against float64 at decode and prompt shapes with next-head controls that go red, and both get nvcc 13.0 and 13.3 records for the five served SMs; the rig joins the mla group, as contract_tests.zig is at its line limit.
The kernel change keeps every output's bits, so the receipt shows it three ways on two GB10: the kernels against main's at 78 row counts, four alternated served launches whose replies match and whose cold prompts are 2 to 3% faster, and the exactness suites on both trees; it also keeps the contract run and the tools that made each part.
|
@ashhart Opened at head |
|
Thanks @laudney, the arithmetic is the part we checked first and it holds: each output keeps main's fma chain in the same order, the partials meet in main's tree shape, and your receipt shows the same bytes at 78 row counts and one reply hash a size across every launch. The isolated 1.74x and the 2 to 2.7 percent off cold prompts are worth having. The CI failure is in the registration, not the kernels: the two records point at the
|
CI failed two host checks: glm_glue_latent.cuh is a pinned serving source, and mla_twins compares tf_mla's absorb_q and expand_v with GLM's code token for token. The decode loops (absorb_main, expand_main) are now main's kernel bodies exactly and the twins point at them, the header is re-pinned, and absorb_q's records take the registers sm_80/86/89 now use (111, 113, 113 under nvcc 13.0 and 13.3; sm_120/121 stay 96). Main's and these kernels stay byte-identical at 78 row counts; the GB10 contract run is clean.
|
@ashhart thank you. The CI logs showed two other causes; the
That change moved |
|
Thanks @laudney. You are right about the CI causes: the serving pin and twin check needed updates, rather than a new symbol. The pin now matches and the decode helpers retain main’s arithmetic. We will finish current-head CI, the GB10 checks and the changelog. The other SM register counts are build evidence; their runtime speed remains unchecked.
|
|
Closing: this GLM-5.3-Flash performance work will not continue in TensorFold. |
e86a0bed1dagainst this, alternated base, head, head, baseabsorb_q+expand_vof one 2,048-row prompt block, isolated (ms)ba28cfb7,dae7e2a5,db45a54eon bothEvery head launch beat every base launch in every row of the speed table. Plain decode also measured +2.7% (24.53 against 23.88 tok/s), but decode windows run main's loops on both sides, so that gain is not claimed.
What this changes
GLM's MLA
tf_glm_absorb_q(q · wk into the 512-wide latent) andtf_glm_expand_v(latent · wv into the 256-wide v heads) sum each output as 8-fma chains spread over lanes, then reduce them through shuffle trees. In a prompt chunk that kept the LSU pipe at 83% while the FMA pipe sat at 21% (Nsight Compute, one GB10). For prompt blocks (64 rows a block,cuda_latent.zig'sprompt_rb) one thread now forms the partials main spreads over lanes, each the same fma chain in the same order, adds them in main's tree shape (((0+4)+(2+6))+((1+5)+(3+7)), so every add keeps its pair; IEEE addition is commutative), then takes main's last shuffles; the q and o rows come through shared memory four rows a pass with 16-byte loads. Decode windows (blocks under 64 rows) run main's loops unchanged, as their cold kv_b read wants main's 16-byte weight loads. Nothing else changes: not the launcher, the decode path's arithmetic, or any other kernel.Both kernels had no contract entry; this registers them (
zig/tests/cuda/contract_glm_latent.zig, joined to the mla group becausecontract_tests.zigis at its 600-line limit), with nvcc 13.0 and 13.3 records for the five served SMs.6bc82acac4), four commits:b225c0f108(the kernels),5fdd05f27a(the contract registration and records),f3637a500f(the receipt),9c35ffc2f9(the CI fix: the decode loops are main's kernel bodies token for token, so the MLA twin check holds; the serving pin;absorb_q's sm_80/86/89 registers). Measured ate86a0bed1d; rebased since, and the files this changes did not change on main between.atc overlap --json(ATC 0.9.4):complete: false(pullFilesUnavailableand limits), five overlapping pull requests; qwen35 cuda: fuse the dense MLP's NVFP4 prompt gate and up projections into one launch #2410, idol: Idol's denoiser on CUDA (stacked on #1766) #1767 and CUDA: #1764's BF16 prompt tile for Qwen ModelOpt, Nemotron and Dory, plus two exact Qwen prompt kernels (#1762) #2008 merge cleanly, and ricursive: serve Ripple-65B on two GB10s with up to 1M tokens of context #2522 and ricursive: speed up Ripple-65B on two GB10s #2523 (Ripple-65B) conflict with this head in exactly the files they conflict with onmain(git merge-tree, the full lists compared), so no conflict is new.Checks on this head
9c35ffc2f9.tools/pr_check.py --base upstream/main: 221 on the base and 221 on this head, 0 new. Its advisory warnings: the documentation address192.0.2.1in the receipt'stools/env.sh, and the CHANGELOG line.zig build test-kernel-contractexit 0;git diff --check upstream/mainclean;sha256sum -c SHA256SUMSpasses 73 of 73 on a freshgit archiveof the pushed branch.test-gradient-serving(the header's pin) andtest-mla-twins-host(the twin check); both pass locally now.Receipt
docs/receipts/glm-absorb-lanes-e86a0bed/has every table, the raw results, both ranks' logs, the bit tests and the tools.tools/ab_compare.pyprints the table from the committed results).e86a0bed1d, head that plus the kernel commit; Zig 0.17.0, nvcc 13.5, NCCL 2.30.7, driver 580.178.04; two GB10 (128 GB) at TP=2 over a direct RoCE link;nvidia/GLM-5.3-Flash-FP4-Localat76348ddb2be2e35e39ecfc00e75dc07703f4f3d5.bits/latent_eq.out); one reply sha256 a prompt size across all four speed launches;tools/suite-ex.shon both trees: golden drafted = plain (ba28cfb7,dae7e2a5,db45a54eon both),bench_concurrent.py --levels 1,2,4 --temperatures 0,1 --reps 3 --alone --serial0 unequal, resume four ways equal to cold.openai_aligned.py nodraft("draft": false, 128 tokens, 3 reps): +2.65 / +2.72%, not claimed (main's loops on both sides).bench_cache.py --require-cold --tokens 16, the median of the three cold requests of each launch: −2.65% at 8k, −2.0% at 32k. An earlier pair of runs of the first form of this change measured −3.9% and −5.9%; run-to-run spread on one tree is about 2%.Kernel contract, only when a GPU kernel is new or changed
glm_glue tf_glm_absorb_qandtf_glm_expand_v, changed in place (no new symbol); gates 1 to 4 against float64 at decode and prompt shapes (rows 1, 8, 32, 64, 70, 200; edges 63, 65), depth 13 and 14 (8-fma chains, then the trees).SUMMARYline and exit status: CUDA on GB10 with the runner built by nvcc 13.3:(filtered) SUMMARY 2 kernels: 2 pass gates 1-4, 0 fail, 0 known findings; 2 controls: 2 red as planted, 0 missed; 0 limit problems, exit 0. Records: 2,560 and 4,224 static shared bytes, bound 128;expand_v96 registers on all five SMs,absorb_q111, 113, 113, 96 and 96 on sm_80/86/89/120/121 (nvcc 13.0 and 13.3, measured withcuobjdump --dump-resource-usageafter the CI fix; before it, 96 on all five andkernel-contract-limitsover nvcc 13.0's five-SM fatbins marked both current). Rerun on GB10 after the fix with a 13.3-built runner: the sameSUMMARYline, live limits current.Checklist
The title and description match the head commit, including the receipt and the stack.
New tests fail before the change, pass after it, and skip cleanly without their dependency. (The contract's planted controls go red; the gates pass.)
Comments and docstrings are one line. No measurements or history in the source.
No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
Drafted output equals
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.No precision traded for speed. If the bits change, the description says which sums change and why. (The bits do not change.)
Decode and prompt processing are no slower than main at one stream and the widest admitted; with
--drafter, no slower than without it, greedy and sampled