Skip to content

qwen-decode --build-ahead: measured −7.8 % (w1) / −5.7 % (w4) on the pair (PR6c, stacked on #1832; default stays off) - #1834

Merged
jonathan308 merged 5 commits into
devfrom
perf/tp-qwen-build-ahead-measure
Nov 5, 2026
Merged

jonathan308 merged 5 commits into
devfrom
perf/tp-qwen-build-ahead-measure

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #1832 (← #1830). PR6 part c: measure build-ahead on the pair. The product default stays off. Turning it on means setting QwenTensorParallelBatchSettings.buildsAhead = true, which adds qwen-tp-batch-build-ahead-v1 to the load agreement. A pair with one Mac on an older build would then refuse to load. That's a release decision, so it's left out of this PR.

What

  • QwenTensorParallelDecodeBench.pair(…, buildsAhead: [Bool]) runs each control mode × build-ahead mode through the real driver and native executor, after one warm run. Every run of every mode must retire the same tokens, so the bench also checks build-ahead against read-then-build on real ranks. Build-ahead runs with folded control only.
  • darkbloom-cluster-tp-check qwen-decode --build-ahead 0,1 (log line build_ahead=0|1).
  • Measurement script: overnight/tp-perf/bin/ahead-ab (interleaved 0,1 / 1,0 invocations, widths 1 and 4).
  • Also in this stack (from Qwen TP batch driver: build-ahead protocol (gated, off until the native executor submits steps) #1830's review): the runtime passes the agreed buildsAhead into both the driver and the native executor.

Measured (M5 Ultra pair, 2026-11-05 21:24–21:30Z, Mac A load 2.8–4.2)

Qwen 3.8 27B, tp-check qwen-decode over JACCL, sealed sums, product stride 8, synthetic 64-token prompt. The tool build was this stack plus #1820's tool options merged locally.

Width Read-then-build Build-ahead Change With 0.7 ms owner answers
1 (256 tokens) 19.53 ms 18.00 ms −7.8 % 19.45 → 17.99 (−7.5 %)
4 (128 tokens) 27.84 ms 26.25 ms −5.7 % 28.11 → 26.44 (−5.9 %)

Same token digest in every run of both modes (e9a24766…, 5a19c6dc…). The expectation was 8–10 %. Width 1 lands at the low end, width 4 below it: the token-boundary idle is a smaller share of the longer step.

GPU suite (entry 11, same window): buildAheadDecodeTakesTheReadThenBuildTokensAndLogprobs plus the native selection suites passed 4/4 on the GPU with a paged host.

No changelog fragment while the product default is off. The bench and tool changes are developer-only.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Update (22:08Z)

jonathan308 and others added 2 commits November 5, 2026 13:12
PR6 part c, measurement half. QwenTensorParallelDecodeBench takes
buildsAhead modes beside the control modes (build-ahead with folded control
only) and runs each through the real driver and native executor, after one
warm run; every run of every mode must retire the same tokens, so the bench
also checks build-ahead against read-then-build on real ranks. The log line
carries build_ahead=0|1. The product still keeps it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Error Error Nov 5, 2026 10:40pm UTC
d-inference-console-ui-dev Error Error Nov 5, 2026 10:40pm UTC
d-inference-landing Ready Ready Preview Nov 5, 2026 10:40pm UTC
darkbloom-status Ready Ready Preview Nov 5, 2026 10:40pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 5, 2026 10:40pm UTC

Request Review

…doc comment

Behaviour-neutral:
- QwenTensorParallelBatchSession.DecodeInput gains `rows`; the read tokens'
  vocabulary check runs once before the per-session loop (it checked every
  token once per session, before any page was reserved either way), and
  `submitted` is set in the same switch as the input.
- CBv2OwnedRequestState: validateBatchRow's doc comment had ended up above
  submitBatch's; it is back on its function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 5, 2026
Review of #1830-#1834, N1: in the continuation branch a failing read of
the previous step left pending pointing at it, so the cleanup read it a
second time and never drained the step already built ahead (probe: submit
4, read 3, read 3). pending now becomes the newer step before the read.

Tests: aReadFailureWhileTheNextStepIsBuiltDrainsTheNewerStepOnce (red
before: step 6 read twice, step 7 never; green after); the pending-failure
test now checks every submitted step is read exactly once and the failed
one never (N2); a built-ahead EOS leaves exactly one discarded forward (N4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 5, 2026
…s no device frontier

Review of #1830-#1834, N5 and the device-read gap:
- aNativeLaneRetiresAfterABuiltAheadEOS: a native lane whose EOS is read
  after its next step was built retires as a clean EOS with exactly one
  discarded forward; red without the schedule's EOS rule.
- CBv2StageKVHost.submittedDeviceFrontierReads counts the frontier checks a
  submitted frame reads from the device; the token-identity suite asserts
  none on a paged host (GPU) and that the counter is live on a contiguous one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
qwen-decode keeps #1820's --backend jaccl and --layer-strides beside
--build-ahead; the bench takes both layerStride and buildsAhead (the logic
measured on the pair at 21:24-21:30Z).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch had an error being deployed

2 failed and 3 active deployments
Preview – d-inference-landing — e1b0bc7e Deployed Nov 5, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — e1b0bc7e Deployed Nov 5, 2026 by vercel[bot]
Preview – darkbloom-status — e1b0bc7e Deployed Nov 5, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — e1b0bc7e Deployed Nov 5, 2026 by vercel[bot]
Preview – d-inference — e1b0bc7e Deployed Nov 5, 2026 by vercel[bot]
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