Repository navigation
feat(cluster, provider): 0.10.12 — Gemma 4 tensor parallel serves as many requests at once as both Macs admit - #1936
Merged
Merged
Conversation
… Macs admit and serves it (red) Red first for 0.10.12's first concurrency step: a Gemma 4 pair in tensor parallel serves one request at a time today. Its owner already serves batch lanes (the shared batch driver with a Gemma executor), but no width is ever saved for it: guided placement sizes only Qwen TP rows (by their native quotes), and `ClusterConfiguration.validate` refuses a Gemma tensor-parallel `batchLanes` outright. So the setup screen says "serves one request at a time" and the slot's `max_concurrency` is 1. These checks state the behaviour wanted, with the APIs dev already has: - ClusterPlacementTensorWidthTests: a Gemma tensor-parallel placement whose layout states a lane charge (`laneBytes` beside the family's allowance, as the native plan tool will write it) saves the widest of 8, 6, 4 and 2 lanes both Macs admit now, each lane after the first adding that charge to every rank's need; the smaller Mac decides; the setup screen's number (`ClusterSetupPlanning.loads`) is the saved width and `DistributedInstalledPlan.batchLanes`'s; a layout with no lane charge saves none and says one. - aGemmaTensorParallelPairServesTheWidthItsSetupSaved: a Gemma TP setup saved with 8 lanes is accepted on both Macs, both plans serve 8, a lane retires alone and both ranks are launched with 8 (a new `.gemma4TensorParallel` shape of the approval fixture). - ConfigurationCheck: a Gemma TP setup keeps a width of 2, 4, 6 or 8 with serial prefill; GLM and MiMo TP still save none; a width beside the one-chunk lookahead is refused. - The configuration check runner compiles again: ClusterConfiguration's validation reads ClusterPublicModels, which needs the grant files and the placement module, which its run.sh did not build. - InstalledBatchLanesCheck: a Gemma TP setup's saved width reaches its owner lease, its actual owner child and the rank. - PlacementChecks: the product layout (the allocator's bound known) states Gemma's lane charge, one request's whole charge. On dev 0f11fbe each fails: no width is saved, the screen says one, the Gemma TP setups are refused at validation, and the layout states no lane charge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…many requests at once as both Macs admit A Gemma 4 pair in tensor parallel served one request at a time: its owner serves batch lanes, but nothing ever saved it a width. It is now sized at placement the way a Qwen TP row is, by what both Macs' memory admits, and LOAD reserves that width. - The lane charge. Gemma's layout states, beside its allowance (one request at the memory plan's request plus the rank's reserve), what each lane after the first adds: one request's whole charge (`ClusterTensorParallelFamilyPlan.laneBytes`, from `Gemma4TensorParallelRequestBudget.laneBytes`), the charge `reserveLane` admits every lane with. The native plan tool writes it where the allocator's bound is known; metadata-only layouts carry neither. - The planner. `ClusterPlacementPolicy.tensorParallelLanes` prices a tensor-parallel candidate at a width: each rank's native reservation grows by the lane charge for every lane after the first. It refuses a width for a family without a lane charge, or beside a native quote. - The width. `ClusterPlacementTensorWidth` sizes both kinds of owners: a Qwen TP row by its native quotes, as before, and a family with a lane charge at 8, 6, 4 and 2. The placement chosen for one request keeps its leader and split; the first width both Macs admit now is saved, and none (one request at a time) when no wider width fits. It never exceeds the width the family qualified on real Macs (`qualifiedLanes`: eight for the Qwen TP rows, as before, and eight for Gemma, to be confirmed on the M5 Ultra pair). - The setup. `ClusterConfiguration.validate` accepts a Gemma tensor-parallel width of 2, 4, 6 or 8 with serial prefill (`ClusterRuntimeAdapter.savesTensorParallelWidth`). The setup screen, both owners, the slot's `max_concurrency` and the local API read it through `DistributedInstalledPlan.batchLanes`, unchanged. - LOAD. Gemma's rank reserves `reservedBytes(lanes:)`, the allowance and a lane charge for each lane after the first: the figure the planner priced. Its prompt-prefix memory tier is measured beside every lane's charge. The load line reports `reserved=`. GLM tensor parallel keeps its eight lanes, MiMo tensor parallel serves one, and the pipelines are unchanged: later steps of the same work. Checks: PlacementChecks prices each width as LOAD reserves it (12.7 GB a rank at two lanes, 28.6 GB at eight; two idle 256 GB Macs hold eight, two idle 24 GB Macs one) and refuses a width without a lane charge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…nt's widths; LOAD's reservation is the prefix tier's charge Refactor pass on the Gemma 4 tensor-parallel width (behaviour unchanged): - ClusterPlacementTensorWidth: one function, `widths`, decides how the singleton's wider widths are priced (a Qwen TP row's native quotes where its singleton quote priced it; a family's lane charge where nothing else priced it; none otherwise), and `widest` only searches them. The `sizes` flag and the second guard in `plan` are gone; a placement with no width to try is planned once, as before. - Gemma4TensorParallelRequestBudget.chargeBytes(lanes:) is gone: the allowance is `requestBytes` plus `rankBytes`, so it equalled `reservedBytes(lanes:)` at every width. The prompt-prefix tier's room is measured beside the figure LOAD reserved. - PlacementChecks pins what the runtime relies on: one lane reserves the allowance alone and plans as no width; every width reserves every lane's request and the rank's reserve once; LOAD and the planner refuse 0 and 9 lanes; a layout whose lane charge is nothing, or more than its allowance's request part, is refused where it is read. - The changelog fragment says what a further request is charged (all one request holds, about 2.6 GB on each Mac), and configuration.md's date follows its edit. Mutants of the lane arithmetic, its bounds and the width search are killed by these checks and by ClusterPlacementTensorWidthTests' Gemma cases (run through `decide` in a scratch harness); the survivors are equivalent here (the leader and split are already held, Gemma has no native quote). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 9, 2026
Takes the parent's one-rule width search (`ClusterPlacementTensorWidth.widths`), the Gemma budget without its duplicate `chargeBytes(lanes:)` and the stronger Gemma lane checks. No conflict: the GLM lane charge's planner and layout rules hold for those checks (a lane charge of nothing, or above a stated allowance's request part, is still refused). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…allel width, and a pair's first-token projection (red)
Red first for the independent review of C1 (P2-1, P2-2, M23):
- PlacementChecks (P2-1): LOAD reserves the whole width while it reads the
shard (the shard gate's resident charge), but the planner leaves that
reservation out of a lane-charge width's load peak, about 0.75 GB a rank
short. On two 24-48 GB Macs with up to 8 GiB more in use, LOAD must admit
every planned width. Today it refuses 9 of them: two 32 GB Macs with
5-5.5 GiB in use at 2 lanes, 36 GB with 4.25-4.75 GiB at 4, 48 GB with
5.75-6.25 GiB at 8.
- ClusterPlacementTensorWidthTests:
- a width's need counts LOAD's whole reservation in its load peak;
- the 8, 6, 4 and 2 search itself (`ClusterPlacementTensorWidth.plan`
with a cap of eight);
- Gemma TP saves at most 2 (`qualifiedLanes`, the owner's choice of 2 or
4), for the QAT 4-bit row only; the 8-bit rows save none;
- M23: a sized plan keeps the singleton's kept-mode reason (a Gemma pair
re-planned after an update keeps tensor parallel ahead of a pipeline
its share steps were not measured against).
- The pair's first-token projection counts nothing. Its owner
(`DistributedPipeExecutionOwner.projectFirstToken`) always returns
unbounded, so once the bridge has measured the pair's prefill (since
7062b62) every request with a first-content deadline, which the
coordinator sends on every request, is refused `deadline_unreachable`,
a lone one too. Before that, nothing was projected at all.
- ProcessChecks: the real owner projects a request's prompt at the
caller's prefill rate (the pair's own, measured end to end), and
nothing without a usable rate. The MLX stand-ins gain the bounded
projection and the prefill rate the owner reads.
- DistributedCBv2DeadlineTests: a burst of eight 8,000-token prompts on
eight lanes takes only the lanes whose first token meets a 30 s
deadline (three at 1,000 tokens a second), and a prompt that has given
its first token delays no other.
Locally: PlacementChecks 1 failed (above), ProcessChecks fails at the
projection, and a scratch copy of the width tests in the light runner
fails 11 expectations. ProviderCoreTests run in CI only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rvation (review P2-1) Gemma 4's LOAD passes the whole width's reservation to its shard gate, which asks for it before every tensor beside the rest of the shard, two whole tensors, the read scratch and the loading headroom. The planner priced a lane-charge width's load peak without it (`batchLoadReservation` was 0 without a native quote), about 0.75 GB a rank short (the 369 MB embedding twice and the read scratch). A width sits within one 5.3 GB step of what a small Mac admits, so about one memory-bound pair in seven on 24-48 GB Macs was planned at a width that LOAD then refused, and the memory re-plan picked the same width again. A lane-charge width now counts the reservation in the load peak (and in what the allocator holds), as a Qwen TP batch quote does: `rankReserved ?? quote?.allowance.reservedBytes ?? (laneGrowth > 0 ? nativeFloor : 0)`. Here `nativeFloor` already carries the lane growth (the allowance plus a lane charge per lane after the first, LOAD's figure). One request plans byte for byte as before. PlacementChecks: 1,657 passed (the red check's 9 refused shapes now plan a width LOAD admits; two idle 24 GB Macs still plan one lane). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e QAT 4-bit row only (review P2-2) The cap is one constant, `ClusterPlacementTensorWidth.gemmaTensorParallelLanes`, which `qualifiedLanes` reads for the row the M5 Ultra pair qualified: - 2 for now; the owner chooses between 2 and 4. C1 (2026-11-10) gave every lane its solo tokens and logprobs at 2, 4 and 8, but served a request fastest at 2: 95.5 tok/s in all and 77 a request, against 96.2 and 48.5 at 4, and 60.8 and 14.5 at 8, where the last of eight 8K-token prompts sent at once waited 63.7 s for its first token (7.7 s alone). - QAT 4-bit only (`gemmaQualifiedRuntimeModelID`). The 8-bit rows run the same lanes on 8-bit kernels: neither the pair nor the synthetic lane checks (`Gemma4TensorParallelRuntimeTests`, all 4-bit) ran them at these widths, so they save no width and serve one request at a time. `savesTensorParallelWidth` still says their owner can serve a saved width. The width search still tries 8, 6, 4 and 2 below the cap (the tests check it with a cap of eight). Docs and the changelog fragment say 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… prompts already holding a lane (review P2-2)
The pair's first-token projection counted nothing, other lanes included:
its owner (`DistributedPipeExecutionOwner.projectFirstToken`) always
returned unbounded ("no measured peer transfer/control envelope"), and the
session and the slot only forward it. The engine refuses an unbounded
projection, so once the bridge had measured the pair's prefill (7062b62,
also in 0.10.11) every request carrying a first-content budget, which the
coordinator sends with every request, was refused `deadline_unreachable`,
a lone one too. Before any rate was measured, every request went into a
free lane with no first-token check, as GH's burst shows (the last of
eight 8K-token prompts gave its first token at 63.7 s, 7.7 s alone).
- The owner projects the request's whole prompt at the caller's prefill
rate, in chunk steps. For a pair that rate is the pair's own, measured end
to end from both ranks' reservation to the first committed token
(`DistributedCBv2Engine.timing`), so it already carries the transfer and
control costs. Without a usable rate it still projects nothing.
- The engine puts that projection behind every prompt already holding a
lane without its first token, running or waiting for its reservation
(`behindPendingPrefill`, `pendingPrefillTokens`, `admittingPromptTokens`),
priced at the same rate. A burst takes only the lanes whose first token
meets its deadline; the rest are refused at once, for the coordinator to
place elsewhere. Other lanes' decode steps between prompt chunks are not
charged.
ProcessChecks, run-flow (33), the installed-session, console, diagnostics
and placement-setup (274) runners pass; the engine tests run in CI.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The red run (e6192f0) showed the burst admitted into all eight lanes, as expected, and one more failure that was the test's own: it dropped each admitted stream at once, and a stream nobody holds cancels its request (`continuation.onTermination`). A cancelled request has given up its prompt, so it would no longer delay the next one, and the fix could never pass. The test now keeps the streams until the end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 10, 2026
#1936 now counts LOAD's reservation in a lane-charge width's load peak, caps Gemma TP at 2 lanes for the QAT 4-bit row, and makes a pair project each request's first token behind the prompts already holding a lane. Resolutions: - ClusterPlacementPlanner: here a width's growth sits outside the one-request floor (`nativeFloor` has no lane growth), so the load peak takes the review's form, `nativeFloor + laneGrowth`. The automatic merge kept `nativeFloor` alone, which would have left Gemma's lane charges out again. GLM's plans are unchanged: its every-rank charge already holds the load transients, so its request need still decides (PlacementChecks 1,667, the GLM decide tests and the setup checks' GLM pair unchanged). - ClusterPlacementTensorWidth: GLM keeps eight; Gemma takes `gemmaTensorParallelLanes` for its qualified row. - ClusterPlacementTensorWidthTests: #1936's Gemma tests on this branch's lane-row fixture (`LaneRow`, `laneChargeFixture`, `decideLaneCharged`, `savedAndScreenLanes`), beside the GLM test. - inference.md and two-mac-cluster.md: both families' rows and bullets. Light runners on the merge: PlacementChecks 1,667, placement setup 277, run-flow 33, ProcessChecks, installed-session and configuration pass; a scratch copy of the width tests passes for Gemma and GLM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ound-2 changes A review-only refactor pass over this round (an independent agent that edited nothing) found no compile risk and the admission bookkeeping sound. Taken: - Gemma's cap is one table, `ClusterPlacementTensorWidth.gemmaQualifiedLanes` (row to width, QAT 4-bit at 2), instead of a width constant beside a row constant compared by string. - The planner says why one lane keeps its load peak: its shard gate holds the allowance too, so it stays the 0.75 GB short it was before widths, and one-request plans are unchanged (the review's own form). The docs say the same. - The owner's projection says what it does with a request's images or video: its media tokens at the text rate, the vision tower's time not charged. The docs say a missing rate means no deadline admission (the request is admitted), while an admission without a prefill rate is refused. - The burst test also checks that a reserved lane leaves no prompt counted as waiting (`admittingPromptTokens` back to 0). - No wave names in comments (AGENTS.md); the code says "the M5 Ultra pair, 2026-11-10". Not taken: counting a one-lane plan's allowance in the load peak (it would change every Gemma TP singleton plan, which the review chose to keep), and a cancelled-but-cleanly-stopping lane's prompt in the pending prefill (reached only where lanes do not retire alone). PlacementChecks 1,657, ProcessChecks, placement setup 274 and the scratch width tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 10, 2026
…llel width #1936 made Gemma's cap one table (`gemmaQualifiedLanes`), explained why one lane keeps its load peak, and documented the projection of media requests. Resolutions: - ClusterPlacementPlanner: this branch's `nativeFloor + laneGrowth`, with #1936's explanation and what the allowance is here (none for GLM, whose request need decides). - ClusterPlacementTensorWidth: GLM's eight beside Gemma's table. - inference.md: both families' planner and cap bullets, no wave names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
marked this pull request as ready for review
November 10, 2026 06:00
jonathan308
added a commit
that referenced
this pull request
Nov 10, 2026
… (0.10.12 candidate; head efb5cd5) # Conflicts: # libs/darkbloom-cluster/Sources/DarkbloomClusterProtocol/ClusterRuntimeCapability.swift
jonathan308
added a commit
that referenced
this pull request
Nov 10, 2026
The owner decided (2026-11-10) that a Gemma 4 pipeline pair keeps the one-chunk lookahead and serves one request at a time by default in 0.10.12. On the M5 Ultra pair, serial prefill at 8 lanes made a lone prompt's first token 1.84 to 1.94 times later at 8K to 64K tokens. `ClusterPlacementPipelineWidth.qualifiedLanes` now reads a table keyed by family, `qualifiedLanesByFamily`, which is empty. Every guided setup and `darkbloom cluster plan` therefore keeps the placement chosen for one request: for a Gemma layer split, the lookahead, no width, one lane. Listing a family there (`.gemma4LayerStage: 8`) sizes its guided setups again, as #1936's `gemmaQualifiedLanes` does for tensor parallel. Unchanged: - A setup saved with serial prefill and a width serves that width, and LOAD admits it whole. A local pair's automatic replacement saves such widths, Qwen 3.5's included. - A setup saved without a width serves one lane. - `ClusterPlacementPipelineWidth.size`, `pipelineLanes` pricing and `DistributedInstalledPlan.batchLanes`. The re-plan after an update calls `decide` the same way, so a coordinator pair approved with the lookahead keeps it and its approval. Comments in `DistributedInstalledPlan` and two tests no longer say a placement saves Gemma's width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stack (red) The 0.10.12 candidate merged with #1937 died of SIGBUS in `ClusterPlacementTensorWidthTests.aPlacementSavesTheWidestWidthBothMacsAdmitNow`: a stack overflow on the 512 KiB thread Swift Testing runs a test on. In CI's debug build, `ClusterPlacementFlow.decide` and the planner under it used 387 KiB of that thread planning a tensor-parallel width (`decide`'s own frame 99 KiB). The test left 20 KiB, and the merge grew `decide`'s frame by 23 KiB. The guided step (`ClusterSetupPlanning.decide`) used 692 KiB, more than the onboarding's and the service's 512 KiB planning threads have; its tests already run it on a 16 MiB thread. Two checks measure how much of its caller's stack each entry point uses. `stackUsed` runs a body on a thread whose 16 MiB stack it pattern-fills first, so a planner that is too deep fails a check rather than killing the test process. The budget is 64 KiB of the caller's 512 KiB: - `decideLendsItsCallerLittleStack`: `decide` planning the 27B's widest width. - `theGuidedStepLendsItsCallerLittleStack`: the guided step planning the 27B's tensor parallel. Both fail on this commit (debug: about 390 and 690 KiB). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he planner only a wait A plan is asked for on its caller's thread, and every caller's thread has a 512 KiB stack: the onboarding's and the cluster service's planning threads (`Thread.detachNewThread`), the automatic replacement's task, `darkbloom cluster plan`'s task and every Swift Testing test. A debug build's planner frames are large. On 2026-11-10 `ClusterPlacementFlow.decide` used 387 KiB of a test's stack planning a tensor-parallel width (its own frame 99 KiB). A test whose frames left 20 KiB died of SIGBUS when the candidate's merge of #1937 grew `decide`'s frame by 23 KiB. The guided step (`ClusterSetupPlanning.decide`) used 692 KiB, more than the threads it runs on have, so its tests ran it on a 16 MiB thread of their own. A release build used about 120 and 220 KiB, within 512 KiB. `ClusterPlanningStack.run` runs a body on a thread with a 16 MiB stack while the caller waits, and hands back its value or its error. The body need not escape: the thread lets go of it before the caller goes on. A thread inherits no task-local value, so it binds again the one the planning reads (`ClusterPublicModels.declarationOverride`, which only tests set). Both entry points now do their planning in a private `decideOnPlanningStack` on that stack: `ClusterPlacementFlow.decide` and `ClusterSetupPlanning.decide`. The red checks pass. CI's red run measured 414 and 694 KiB. A replica of `decide`'s check on the CPU runner measures 72 KiB in a debug build: the wait, plus the check's own call. So the budget is 128 KiB, a quarter of a caller's 512 KiB, rather than the red commit's 64 KiB. The red measurements are well over both. The guided-step tests no longer need `onLargeStack`. They call the guided step on their test task, as the onboarding does. `ClusterPlacementChecks/run.sh` compiles the new file; the other runners pick it up from the folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- inference.md, Planning stack: both planning entry points run on a 16 MiB stack of their own while their 512 KiB callers wait, with the debug and release figures from 2026-11-10 and the task-local value bound again. - test.md, Planning stack checks: what the two checks measure, how (`stackUsed` on a pattern-filled 16 MiB stack, so a planner that grows too deep fails a check instead of killing the test process), the 128 KiB budget, and the debug figures before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 12, 2026
- docs/provider/two-mac-cluster.md: the Gemma example serves up to 2 at once (#1936's cap), not 8 - changelog.d/loop-guard.md: Super's text requests are covered (#2020) - changelog.d/qwen35-card-rows-donate-checkpoints.md: the 9B has no default penalty again (#1961 via #2021) - provider-swift/Sources/ProviderCore/Inference/Vision/MediaIngest.swift: no 64-image entry for the 9B - provider-swift/Tests/ProviderCoreTests/Inference/Vision/MediaIngestTests.swift: the 9B's image-cap tests expect 16 - provider-swift/Tests/ProviderCoreTests/Inference/Vision/EngineV2VisionRoutingTests.swift: the preparer test expects the 9B's 17th image refused - docs/architecture/inference.md: no 64 for the 9B - docs/reference/configuration.md: no 64 for the 9B - changelog.d/qwen35-9b-64-images.md: only the media_memory_unavailable bullet Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 12, 2026
This branch was successfully 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.
For 0.10.12. First step of the concurrency work: every pair option serves several requests at once (owner, 2026-11-09: "all of these options should be concurrent"). Plan:
CONCURRENCY-PLAN.md§2.2. Draft. C1 ran on the M5 Ultra pair on 2026-11-10 (all six Gemma TP sessions passed), and the independent review's changes are in (round 2, below).Status (2026-11-10, after the 0.10.12 candidate's SIGBUS): planning runs on its own stack
8ace9d99ac. CI (dev) green (run 42780360818).679426d635(the candidate plus feat(cluster, provider): 0.10.13 — a Gemma 4 pipeline keeps the lookahead; a saved serial width is checked whole at load #1937) died of SIGBUS inClusterPlacementTensorWidthTests.aPlacementSavesTheWidestWidthBothMacsAdmitNow.EXC_BAD_ACCESSin___chkstk_darwin.Context.tensorRequirement.need16 → test'sdecide25ClusterPlacementFlow.decide122ClusterPlacementTensorWidth.plan10 →widest22ClusterPlacementPlanner.plan74 →assessTensorParallel48 →candidates31 →bestTensorShares11 →evaluate21 → closure 11tensorRequirement57ClusterPlacementPipelineWidth.size(&result, …)beside this PR's sizing indecide.let resultbecamevar resultplus an inout call. That grewdecide's debug frame from 101,584 to 125,200 bytes (+23 KiB; prologues of CI's two bundles). On the shipping tree this test had only 20.3 KiB (20,744 bytes) to spare.c85c0c0bca, before this fix:ClusterSetupPlanning.decide), 27B tensor parallel, CI's bundle-O -wmobuild of the plannerdarkbloom cluster's planning, and the service's update and memory re-plans (Thread.detachNewThread);Task.detached);darkbloom cluster plan(an async command, so it runs on the cooperative pool).decide, debug / release:ClusterPlanningStack.runruns both planning entry points on a thread of their own with a 16 MiB stack while the caller waits:ClusterPlacementFlow.decideandClusterSetupPlanning.decide.ClusterPublicModels.declarationOverride, which only tests set).50ca322f77: the tests. Its CI run (42777175333) failed exactly the two new checks.decideused 414 KiB of its caller's stack and the guided step 694 KiB, against a 64 KiB budget. They measure on a pattern-filled 16 MiB thread, so a planner that is too deep fails a check instead of killing the test process.4720063e82: the fix. The budget is now 128 KiB: a replica of the check on the CPU runner measures 72 KiB in debug, the wait plus the check's own call. The guided step's tests droponLargeStackand run on their test task.8ace9d99ac: docs (inference.md Planning stack, test.md Planning stack checks).run-flow.sh(33),ClusterConsoleChecks(79,396 expectations),ClusterDiagnosticsChecks,ClusterInstalledSessionChecks,changelog check,docs-impact-check.0552b096a9merged with8ace9d99achas no conflicts (git merge-tree); nor does feat(cluster, provider): 0.10.12 — GLM tensor parallel serves as many requests at once as both Macs admit #1939 merged with it. feat(cluster, provider): 0.10.13 — a Gemma 4 pipeline keeps the lookahead; a saved serial width is checked whole at load #1937 carries the same three commits for 0.10.13.Status (2026-11-10, review round 2)
efb5cd5610. CI (dev) green (run 42759670913).e6192f05c6(tests only). Its CI run (42745016900) failed on exactly those tests:PlacementChecks' LOAD check,ProcessChecks' projection, 11 issues inClusterPlacementTensorWidthTests, the burst test. Then the changes:08c0dee3ae(P2-1),a54dd1b5ba(cap),b3b1fda6a8(projection), and523d44922b(the burst test keeps its streams; see below). CI on523d44922b: green (42747717380), every new test passing.efb5cd5610): the cap became one table (gemmaQualifiedLanes); the planner and docs say why one lane keeps its load peak (its gap predates widths, and one-request plans stay byte for byte, the review's own form); the owner's projection says it prices a request's images or video as text tokens, the vision tower's time aside; the burst test also checks that a reserved lane leaves no prompt counted as waiting; no wave names in comments. It found the admission bookkeeping sound and no compile risk. Not taken: counting a one-lane plan's allowance (it would change every Gemma TP singleton plan).batchLoadReservationcounts it for a lane-charge width (?? (laneGrowth > 0 ? nativeFloor : 0); herenativeFlooralready carries the lane growth), and so does what the allocator holds. One request plans byte for byte as beforePlacementChecks: on two 24, 32, 36 or 48 GB Macs with up to 8 GiB more in use, LOAD must admit every planned width. Before: 9 refused (two 32 GB Macs with 5–5.5 GiB in use at 2 lanes, 36 GB with 4.25–4.75 GiB at 4, 48 GB with 5.75–6.25 GiB at 8). After: 1,657 pass.ClusterPlacementTensorWidthTestsprices a width's need with the reservation in the load peakClusterPlacementTensorWidth.gemmaQualifiedLanes(row → width, QAT 4-bit at 2), whichqualifiedLanesreads. The owner chooses 2 or 4: at 2, 95.5 tok/s in all and 77 a request; at 4, 96.2 and 48.5ClusterPlacementTensorWidthTests:decidesaves 2 at most; the search itself is still checked at 8, 6, 4 and 2 (ClusterPlacementTensorWidth.planwith a cap of eight)Gemma4TensorParallelRuntimeTests) and C1 ran 4-bit. They save no widthaGemmaRowThePairDidNotQualifySavesNoWidthProcessChecks(the real owner over two worker processes),DistributedCBv2DeadlineTests.aBurstOfLongPromptsTakesOnlyTheLanesWhoseFirstTokenMeetsItsDeadlinedecide, onlykeptModeReasoncan differ (wheneverdecidesetsmodesReason, the singleton's modes already leave the pipeline out)aSizedPlanKeepsTheSingletonsReasons. In a scratch copy in the light runner, deleting the two assignments fails itDistributedInstalledSession+Execution.swift:7forwards toDistributedPipeExecutionOwner.projectFirstToken, which returned.unboundedfor every request ("no measured peer transfer/control envelope"), and the slot forwards it unchanged. The engine refuses an unbounded projection, so:7062b62664(in dev, and also in 0.10.11, whereDistributedCBv2Enginereports the prompt observation), once the bridge has measured the pair's prefill, every request carrying a first-content budget is refuseddeadline_unreachable, even a lone one. The coordinator sends that budget with every request. Within 30 minutes of the measurement, or while the Mac is busy, the rate stands. This is a static reading of the code, not yet confirmed in production data. A 0.10.11 hotfix would be this PR's owner change alone.behindPendingPrefill). A burst takes only the lanes whose first token meets its deadline; the rest are refused at once, so the coordinator sends them to another Mac.ClusterConfiguration.validaterefuses a saved Gemma or GLM tensor-parallel width (called from the codec). After a rollback to 0.10.11 such a pair's setup can't be read, and the update re-plan bails out atsavedConfiguration(). Run the setup again on that pair.523d44922b). On the red run the burst admitted all eight lanes, as expected. One more failure was the test's own: it dropped each admitted stream, and a stream nobody holds cancels its request. A cancelled request no longer delays the next one, so the fix could never have passed. The test now keeps the streams.Before
tensor-batch-scopequotes;ClusterConfiguration.validaterefused a Gemma tensor-parallelbatchLanesoutright.DistributedInstalledPlan.tensorParallelLaneAdapters[.gemma4LayerStage]is 1.max_concurrencywas 1, and through Darkbloom every request beyond the first was turned away as "at capacity".After
ClusterTensorParallelFamilyPlan.laneBytes, fromGemma4TensorParallelRequestBudget.laneBytes, the chargereserveLaneadmits every lane with.ClusterPlacementPolicy.tensorParallelLanesadds the lane charge for each lane after the first to every rank's native reservation (ClusterPlacementPlanner.tensorRequirement). LOAD holds that whole reservation while it reads the shard, so it is in the load peak too (round 2, P2-1).requireLanePricingrefuses a width for a family without a lane charge, or beside a native quote.ClusterPlacementTensorWidthsizes both kinds of owners through one loop:widthsdecides how the singleton's wider widths are priced (a Qwen row's native quotes, or a family's lane charge where nothing else priced it), andwidestsearches them. The placement chosen for one request keeps its leader and split, and the first admitted width (ClusterPlacementCandidate.admitted(requireNow: true)) is saved.qualifiedLanes).gemmaQualifiedLanes, 2 for the QAT 4-bit row (C1 qualified 2, 4 and 8; the owner chooses 2 or 4). The 8-bit rows: none.ClusterConfiguration.validateaccepts a Gemma tensor-parallel width of 2, 4, 6 or 8 with serial prefill (ClusterRuntimeAdapter.savesTensorParallelWidth).ClusterSetupPlanning.loads), both owners, the slot'smax_concurrencyand the leader's local API all read it throughDistributedInstalledPlan.batchLanes, unchanged.reservedBytes(lanes:), the allowance plus a lane charge for each lane after the first: the figure the planner priced.reserved=.flowchart LR subgraph Before A1["Gemma TP placement"] --> B1["no width saved: validate refuses one"] B1 --> C1["owner and worker: 1 lane"] C1 --> D1["screen: one at a time<br/>coordinator max_concurrency 1"] D1 --> E1["through Darkbloom: requests beyond one refused at capacity"] end subgraph After A2["Gemma TP placement"] --> B2["price 8, 6, 4, 2 lanes:<br/>allowance + (w-1) x lane charge per rank"] B2 -->|"widest both Macs admit now (cap: 2, QAT 4-bit)"| C2["setup saves width w"] B2 -->|"none fits"| C3["no width: 1 lane"] C2 --> D2["LOAD reserves allowance + (w-1) x lane charge"] D2 --> E2["owner, worker, screen, max_concurrency: w"] endflowchart TD subgraph "Code flow (after)" L["ClusterPlacementLayouts.layout<br/>Gemma4TensorParallelRequestBudget"] -->|"requestAllowance + laneBytes"| P["ClusterPlacementFlow.decide"] P --> W["ClusterPlacementTensorWidth.plan"] W -->|"Qwen rows: native quotes"| X["widest(...)"] W -->|"lane charge: tensorParallelLanes = w"| X X --> T["ClusterPlacementPlanner.tensorRequirement<br/>native floor + (w-1) x laneBytes"] X --> S["ClusterPlacementSetup: batchLanes = w"] S --> V["ClusterConfiguration.validate<br/>savesTensorParallelWidth"] V --> I["DistributedInstalledPlan.batchLanes = w"] I --> O["owner lease, DARKBLOOM_CLUSTER_BATCH_LANES, slot max_concurrency, ClusterSetupPlanning.loads"] I --> G["Gemma4TensorParallelResidentRuntime.load<br/>reservedBytes(lanes: w)"] endTests (red first)
729fb0b527(red, tests only, with dev's own APIs), then0092c1fed3(the change):0f11fbe01a(729fb0b527)0092c1fed3ClusterPlacementTensorWidthTests.aGemmaTensorParallelPlacementSavesTheWidestWidthItsLaneChargeAdmitsNowbatchLanes. No lane charge means no widthClusterPlacementTensorWidthTests.aGemmaTensorParallelPairServesTheWidthItsSetupSavedvalidaterefuses the saved width (the refusal the two CPU runners below show on the red commit)ConfigurationCheck(CPU runner, itsrun.shfixed to compile again)InstalledBatchLanesCheck(CPU runner)PlacementChecks(Gemma)PlacementChecks(Gemma, refactor pass4e7a1a6f03)Also local, with the change:
ClusterPlacementChecks/run.sh(274 passed),run-flow.sh(33 passed),ClusterInstalledSessionChecks/run.sh(passed),changelog check(68 valid),docs-impact-check(coverage OK),docs-check(only the 3 links into the uninitializedlibs/mlx-swift-lmsubmodule of my worktree).CI on
4e7a1a6f03(after the refactor pass): green (run 42707098361), as on0092c1fed3(run 42661043947). Every job passed, including the five Cluster Runtime Tests shards, both Provider Unit Tests shards, Cluster Release Build Checks, both Focused Checks shards (PlacementChecks,run-flow.sh) and the three non-blocking two-rank Cluster GPU Tests shards.Refactor pass (independent,
4e7a1a6f03)Behaviour unchanged; one signed commit.
ClusterPlacementTensorWidth: one function (widths) decides how a placement's wider widths are priced, andwidestonly searches them. Thesizesflag and the second guard inplanare gone.Gemma4TensorParallelRequestBudget.chargeBytes(lanes:)removed: it equalledreservedBytes(lanes:)at every width (the allowance isrequestBytesplusrankBytes). The prefix tier's room is now measured beside the figure LOAD reserved.PlacementChecks, above): one lane, the identity the prefix room relies on, 0 and 9 lanes, the lane charge's bounds.configuration.md's date follows its edit.PlacementChecks,ConfigurationCheck, andClusterPlacementTensorWidthTests' Gemma cases. The Gemma cases were run throughdecidein a scratch harness, since the provider test build is CI's.decide, the split is equal, Gemma has no native quote, and the sized plan's reasons equal the singleton's.DistributedInstalledPlan.batchLanes:ClusterSetupPlanning.loads,DistributedInstalledSession.concurrentRequests(the slot'smax_concurrency), the owner lease andDARKBLOOM_CLUSTER_BATCH_LANES.DARKBLOOM_CLUSTER_BATCH_LANESswitch. The screen does not read that switch, and set on one Mac only, the load agreement refuses it.dev.ClusterPlacementPipelineWidth.size(feat(cluster, provider): 0.10.13 — a Gemma 4 pipeline keeps the lookahead; a saved serial width is checked whole at load #1937) is the same search with a different hold (leader and serial prefill rather than ranks and split).widestneeds both PRs on one base. The PR that merges second resolves the same lines ofClusterPlacementFlow.decideanyway.Qualification on the M5 Ultra pair (window C1, 2026-11-10)
All six Gemma TP sessions passed (
C1WIN-1110T0113Z), pair-check with real weights, JACCL,encrypted_v1:aborted:memory:1on both ranks, the older lanes finished, the next request served), GH and GHL (eight 8K prompts at once), G1 (one lane): every lane's tokens equal its solo run, and its logprobs bit for bit where asked.reserved=28573303008on both ranks at 8 lanes; peak footprint 13.3 GiB against 7.49 + 26.61 GiB.rdma_en3,encrypted_v1;reserved=, and thedarkbloom-prefix-v1line'sroom_bytesmeasured beside it (the refactor pass's one runtime change: the prefix room now reads LOAD'sreservedfigure, the same number as before);laneBytesof about 2.64 GB (the checks use a stand-in allocator bound) and the guided plan saves 8 on the pair's own profiles;Limitations