Repository navigation
Conversation
|
Thanks @Bizuayeu. LAND with routine changelog integration. The stored dtype now selects the existing BF16 branch, and the scratch plan follows the loaded dense layers. The two regressions cover format selection and the wider-dense allocation case. Existing quantized checkpoints retain their path; the BF16 variant is correctly compared against its own replies.
|
Since that verdict The resolution is to keep both lines: I have left the branch at |
|
Thank you @Bizuayeu. The change is ready to land and the earlier LAND verdict stands; nothing is needed from you. The only new item is a docs-only conflict from main's recipe sentence changing from "on main after 1.2.7" to "in 1.2.10". We will resolve that when we land it by keeping main's sentence and your "A ModelOpt checkpoint may also leave the dense MLPs of layers 0 to 2 as bf16" line together. The CHANGELOG entry applies by its context and the three Zig files apply cleanly. Please leave the branch as it is.
|
e5ead44 to
28c8553
Compare
|
Thanks @Bizuayeu. As promised, we rebased this onto current main ourselves, keeping your commits as they were; nothing else changed. It is in the landing queue now, and nothing is needed from you.
|
|
I checked the queued Igor Lessio - AIFLOW LABS |
…not only an EXL3 one The loader picks a dense layer's form from its stored dtype (mlp.held), and the B16 scratch plan counts the dense shapes whenever a dense layer is held bf16.
28c8553 to
45224c2
Compare
|
The queued zig build test-glm-thin-weights-host test-gradient-serving compile-glm-native-open \
-Dcpu=apple_m1 -Doptimize=ReleaseSafe -j2 --summary allFor the two feature-specific fixtures I also registered a scratch target on the existing GLM test root filtered for Igor Lessio - AIFLOW LABS |
GLM-5.3-Flash on CUDA reads a dense MLP (layers 0-2) stored as bf16 in any checkpoint. Today the loader holds those three layers as bf16 only when the checkpoint is EXL3; in a ModelOpt checkpoint it expects NVFP4 or MXFP8 there and refuses bf16 by the module's name. The forward path for a bf16 dense layer already exists (
cuda_mlp.zig's.bf16branch); this picks it from the stored dtype. A checkpoint whose dense layers are NVFP4 or MXFP8 loads as before:main's tokens atmain's speed.On two GB10s at TP=2, one stream:
main, dense MXFP8fibonacci-raw(tok/s)gpu-chat-no-think(tok/s)Every row is from launches at a 40,960-token window, MTP drafts off for decode, every prompt cold: the median of three launches on the MXFP8 checkpoint and the mean of two on the bf16 one. Each launch races GLM's classic and factored expert forms at load and keeps the winner; all eight launches kept classic. The launches ran in turn (
main, branch, branch on bf16, branch,main, branch on bf16,main, branch). Pair by pair on the MXFP8 checkpoint, this branch's decode is 0.01% and 0.05% faster, 0.3% and 0.1% slower, then 0.2% and 0.1% faster, and its prompts 0.03% and 0.1% shorter, 1.9% and 2.4% shorter, then 0.1% shorter and 0.01% longer. The middle pair's 1.9% and 2.4% come from onemainlaunch whose prompts were longer thanmain's other two (6.832 s against 6.748 and 6.756; 26.674 s against 26.242 and 26.191); both GPUs held their clock cap with no cap event during any launch.The first two columns give the same tokens: the three decode-check prompts'
token_sha256, drafted and with"draft": false, on all six launches. The bf16 checkpoint gives its own three hashes, the same on both launches and the same drafted as with"draft": false.mainrefuses that checkpoint at load:model.language_model.layers.0.mlp.gate_proj: declared no recipe (bf16), stored bf16 { 12288, 4096 }; this loader reads it as { .nvfp4 }. Dense bf16 against dense MXFP8 on this branch: 0.20 GiB more model on rank 0, decode 2.3% slower on both prompts, prompts 0.06% and 0.17% longer; not traced.What this changes
main(077998f7d9), two commits:2e86ad0764, the change, ande5ead44be9, which adds the CHANGELOG line and the recipe's sentence and no code.atc overlap --json: on 2026-11-17 at 09:49 UTC, againstmain(6d8716404c), which this merges into without conflicts: no open pull request in the result shares a file with it. The result says it is incomplete (otherPullRequestsLimit,pullFilesUnavailable,pullRequestsLimit,timeLimit,workingTreeUnavailable); beyond it, cuda families: refuse a token id at or past the embedding table before the lookup #3044 (draft) adds two lines tocuda_weights.zig, in another hunk, and the ten open GLM CUDA pull requests looked at by hand (glm cuda: each decode window width keeps its faster expert form #3249, glm cuda: TF_GLM_COPY_SHARE=1 lets shared rounds' copies take the lone ramp, to a stream's share of the rows #3333, glm cuda: the FP8 latent cache's chunk kernels prefetch their codes in 8-byte loads #3454, glm/cuda: key the window-cost cache by TF_GLM_KDA_PAD, TF_ROCE, TF_GLM_PDL and TF_GLM_DSEL #3495, families: Nemotron, GLM, Qwen 27B, MiniMax and Dory settings through environment.zig #3558, glm cuda: prompt rows' MLA absorb and expand sum without lane trees, same bits #3579, glm/cuda: TF_GLM_DRAFT_SPLIT=1 splits the DFlash2 drafter's MLP at three ranks or more (for #3581) #3616, glm/cuda: TF_GLM_MOE_DIRECT=1 runs a decode window's EXL3 MoE without its row copies and put_slot (for #3570) #3659, glm cuda: decode kernels as dependent launches, +6.8% decode at TP=2, same tokens #3673, glm/cuda: the other ranks sleep on their lines while rank 0's vision tower runs (for #3614) #3675) change none of the three files. None of the three files changed onmainsince the base.The loader.
cuda_mlp.ziggainsheld(exl3, stored): a dense layer is held bf16 when the checkpoint is EXL3 or the layer'sgate_projis stored bf16, MXFP8 when it is stored e4m3, else NVFP4.cuda_weights.zig'sdenseasks it instead ofc.exl3, so the three projections are checked against one form as before (L.format), and a layer whosegate_projis bf16 whileup_projordown_projis not is still refused by name.The scratch plan.
cuda_state.zig'sb16Shapesplans the split-K partials of the bf16 matmuls. It counted the dense shapes only for EXL3; it now counts them whenever a dense layer is held bf16. At GLM-5.3-Flash's sizes the other shapes already cover the dense ones, so nothing was short there; a model with a wider dense layer would have been. The new test uses such a config and fails on the old table.What stays. No kernel source changes: the diff is three Zig files under
zig/src/families/glm. No new option: the checkpoint's stored dtype chooses. EXL3 checkpoints take the same branch as before.Checks on this head
e5ead44be9. Every check and receipt below is from2e86ad0764, the commit before it;e5ead44be9changesCHANGELOG.mdanddocs/recipes/glm-5.3-flash-cuda.mdalone, so they were not taken again.python3 tools/zig/lean_check.py, on the base and on this head: 221 problems on both, 0 new.python3 tools/pr_check.py --base 077998f7d9: 3 changed files, lean 221 against 221 with 0 new, 0 errors; its one advisory asked for the CHANGELOG line. One5ead44be9,python3 tools/pr_check.py --base 077998f7d9 --pr 3680: 5 changed files, lean 221 against 221 with 0 new, 0 errors and 0 warnings.zig build test3,233 of 3,278 with 45 skipped (718 of 718 steps),test-golden(5 of 5 steps),test-cuda-host,compile-cuda-tests10 of 10,compile-config-server7 of 7,tools/zig/cuda_common_check.pyandzig fmt --check. The two new tests run in the GLM CUDA host test binary (245 tests, all pass). Each fails on its own mutant and nothing else does:heldput back to "bf16 only for EXL3" fails the first (expected .bf16, found .nvfp4), and ab16Shapesthat leaves a bf16 dense layer out fails the second. The pytest suite CI runs, from the root with aclang++stand-in and Zig on PATH: 520 passed and 86 skipped with 616 subtests;main's CI on the same base reads 522 passed and 84 skipped; two of the skips here give this interpreter's older Unicode table as their reason, which matches the difference in count (CI's log does not print skip reasons). On GB10 at TP=2, on the bf16 checkpoint with this head'stf-cuda-test:glm-lanes-cover46,glm-lanes-concurrent38 andglm-shared-check1 pass on rank 0, with no failures on either rank.2e86ad0764: every job that ran passed (fmt,zig,zig-b,zig-windows,zig-macos-dev-tools,pytest,release-pathsand bothbenchmark-clients);host-nightly-linuxandhost-nightly-macoswere skipped. Itspytestjob reads 522 passed and 84 skipped with 616 subtests,main's numbers. One5ead44be9the same jobs passed again, with the same two skipped and the samepytestcounts.Receipt
main077998f7d9and this branch's2e86ad0764on it, each built from an empty Zig global cache. Zig 0.17.0, nvcc 13.3 for sm_121. Driver 580.178.04. Two GB10s at TP=2 over a direct link. The MXFP8 checkpoint isBizuayeu/GLM-5.3-Flash-Jammed-XSFP4-NZ5@451ca955, whose dense MLPs are MXFP8, read from a local copy: its 132.safetensorsfiles, tokenizer and config files have that revision's hashes. The bf16 checkpoint is the same files with the nine dense matrices of layers 0 to 2 replaced byzai-org/GLM-5.3-Flash-BF16@a5b45eb4's bf16 tensors and theirquantized_layersentries removed (18 tensors dropped, 9 added, 2 shards rewritten); it is a receipt's checkpoint and is not published.Loader.dense,b16Shapes) and, for a bf16 dense layer,cuda_mlp.zig's bf16 branch. Ran on GB10 (sm_121). Could not run any other CUDA chip.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: on each checkpoint, the three decode-check prompts, 512 tokens each and greedy, give the sametoken_sha256drafted and with"draft": false; on the MXFP8 checkpoint this branch givesmain's on all three launches. The bf16 checkpoint's three hashes differ from the MXFP8 checkpoint's, as its dense weights do.glm-lanes-cover46,glm-lanes-concurrent38 andglm-shared-check1 pass on rank 0 on the bf16 checkpoint at TP=2, with no failures on either rank.tools/bench_openai.py: its two prompts with"draft": falsein each request, 256 tokens five times each, one stream at a 40,960-token window, the median of three launches: the table. On the MXFP8 checkpoint this branch is within 0.04% ofmain.ttft_sfromtools/bench_cache.py --require-cold, on the decode-check prompts' tokens repeated to 9,600 and 38,400, the median of three launches: the table. On the MXFP8 checkpoint this branch takes 0.15% and 0.19% less thanmain, from pairs that put it 0.03% and 0.1% shorter, 1.9% and 2.4% shorter, and 0.1% shorter and 0.01% longer.Checklist
e5ead44be9, two commits onmainat077998f7d9; every receipt is from2e86ad0764's binary, and the commit after it changes the CHANGELOG and the recipe alone.)mainrefuses a bf16 dense layer by name, as the receipt's launch shows. The tests need onlystd.)glm-lanes-cover,concurrentandsharedpass on the bf16 checkpoint at TP=2.)"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Drafted equals plain on both checkpoints; resumed and concurrent by the lanes tests on the bf16 checkpoint.)main's tokens. A bf16 dense layer runs the branch EXL3 checkpoints already run, on the stored bf16 values.)--drafter, no slower than without it, greedy and sampled. (One stream, greedy, MTP drafts off, on the MXFP8 checkpoint: decode within 0.04% and prompts 0.15% and 0.19% shorter thanmain, medians of three launches run in turn withmain's, under Receipt. The widest admitted, sampled and--drafterwere not measured: for a checkpoint that loads today this changes no lane, launch or kernel.)