Repository navigation
glm cuda: csf0_v1 checkpoints, routed experts at block 32 with each row's scales as a base and 4-bit offsets - #2041
Conversation
…l-argument gate, its scores and its known behaviours Through 1fca0ca's gate, which asks the engine for one tool call a turn and says so in the system message, tool-eval-bench 2.8.0's Safety Gate passed on both checkpoints at both TP sizes, one launch each on 3.10.0's image: XSFP4 93 and 93, Jammed XSFP4 93 and 92, Jammed XSFP4's TC-51 at TP=3 among them. In all four, TC-67 and TC-69, which ask for two lookups, were answered after the first one's result without the second (TC-69 failed, TC-67 was partial), and at TP=2 Jammed XSFP4 left TC-49 partial; the documents set these down as known behaviours. The measured table's sentence on where its columns come from names the new row as its one exception, and Next Action names ashhart/TensorFold#2041 for the csf0_v1 commits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thank you @Bizuayeu, this is a careful change. 13.2 GiB back across a TP=2 pair, with the same tokens, is a real gain I read the six commits on current main. A block-16 checkpoint keeps main's path. csf0_v1 is admitted only as NVFP4 at We will run it on our GB10 pair against main on a block-16 checkpoint.
|
|
Thanks @Bizuayeu, our GB10 pair run is in: GLM-5.3-Flash NVFP4 (block-16, the layout main already serves) at TP=2 over two GB10s, main against this head, warm then base-new-new-base, with the 64K context.
So a block-16 checkpoint runs main's path, as the review read. We don't have a csf0_v1 checkpoint on our boxes, so your receipts stand for the block-32 path. This goes into our landing queue now, with a changelog line crediting you. |
(comment) Thank you for running it on your pair, and for the changelog line. Points 1 to 4 of the review are done: block 32's image loads only for a checkpoint that declares |
…a 4-bit offset 14.2 GB off the routed experts' VRAM on GB10 at the same bit-exact sums: the scales leave [n, k/16] for a base a row and an offset every 32 inputs, in the checkpoint as on the device. The kernels are a new image of GLM's five, so Flash Next's and Nemotron's contracts stay; their contract records follow in this branch.
…pert, in a file of their own
…3 does differently
Each replaces block 16's kernel on scales written two by two: gate-up and both downs of the decode form, gate-up and down of the prompt tile. Scales come from any fill through each row's 16-step window, so NaN, infinities and the stress fill reach them as a checkpoint could hold them.
569faf6 to
3a62aeb
Compare
|
Thank you @Bizuayeu. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
ashhart#2041 reads csf0_v1 checkpoints on main. The row lists the one that uses it, with its loads on main at TP=2 and TP=3 and its card's numbers, and the GLM recipe's opening names it beside XSFP4.
ashhart#2041 reads csf0_v1 checkpoints on main. The row lists the one that uses it, with its loads on main at TP=2 and TP=3 and its card's numbers, and the GLM recipe's opening names it beside XSFP4.
#2041 reads csf0_v1 checkpoints on main. The row lists the one that uses it, with its loads on main at TP=2 and TP=3 and its card's numbers, and the GLM recipe's opening names it beside XSFP4.
|
Thanks @Bizuayeu! This is in TensorFold 1.2.3, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.3 |
The Pick a model row and the GLM CUDA recipe said "on main after 1.2.2" for ashhart#2041, as ashhart#2114 wrote they would until a release carried it. 1.2.3 does, so both name it.
GLM-5.3-Flash's routed experts take 13.2 GiB less memory across TP=2's two ranks when the checkpoint holds them at block 32 instead of 16 and writes each row's scales as one base and 4-bit offsets. Prompts take 0.5 to 0.8% less time and decode moves by −0.9 to +0.1%. Bizuayeu/GLM-5.3-Flash-Jammed-XSFP4 is such a checkpoint. A block 16 checkpoint loads and runs as it does on main.
On GB10 (MSI EdgeXpert), one stream:
csf0_v1csf0_v1fibonacci-raw(tok/s)gpu-chat-no-think(tok/s)The block 16 columns are
mainon the checkpoint's values written in the block 16 layout, and thecsf0_v1columns this branch on the checkpoint itself, so every column of a TP size returns the same tokens. The memory rows are from launches at a 524,288-token window at TP=2 and 1,048,576 at TP=3; the speed rows from launches at 40,960, MTP drafts off for decode, medians of two rounds. At TP=3 the prompt cache stops at its 16.0 GiB ceiling in both, and the saving stays free: rank 0 had 27 GiB available after load against 23.What this changes
quantized_layersentry of{"quant_algo": "NVFP4", "group_size": 32, "weight_scale_encoding": "csf0_v1"}holds, in place ofweight_scale,weight_scale.csf0_bases([rows], u8) andweight_scale.csf0_codes([rows, columns / 64], u8, two offsets a byte). A group's scale ise4m3(base + offset).admitRecipestakes that pairing alone: NVFP4 at group 32 without the encoding, and the encoding at any other group or algorithm, are refused by module as before.cuda_formats.csf0Linearreads the parts andcuda_load_packpacks them as stored, by any number of packers. A layer that mixes forms, or whose shapes do not divide by 64, is refused by name.nvfp4_experts32.cuholds GLM's five launches at block 32:tf_nvfp4_decode32_swiglu,_down_f32and_down_bf16, andtf_nvfp4_prompt32_swigluand_down. They arenvfp4_experts.cu's two forms with the same sums in the same order, and each group's scale read from the row's base and offset. Their image loads only with GLM's, so Flash Next's and Nemotron's contracts stay as they are.ld_nc,ld_nc2,e4m3x2andmul2are the same text asnvfp4_experts.cu's, andfp4paircomes fromcommon/fp_pairs.cuh. Moving the four intocommon/is a SASS-identical move for RFC: shared CUDA device primitives (one header set for fragments, FP4 decode, copies and reductions) #1409 and is left out of this change.Receipt
mainat933b969faand this branch on it atc1b186aba. The branch is now onad98b602c; the rebase's one conflict was a neighbouring line ofregistry.zig(main's new register counts forfn_qsa_selectbeside this branch's 13.3 records), and the host tests and the kernel contract below ran on the rebased head569faf612. Zig 0.17.0, nvcc 13.0, driver 580.178.04, two GB10s at TP=2 and three at TP=3 over a ring of direct links. CheckpointBizuayeu/GLM-5.3-Flash-Jammed-XSFP4@0a22bb46, read from a local copy of the same bytes.token_sha256frommainon the block 16 layout, this branch on the block 16 layout and this branch oncsf0_v1, drafted and with"draft": false. On upstream 1.2.1 with these six commits (the GLM-5.3-Flash BIZ 3.10.0 release), a prompt resumed from the prompt cache gave a fresh one's tokens, andtools/bench_concurrent.py --alone --serialequalled the same request alone in 20 replies at TP=2 and 52 at TP=3.main(ad98b602c):SUMMARY 553 kernels: 553 pass gates 1-4, 0 fail, 6 known findings; 359 controls: 359 red as planted, 0 missed; 190 limit problems; …569faf612):SUMMARY 558 kernels: 558 pass gates 1-4, 0 fail, 6 known findings; 359 controls: 359 red as planted, 0 missed; 190 limit problems; …repeat,shapesbit-equal to the kernel it replaces,nonfinite,sums). Theirlimits livelines pass as recorded under nvcc 13.0, andRECORDunder 13.3 is innvfp4_experts32_records.zig. The limit problems and the known findings are the same lines on both runs, none of them on the five new launches. Both runs end inFAIL kernel-contract: 0 gate failures, 0 controls missed, 190 limit problems: 168 fromFAIL limits(1,481 registered launches onmain, 1,486 here) and 22limits livelines.test-cuda-host4,494 of 4,511 with 16 skipped,compile-cuda-testsandcompile-config-server. The one failure was the timing testcortheon fuzz: every reader takes linear time on long inputs(zig/src/server/cortheon/fuzz.zig, outside this diff), which passed when the step ran again;maingives 4,489 of 4,505 with 16 skipped. On GB10,nvfp4-b32(each kernel's bytes against block 16's on every form at widths 1,024, 704 and 640, each control red) and the loader gate over every layer of the checkpoint on TP=2's two ranks and TP=3's rank 2 (every upload equal to the bytes cut from the checkpoint).zig fmt --checkclean.tools/zig/lean_check.py: 424 problems onmainand on this branch, zero new. Merged intomainatcfcbecb0bwithout conflicts, the branch passestest-cuda-host(4,556 of 4,572, 16 skipped), both compiles, fmt and lean with no new problem.Checklist
glm-lanes-cover46,concurrent38 andshared1 pass on rank 0 at TP=2 and at TP=3, with no failures on any rank.)"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Drafted equals plain in every run of the table; resumed and concurrent on 1.2.1 with these commits, under Receipt.)SUMMARYline is in the receipt. (CUDA, above.)csf0_v1taken at any group, a column block's offsets counted every 32 inputs, andcsf0Lineartaking any offsets shape (test-cuda-host4,489 of 4,511 with 16 skipped). Before this branch,admitRecipesrefuses NVFP4 at group 32 by module and nothing readscsf0_v1's parts, so the loader gate cannot load the checkpoint;nvfp4-b32's controls go red in every form. The host tests need onlystd, the repo's fixtures and checkpoints they write to a temporary directory, and the GPU checks aretf-cuda-testsubcommands.)