Skip to content

fix(cluster): share probe budget bounds the timed rounds, not setup - #1810

Merged
davidtai merged 3 commits into
devfrom
fix/share-probe-budget
Nov 5, 2026
Merged

davidtai merged 3 commits into
devfrom
fix/share-probe-budget

Conversation

@davidtai

@davidtai davidtai commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

QwenTensorParallelShareProbeTests.eachRankTimesItsShareAloneAndReleasesItsRequest() fails intermittently in CI with darkbloom-share-probe-v1 rank=0 skipped=budget (run 41973436945, Cluster Runtime Tests shard 2, PR #1787; also in the runs of PR #1745).

Cause

QwenTensorParallelShareProbe.measure reads started before admission. The 1.5 s budget (budgetNanoseconds) is measured from started, so it also counts these steps:

  • the KV host and the session,
  • the 64-token prefill,
  • the 2 warm-up rounds.

The probe is the first forward of the loaded model in its worker process, so the kernels compile on first use inside the same 1.5 s. If the setup is slow, fewer than 3 timed rounds run and the probe skips with skipped=budget. The window (verify) phase gets only the part of the 1.5 s that the plain phase leaves. Gemma4TensorParallelShareProbe has the same loop.

Production effect

Production has the same problem. The test is not the only path that can skip:

  • Each tensor-parallel load runs the probe one time, before its ready record (QwenTensorParallelResidentRuntime.load through atLoad, and the Gemma 4 load). The probe uses the same constants as the test.
  • Nothing runs the model's forward before the probe, so each probe pays the first-use kernel compile.
  • A skip is not retried. A nil probe is not sent in readiness, so ClusterShareProbeHistory records nothing.
  • Gemma 4 and MiMo are .fastest families. They choose tensor parallel only on measured share steps (predictedFasterOnPriorOnly otherwise), so a skipped probe can keep tensor parallel from being chosen.

This comes from reading the code. It was not measured on a Mac.

Change

  • QwenTensorParallelShareProbe.rounds is a new round loop that both probes share. It runs the warm-up rounds and then the timed rounds. Each phase's timed rounds stop budgetNanoseconds (1.5 s) after the first timed round of that phase, so the setup and warm-up time does not count against the budget.
  • limitNanoseconds (8 s) is a new hard limit on the whole probe, measured from started. It includes admission, prefill, warm-up and timed rounds. The limit is less than the 10 s deadline margin (deadlineMarginNanoseconds), so a probe that starts ends before the load deadline that it read at its start. The deadline margin did not change, because the lease TTL is 30 s.
  • No round starts after the limit. rounds returns its timed rounds and whether the limit stopped them, so the skip reason (skipped=budget or skipped=limit) comes from the loop itself. A probe that reaches the limit after 3 plain timed rounds keeps its plain figure and gives no window figure.
  • The window phase no longer gets only what the plain phase leaves of the budget. It has its own budget, inside the same limit.
  • Test assertions are not loosened. There is no retry and no skip.

Tests

  • New CPU test timedRoundsKeepTheirBudgetAfterASlowWarmUp, which runs in every CI run. It uses a constructed clock through the existing clock seam. Cases:
    • 5 s of setup plus slow warm-ups: all 7 timed rounds run.
    • 1 s timed rounds: the budget stops them at 2 rounds, which is fewer than a figure needs.
    • The limit reached before or during the warm-ups: no timed round.
    • The limit reached during the timed rounds: the rounds stop.
  • GPU suite (QWEN_TP_SHARE_PROBE_GPU=1):
    • A setup that is 3 s slower than real time still gives all timed rounds and the window. The old code gave no probe in this case.
    • A clock past the limit before the first round gives no probe and keeps nothing.
    • The existing fast-clock case now steps the clock by just over half the budget, so it stops on the budget (1 timed round) and gives no probe.
  • These tests were not built or run on the laptop. CI runs them.

CI note

On dev, the routing from #1803 sends macOS lanes to Darkbloom sandbox runners (darkbloom-*). Their image has Xcode 27.2, and dev accepts only SDK 27.0 until the 27.2 port. A job that lands on a sandbox runner fails before any test runs, at "Provider release requires preinstalled SDK 27 / Swift 6.4". This also happens on dev push run 41973762728. Every job that ran on Blacksmith passed. #1787 limits macOS lanes to Blacksmith. If a re-run lands on sandbox runners again, this branch takes dev after #1787 merges and runs CI again.

Review

An independent refactor pass found nothing blocking. Its suggestions are in the second commit: the loop reports its own stop cause, the check before the one-chunk prefill (which could not fire in production) is removed, the GPU budget case is fixed, and the limit is described exactly.

Hooked up

  • QwenTensorParallelShareProbe.measure: called by atLoad from QwenTensorParallelResidentRuntime.load.
  • Gemma4TensorParallelShareProbe.measure: called from Gemma4TensorParallelResidentRuntime load.
  • Docs: docs/architecture/inference.md (Tensor-parallel share probes) and docs/developer/test.md.

🤖 Generated with Claude Code

The share probe measured its 1.5 s budget from before admission, so the
prefill, the warm-up rounds and first-use kernel compile in the worker
process counted against the timed rounds. A cold first probe then gave
fewer than three timed rounds and skipped=budget, in CI and on a real
load alike, and a skipped probe leaves no share evidence for the
fastest-only tensor-parallel families.

Each phase's timed rounds now run for the budget from their first timed
round. A separate 8 s limit, inside the 10 s deadline margin, bounds the
whole probe including prefill and warm-up (skipped=limit). The Qwen and
Gemma 4 probes share the round loop (QwenTensorParallelShareProbe.rounds),
tested on the CPU with a constructed clock.

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 7:00am UTC
d-inference-console-ui-dev Error Error Nov 5, 2026 7:00am UTC
d-inference-landing Ready Ready Preview Nov 5, 2026 7:00am UTC
darkbloom-status Ready Ready Preview Nov 5, 2026 7:00am UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 5, 2026 7:00am UTC

Request Review

Review pass on the share probe budget fix. The round loop returns its
timed rounds and whether the limit stopped them, so the skip reason
(budget or limit) is the loop's own and not a clock read afterwards. The
check before the one-chunk prefill could not fire in production and is
removed with LimitReached. The GPU budget case steps the clock by just
over half the budget, so it stops on the budget again and not on the
limit. The docs say what the limit does: no round starts after it.

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 — 90ddf3e2 Deployed Nov 5, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 90ddf3e2 Deployed Nov 5, 2026 by vercel[bot]
Preview – d-inference — 90ddf3e2 Deployed Nov 5, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 90ddf3e2 Deployed Nov 5, 2026 by vercel[bot]
Preview – darkbloom-status — 90ddf3e2 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