Repository navigation
Conversation
Decode windows reach 32 rows and MTP chains 15 drafts. At load, rank 0 runs real rounds on every rank over a fixed text, keeps the times per build, GPU, checkpoint and settings, and prices lone windows, drafts and DFlash2's shared rows by them. It also races the classic NVFP4 expert kernel against the factored one and keeps the faster; both give the same bits. An MTP chain's steps run stream by stream, so shared MTP rounds keep the depth rule they had. A window's greedy picks take one gather and one read, and a step's short ids travel in its first broadcast. Fixes two faults that wider windows would expose. A shared window's KDA projection buffer was sized only when a stream's most rows were under the shared rows, so at 32 rows it shrank to 4 bytes and overwrote its neighbours; a host test fails on the old condition. TF_GLM_KV_HOST's row cache now forgets its list after a call past 16 rows, which keeps no list of its own but rewrites rows the list may name. No GPU kernel changes.
9 tasks done
This was referenced Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft: not ready to merge. See "Before this merges" below.
What this changes
GLM-5.3-Flash on CUDA verifies windows of up to 32 rows (was 8) and chains up to 15 MTP drafts (was 3), priced by rounds timed on the machine at load rather than by a fixed table or no table. Load timing also races the classic NVFP4 expert kernel against the existing factored one and keeps the faster, which gives the same bits. A window's greedy picks take one gather and one read, and a step's short ids travel in its first broadcast.
It also fixes two faults that wider windows expose:
Buffers.makesized a shared window's KDA projection buffer only whenseg < rows. At 32-row windowsseg == rows, so the buffer shrank to 4 bytes and overwrote its neighbours, and replies at two or more streams went wrong. A new host test fails on the old condition.TF_GLM_KV_HOST's row cache kept its list across a call past 16 rows, which rewrites rows the list may name. It now forgets the list. Found by reading the kernels: I have not seen this one fail (see below).No GPU kernel changes. This could split into the pick and step batching, then the windows and prices, if that reviews better.
atc overlap --json(2026-11-05 13:53 UTC, basecde4fe7d99): no conflicts among those it could test (10 clean), but 450 unknown, because the board reportsinvalidPullsand hit its pull request and time limits. So I also rangit merge-treeagainst 14 open GLM pull requests on an earlier amend of this head (same base): glm cuda: TF_KV_SHARE keeps GLM's prompts in the shared prompt store, and GLM's own store goes #2211 (cuda_native.zig), GLM-5.3-Flash on CUDA keeps conversation states on disk, every rank's part (--learn-conversations) #1411 (cuda_follow.zig), glm:TF_GLM_KV_LIVE_HALF=1keeps the live half of the KDA state alone in a kept prompt state #2181 (the recipe) and glm cuda: a prompt step takes two chunks while no other stream decodes, each one's exchanges under the other's sites #1423 (the recipe,cuda_engine.zig,cuda_state.zig) conflict in files this changes; glm cuda: TF_GLM_L2PF reads a decode window's next weights into L2 on a side stream, on by default on a GB10 #2162 and CUDA: GLM's KDA chain and saved-row replay become a shared module #2142 conflict only in files it does not touch; the rest are clean. These resolve by landing order.Before this merges
window_costs_lonekeeps shared MTP rounds on main's depth rule to remove them. Not yet rechecked on the cards.TF_GLM_KV_HOSTfault failing, or say plainly that it rests on reading the kernels. The control without the fix passed on 5K to 7K token prompts.Checks on this head
7f20e7bef6fbb0c08d2a220bb0f17bb6704ee92d, on maincde4fe7d99zig fmt --checkandgit diff --checkpass.gate.py(secrets, private data) passes.zig build test test-golden test-cuda-host test-glm-copies-host test-family-copies-host test-cuda-startup-costs-hoston x86_64 Linux: 552 of 555 steps, one failing test (listener: accepted IPv4 and IPv6 TCP streams disable Nagle), which fails the same way on main on this host, where IPv6 loopback is blocked. Full counts on main at9200a3064: 7052 of 7112 passed, 59 skipped, 1 failed. The local landing gate (skill scan, gitleaks, whitespace, fmt, contract-host, HIP, dev tools, Linux CUDA cross-compile, release paths) passed every step but lean on the amend before this one; lean is fixed here and the gate was not rerun.zig build testare left to CI, because on macOS it runs Metal device checks that must not share a GPU with other runs here.Receipt
Measured on base
9200a3064(rebased since), comparing that main against this change.nvidia/GLM-5.3-Flash-NVFP4at09b04e5e; drafterincoai/GLM-5.3-Flash-DFlash2atbf582e4e.--context 245760,NCCL_P2P_LEVEL=SYS NCCL_MIN_NCHANNELS=4 NCCL_MAX_NCHANNELS=4 TF_GLM_PREFILL_REDUCE=gatheron both sides.Configfield and a moved constant.TF_GLM_COPIES=1andTF_GLM_KV_HOST=1were run on the DFlash2 path only.tools/bench_concurrent.py --alone --serialat temperatures 0 and 1, levels 1, 4, 8 and 16: 0 unequal and 0 failed in every cell, both drafters. Separately, drafted against"draft": falseon repeating text, code, counting, an edit, prose, JSON schema output and tool calls, windows to about 31 rows: all equal at temperatures 0 and 1, withTF_GLM_COPIESoff and on.tools/bench_openai.py(512 tokens) andtools/bench_concurrent.py(256 tokens), tok/s. DFlash2's after column usesTF_GLM_DRAFT_CONFIDENCE=0.4, and before keeps the default 0.7; after at 0.7 was 298.7 code, 190.5 chat.MTP at several streams, before
window_costs_lone(to recheck). The dips are in bold, with tight repeats, so they look real:tools/bench_cache.py --require-cold, tok/s at 8K, 32K and 131K: DFlash2 4388, 4457, 4434 against 4383, 4454, 4432; MTP 4431, 4476, 4446 against 4414, 4463, 4433, and 4374, 4419, 4392 in a later run on warmer cards.cuda_kv8_test), about 300 MiB less room overall at--context 245760.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Drafted and concurrent yes, before the rebase. Resumed against fresh not checked separately.)--drafter, no slower than without it, greedy and sampled. (Open: the MTP recheck, and sampled code with DFlash2 is slower than MTP at one stream, 215.2 against 219.0.)