Skip to content

GLM CUDA: opt-in context copies priced by the lane host - #2146

Merged
ashhart merged 2 commits into
mainfrom
lead/s236-glm-copies
Nov 5, 2026
Merged

ashhart merged 2 commits into
mainfrom
lead/s236-glm-copies

Conversation

@ashhart

@ashhart ashhart commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Part of #1910.

Native GLM on CUDA has no copy drafts. This adds them as an opt-in: TF_GLM_COPIES=1 on rank 0 uses the lane host's cost-priced root and context copies with a four-token history match. The default policy doesn't change, and followers execute rank 0's verify, keep and head commands as they do today.

Copy drafts cost Spark 2.5 between 3.8% and 22.7% on 3 Nov, so an offer has to pay for itself here: copies go through the shared cost allocation and their own observed acceptance, and an expensive offer can get zero rows.

Test plan

  • Host, on Linux: real GLM facts through the shared planner, covering paid and rejected offers, confidence limits, shared streams, resumed prompts and cancellation. Three planted controls fail. Lean stays at 425.
  • TP=2 on two GB10s: tokens equal to main's, and speed with TF_GLM_COPIES=1. Queued, on our NVFP4 checkpoint.
  • The reporter's EXL3 checkpoint, which we don't have on our boxes.

Nothing here has run on a GPU yet, and it claims no speed gain until that run says so.

@BadAd84 tried copy drafts on GLM first, in #1498, and measured them losing on a quote workload (-15.8%), which is why this stays opt-in and claims no speed gain. Our TP=2 run above didn't include that workload. No code from #1498 is used here.

@ashhart

ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

First TP=2 run on two GB10s, on our NVFP4 checkpoint, TF_GLM_COPIES=1 against the merge-base at --context 65536 --parallel 2, alternating builds.

  • Tokens: identical in all 52 comparisons.
  • Decode, new against base: code +1.6% at one stream and +0.3% at two; chat +1.5% and +2.3%.
  • Prompts: level. At 2K, the later runs read 1,605-1,618 tok/s on both builds, and at 8K about 1,480. At 32K, the later new run reads 1,480-1,490 against base's 1,477-1,495. The summary's -25.7% at 2K and -7.6% at 32K both come from the very first run after loading (726 tok/s climbing to 1,624 at 2K, and two of four at about 1,255 at 32K), which landed on the new build. I'd read those as a cold first run rather than this change, though with one new run left that isn't proof.

These are general chat and code prompts, not ones that repeat long passages, so this says little about what copies gain where they should help. It stays opt-in, and it isn't a speed claim. The reporter's EXL3 checkpoint hasn't been run.

Keep the existing default policy and add TF_GLM_COPIES=1 for root and context copies through the lane core. Seed existing target prices and observe copy acceptance, retaining the explicit head-confidence prefix without bypassing copy costs.

Exercise real family facts, paid and rejected offers, confidence limits, shared streams, resumed prompts and cancellation on the host. Device exactness and performance remain qualification gates.

Part of #1910.
@ashhart
ashhart force-pushed the lead/s236-glm-copies branch from c2c9fc4 to b1d3f5b Compare November 5, 2026 07:01
@ashhart
ashhart merged commit 10a4303 into main Nov 5, 2026
2 of 7 checks passed
jschmied added a commit to jschmied/TensorFold that referenced this pull request Nov 5, 2026
ashhart pushed a commit to jschmied/TensorFold that referenced this pull request Nov 6, 2026
ashhart pushed a commit to jschmied/TensorFold that referenced this pull request Nov 6, 2026
ashhart pushed a commit that referenced this pull request Nov 6, 2026
@ashhart
ashhart deleted the lead/s236-glm-copies branch November 10, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant