Repository navigation
Conversation
…e ramp, to a stream's share of the rows In a shared round every copy window was first_copy wide (three tokens for GLM): the lone ramp (2w+1 after a copy kept whole, back to first_copy after a miss) ran for a stream alone only. With TF_GLM_COPIES=1, a quote or an edit at two or four streams drafted no more a round than one stream's first copy. Model.shared_copy_ramp lets a family's shared rounds take the ramp too, each copy capped at its stream's share of batch_rows less its pending row (32 rows: 15 tokens at two streams, 7 at four, first_copy from seven on), so a copy cannot take the rows the other streams' windows need. The cap keeps rows open; whether the allocator fills them is the prices' (TF_GLM_COPIES=1 prices every shared row). It needs shared rounds: with TF_GLM_SHARED=0 each stream's copy keeps first_copy, and Recall keeps its width. GLM sets the fact only with TF_GLM_COPIES=1 and TF_GLM_COPY_SHARE=1, so the defaults and TF_GLM_COPIES=1 alone keep their facts; TF_GLM_COPY_SHARE=1 without TF_GLM_COPIES=1 is refused at the open, not read as off.
Owner
|
DEVICE @Bizuayeu, no must-fix found. The option stays off by default, requires copies to be enabled, and keeps the existing target verification and row allocator. The new tests cover the shared ramp, miss reset and plain-token equality for both drafter modes. Host checks and Linux cross-compiles pass: 6,985 tests passed, 43 skipped, with formatting clean and zero new lean findings. We will run the device check on our side at TP=2: copies off and on, greedy and seeded, one through eight streams, MTP and DFlash2, including rejected copies and resumed turns. Tokens must match plain decoding before we compare complete round costs and served speed.
|
This branch has not been deployed
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.
What this changes
With
TF_GLM_COPIES=1, a copy in a shared round is always the first copy's three tokens wide; only a stream alone grows its copies on the lone ramp (2w+1after a copy kept whole, back to three after a miss). So a quote or an edit at two or four streams drafts no more a round than one stream's first copy: 3.9 tokens a chunk on the bench below, against 15.4 for the same quote alone.TF_GLM_COPY_SHARE=1lets shared rounds' copies take the lone ramp too, each capped at its stream's share of the round's 32 rows less its pending row: 15 tokens at two streams, 7 at four, 3 from seven streams on. The cap leaves the other streams' rows open, and the prices still decide what fills them. It is off by default and refused at the open withoutTF_GLM_COPIES=1, so the default andTF_GLM_COPIES=1alone keep their facts.TF_GLM_COPIES=1+ TF_GLM_COPY_SHARE=1These are two fresh launches an arm, placed symmetrically in one window (off, on, …, on, off), from a fork build of this change on main
d001c28f29that also carries an experiment-only switch, left at its default here. Receipts from this head, main against head, come before Ready. The 1-stream edit cell's −0.8% is one launch (111.7) against two equal ones; one stream never shares a round, and its tokens a chunk are the same (12.800) in all four launches.Where it costs, with one copying stream beside prose or code:
The copying stream finishes sooner, so the others end a little faster as run; while it decodes, their rounds are longer. Without the share cap (a copy taking every row the others leave, measured only as a comparison), the totals rose another 0.4–2.6% and the others' gaps another 14–29%, so the cap stays. Every item's
token_sha256was one hash over its streams, reps, alone and serial runs and all sixteen launches (29 items), with the share on and off.TF_GLM_COPIES=1stays opt-in; this adds one more opt-in under it.4ddc28cfc8), two commits: the change (375b5ccd1e) and its CHANGELOG line's number (b33bb29f36, no code change).atc overlap --jsonagainst main4ddc28cfc8: 25 open pull requests share a file with this head before it stops at its limits (complete: false), and it marks qwen35 cuda: fuse the dense MLP's NVFP4 prompt gate and up projections into one launch #2410, glm cuda: TF_GLM_GRAPHS=1 replays verify windows as CUDA graphs (#1490) #2279, dsv41 metal: image prompts #1722, dsv41 metal: the vision tower's kernels under the kernel contract #1721, Unlimited-OCR-2 on native Metal: the publisher's BF16 release, page images to structured text #2074 and deepseek_v41: reply logprobs normalize over all TP head columns (#1324) #2125 as conflicting. Five share onlyCHANGELOG.md. glm cuda: TF_GLM_GRAPHS=1 replays verify windows as CUDA graphs (#1490) #2279 (TF_GLM_GRAPHS) also adds its row afterTF_GLM_SHAREDin the env table, its docs row and the GLM env test, so this head puts its row with the other off-by-default GLM switches, afterTF_GLM_LINK_WAIT; a test merge with glm cuda: TF_GLM_GRAPHS=1 replays verify windows as CUDA graphs (#1490) #2279's head conflicts only inCHANGELOG.md.Tests:
core/lanes/shared_copy_test.zig: "without the ramp a shared round's copy keeps first_copy's four rows", "the ramp grows two streams' copies to their share and starts over after a miss", "eight streams keep four-row copies, and so do streams that share no round", "a copy keeps to its stream's share of the round, leaving the other streams their rows".families/glm/cuda_env_test.zig: "TF_GLM_COPY_SHARE=1 widens TF_GLM_COPIES=1's copies and is refused without them".native/copy_drafts_cuda_test.zig: "GLM's TF_GLM_COPY_SHARE adds only the shared ramp, and nothing without TF_GLM_COPIES", "GLM's shared ramp widens shared rounds' copies past four rows and keeps plain tokens".copied <= 2 * (32 / 4 - 1)). On a copy of this head where GLM'sapplynever sets the fact,test-glm-copies-hostfails exactly the two native copy tests (18/20).Checks on this head
b33bb29f36, the CHANGELOG number on the change375b5ccd1e; the checks below ran on375b5ccd1e, whose code this head keeps.python3 tools/zig/lean_check.py, on the base and on this head: 341 and 341, the same findings.tools/pr_check.py --base origin/main --pr 3333: 14 changed files, 0 new findings, 0 errors and 0 warnings.zig build -Dfixed-cpu STEP:test-environment-host23/23,test-shared-lane-regressions-host371/372 (1 skipped),test-root-copy-host48/48,test-glm-copies-host20/20,compile-cuda-tests10/10 steps, andtest-cuda-host6,200 passed, 32 skipped and 1 failed on the first run:server/linear_time.zig's timing test "fastest's work leaves out a sleep in a run", which this change does not reach, while the machine was also running other work. Rerun on the quiet machine, all 398 steps passed, that test's binary (52 tests) with them.pytest -q -rsfrom the root: 459 passed, 86 skipped, 519 subtests passed; main's CI on the same base has 461 and 84, the two apart beingtools/zig/test_nfkd_tables.py, which skips on this machine's Python (Unicode 15.0.0).-Dnvccbuild and receipts from this head on GB10s, which come before Ready. Metal, HIP, Vulkan and XPU, with no such machine here; only GLM's CUDA lanes set the fact.Receipt
TF_GLM_COPIES=1andTF_GLM_COPY_SHARE=1, at two streams or more. These numbers: two GB10s at TP=2.TF_GLM_COPY_SHARE: unset or0keeps the facts (the default),1turns it on; it is refused at GLM's open withoutTF_GLM_COPIES=1, and any other text is refused by name. Its rows are inplatform/environment.ziganddocs/environment.md, with a paragraph indocs/recipes/cuda-lane-copies.md.d001c28f29and this change); Zig 0.17.0 and CUDA for sm_121; two GB10s at TP=2 with--parallel 4;Bizuayeu/GLM-5.3-Flash-Jammed-XSFP4at0a22bb46ec; greedy, 3 reps,tools/bench_concurrent.py --alone --serial.applysets the fact and the core's copy proposal reads it in shared rounds. Ran TP=2 only.tools/bench_concurrent.py);tools/bench_openai.pywith the receipts.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (Concurrent equals solo and serial above;"draft": falseand a resumed prompt with the receipts from this head.)--drafter, no slower than without it, greedy and sampled. (With the receipts from this head; off by default, the facts are main's.)