Repository navigation
Conversation
|
Hi @Bizuayeu, a status update on #1580. We read your three commits and the two kernels. They only prefetch into L2 and write nothing, so we found nothing |
GLM-5.3-Flash doesn't fit on one GB10: the XSFP4 checkpoint is 166 GB, and a GB10 has 128 GB shared between the host and the GPU, so it can't be served at TP=1 here. TP=2 and TP=3 are the GB10 setups that run it, and both are in the receipt. I'll rebase once #1524 lands. |
Rebased onto main |
|
|
… a side stream while gathers and chains run Opt-in, off by default, with every rank agreeing on it and its knobs. A layer has three sites, on decode windows of a rank alone: n before gather_b reads the next layer's mixer input (KDA's qkv scales, codes and bf16 rest, or DSA's proj and q_b), f before gather_a reads this layer's ffn head (the router, or a dense layer's gate and up), and o between KDA's projections and its chain reads its o. A site's rows are the weights' own allocations after they tile, taken in order within TF_GLM_L2PF_MB (12) as DeepSeek V4.1's take does, so no row reads past an allocation, and a source that starts none turns the prefetch off. The kernels are DeepSeek V4.1's: l2pf's segments on TF_GLM_L2PF_CTAS (2), and l2pace for the n and f sites at TF_GLM_L2PF_PACE_GBPS (150; 0 for segments there too). The side stream joins the main stream once at the window's end; it writes nothing.
GLM launches l2pf's bulk segments_kernel on 128 threads and l2pace's paced_kernel on 32, from its own images of DeepSeek V4.1's sources, so they need records of their own: glm_l2pf_pending.zig, from kernel-contract-limits on nvcc 13.0.88's fatbins for sm_80, 86, 89, 120 and 121 (sm_121's match DeepSeek's records of the same kernels). The contract runner learns the two image names, as it knows the other shared images.
…were taken Unset, the prefetch runs on sm_121 alone; TF_GLM_L2PF=1 turns it on on any GPU and 0 off. The knobs are read unless it is 0, so every rank agrees on them whenever it can run. The engine asks the context's capability before it builds the table.
|
Rebased onto main |
On GB10 (GLM-5.3-Flash XSFP4, one binary served with
TF_GLM_L2PF=0and with=1at the default knobs, which aGB10 now runs unset, two launches each, the same tokens in every launch):
=0, as main)=1)--no-drafts(tok/s)--no-drafts(tok/s)--no-drafts(tok/s)What this changes
GLM's decode streams each layer's weights from memory while its gathers and the KDA chain run. With
TF_GLM_L2PF, aside stream reads the next weights into L2 in those gaps, at three sites a layer on a decode window: before
gather_bthe next layer's mixer input (KDA's q, k and v scales, codes and bf16 rest, or DSA's proj and q_b), before
gather_athis layer's ffn head (the router, or a dense layer's gate and up), and between KDA's projections and its chain its o.
A site's rows are the weights' own allocations after they tile, taken in order within
TF_GLM_L2PF_MB(12 MiB) asDeepSeek V4.1's take does, so no row reads past an allocation; a source that starts no allocation turns the prefetch
off. The side stream writes nothing, joins the main stream once a window, and never runs in a prompt pass.
The kernels are DeepSeek V4.1's: l2pf's segments on
TF_GLM_L2PF_CTAS(2), and l2pace for the two sites beside agather at
TF_GLM_L2PF_PACE_GBPS(150; 0 runs segments there too), built into GLM's own images from DeepSeek'ssources. Their two launches get nvcc 13.0 records (
glm_l2pf_pending.zig), and the contract runner learns the twoimage names. Every rank agrees on the setting and its knobs (the ranks' fingerprint).
It is on by default on a GB10 (sm_121), where the receipts were taken, and off elsewhere until someone measures it:
TF_GLM_L2PF=1turns it on on any GPU and0off. DeepSeek V4.1's prefetch stays opt-in on main. Here every TP=3 rowgains 3 to 4%; at TP=2 decode gains 1.85% without the drafts and 0.76% with them, under a 1% bar for that row, though
no launch was slower. Unpaced (
TF_GLM_L2PF_PACE_GBPS=0) gives +1.08% and +1.20% at TP=2 and +2.07% and +1.44% onthe wire at TP=3, so the paced default is the better one at three ranks and close at two.
Three commits: the prefetch (opt-in), its contract records, and the GB10 default.
Receipt
6d612760c(glm cuda: at three ranks or more, TF_GLM_ROCE_MULTI=1 sends the small all-gathers over fabric/tp's multirank RoCE #1524'scec391febon maine4cc630f5, then the three here). The launches ran6af36809e, the first of the three, withTF_GLM_L2PF=1, which is what the GB10 default runs; the next two addthe records and the default.
2ff12c521is the same three on mainab4b5d8e6, where glm cuda: at three ranks or more, TF_GLM_ROCE_MULTI=1 sends the small all-gathers over fabric/tp's multirank RoCE #1524 and glm cuda: TF_GLM_KV_SHARE keeps prompts as the pool's pages in prompt_radix's store #1732 have landed, but forlines of context in
contract_limits.zig,cuda.zig,cuda_engine.zigandregistry.zigand thelanded_cudaline, which takesmain's
exl3_grouped_recordsterm, so the GPU receipts were not taken again. GLM-5.3-Flash XSFP4, PARALLEL=4,--prompt-cache-gib 0,zig build nativefor sm_121.TP=3 on three GB10 cabled in a ring of three QSFP cables with no switch, on NCCL (
TF_GLM_ROCE_MULTIunset) and onglm cuda: at three ranks or more, TF_GLM_ROCE_MULTI=1 sends the small all-gathers over fabric/tp's multirank RoCE #1524's wire (
=1); TP=2 on two GB10 joined by one QSFP cable. Launches alternate: at TP=3 on NCCL off, on, on, offwith the drafts and again with
--no-drafts; on the wire and at TP=2, four arms (off, segments on 2 and on 4 CTAs,the default) as 0 1 2 3 3 2 1 0, with the drafts and again without. Each rank logs
TF_GLM_L2PF: 226 rows, 1026 MiB a decode window(1,026 to 1,066 MiB by rank and TP).the bench's token hashes agree across all launches of each set (8 at TP=3 on NCCL, 16 on the wire, 16 at TP=2).
bench_openai's medians over its two prompts(256 tokens, 3 repeats, temperature 0). One and four streams (
bench_concurrent): +1.7 to 4.7% at TP=3 on NCCL,+2.6 to 4.6% on the wire, +0.4 to 2.1% at TP=2. At TP=3 every on launch beat every off launch in decode; at TP=2 one
launch with the drafts tied (40.39 against 40.38 and 40.39).
Forward.prefetchis null in a promptpass), so a prompt runs main's path. No launch waited on the engine's heat guard (no
heat_wait_son any rank).kernel-contract-limitson nvcc 13.0.88's fatbins for sm_80, 86, 89, 120 and 121: bothlaunches PASS on every SM with their records current (l2pf's
segments_kernel<true>30, 28, 28, 28 and 28registers, bound 256; l2pace's
paced_kernel24, 23, 23, 20 and 20, bound 32; sm_121's match DeepSeek's records ofthe same kernels). On the GB10,
zig build kernel-contract(with kernel contract: the CUDA runner maps fp8_experts' image, so a run reaches its summary #1579's mapping, without which the run stops atfp8_experts) passes both live: l2pf 128 threads of the 256 the driver allows, 28 registers, and l2pace 32 of 32, 20
registers, as recorded. Its summary:
SUMMARY 433 kernels: 433 pass gates 1-4, 0 fail, 6 known findings; 316 controls: 316 red as planted, 0 missed; 183 limit problems. None of the 183 is GLM's: a run of main7c0688951with kernel contract: the CUDA runner maps fp8_experts' image, so a run reaches its summary #1579 on another GB10 prints the same 183 lines over 1,327 launches (1,329 here), records of Qwen4's, Qwen3.5's
and nvfp4_experts_tile's kernels with no 13.0 usage or another one.
2ff12c521):test-cuda-host274/274 steps (4,103 of 4,112 tests, 9 skipped);zig build test449/449 steps (1,872 of 1,890 tests, 18 skipped);test-kv-pool30/30 tests,compile-cuda-tests10/10 steps (the CUDA runner, which CI does not build),compile-config-server7/7,test-roce-multi-host40/40 tests,test-tp33/33 steps,zig fmt --check, andtools/zig/lean_check.pywith nothing new (424 against main's 424).(a fourth node arrives in early November).
Checklist
stream only reads weights into L2; drafts on and off are both in the receipt.)
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Thetoken hashes agree across drafted and plain launches, on and off. The prompt cache was off and the four-stream runs
were not hashed; the prefetch writes nothing, so every sum is main's.)
change: the side stream writes nothing, and every launch's tokens match.)
SUMMARYline is in the receipt. (GLM's l2pf and l2pace launches have nvcc 13.0 records; the CUDA lines are in thereceipt.)
TP=3 and TP=2, the host tests on Linux; the rest not run, as above.)
its property taken out: take's budget, the table's lane order and its unknown buffer, the knobs' bounds, the
fingerprint's l2pf, the records' measured usage and the GB10 default; they need no device.)