Skip to content

feat(cluster, provider): 0.10.12 — GLM tensor parallel serves as many requests at once as both Macs admit - #1939

Closed
jonathan308 wants to merge 11 commits into
feat/gemma-tp-lanes-by-memoryfrom
feat/glm-tp-lanes-by-memory
Closed

jonathan308 wants to merge 11 commits into
feat/gemma-tp-lanes-by-memoryfrom
feat/glm-tp-lanes-by-memory

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

For 0.10.12. Third step of the concurrency work: every pair option serves several requests at once, sized by both Macs' memory. Plan: CONCURRENCY-PLAN.md §2.4. Draft. C1 ran on the M5 Ultra pair on 2026-11-10 (GLM at 6, then at 8, passed; the first 8-lane attempt was refused at Mac A's LOAD gate), and the independent review's two changes are in (round 2, below).

Status (2026-11-10, review round 2)

  • Head 0d6a80d09d. CI (dev) green (run 42759678191).
  • feat(cluster, provider): 0.10.12 — Gemma 4 tensor parallel serves as many requests at once as both Macs admit #1936's round 2 merged in: a60a546e90 (signed; resolutions in its message). The planner's load peak takes the review's form here, nativeFloor + laneGrowth, since this branch keeps the growth outside the one-request floor; the automatic merge had kept nativeFloor alone, which would have dropped Gemma's lane charges 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 test and the setup checks' GLM pair).
  • Red first: 311ead33cd. Its CI run (42748367274) failed exactly there ("GLM LOAD width: that sample loads at six lanes … (nil)"), and the new Cluster Runtime test passed. Then ed36754ff3 (the fix): CI green (42752002374), the GLM runtime's LOAD change compiled in the Cluster Runtime build.
  • Review-only refactor pass (an independent agent that read the round's diffs and edited nothing; 5f150f8c82 merges feat(cluster, provider): 0.10.12 — Gemma 4 tensor parallel serves as many requests at once as both Macs admit #1936's part, 0d6a80d09d takes this PR's): one formula for a tensor-parallel gate's requirement (QwenDenseStageLoadPolicy.tensorParallelRequiredBytes), shared by lanesAdmitted and the gate, so the first look and the gate cannot drift; the retry's comment says why the gate may refuse a width its first look admitted; the check takes the loading headroom from the policy; one lane needs 147.8 GiB with the headroom. It found the LOAD retry sound, the merge's planner line correct and no compile risk.
Review item What changed Evidence
P1-1 the registered GLM row's lane charge had no CI protection GLM5NextNativeContextTests.theRegisteredRowStatesItsLaneCharge (blocking Cluster Runtime Tests). It reads the registered config.json the worker's capability checks keep (pinned SHA-256), builds GLM5NextPlacementFamily, and requires its laneBytes to equal tensorParallelLaneBytes at MLX's allocation bounds, within 9.6–10 GB. Dropping laneBytes: from the family, or a plan that does not forward it, fails it passes in CI (theRegisteredRowStatesItsLaneCharge() passed after 0.611 seconds, on the red run too: it protects existing behaviour)
P2-3 LOAD gated the whole saved width; tonight GLM at 8 didn't load on Mac A The fallback, not option (b) (below): GLM's LOAD reserves the widest width memory admits now, from the saved width down to one lane, and never refuses a load one lane fits PlacementChecks rebuilds tonight's sample (admissible within 1 MB of Mac A's refusal) and the 8-lane requirement byte for byte (226,675,370,385 with the headroom). It refuses 8, as Mac A did, and must load at 6 (red: nil; green: 6). An idle 256 GB Mac still reserves 8; an idle 128 GB Mac, which one lane doesn't fit, is still refused
P3 downgrade Below, for the release runbook —
  • Why not (b). (b) makes the width that loaded the pair's advertised width. The slot's max_concurrency comes from the saved plan (DistributedInstalledSession.concurrentRequests, plan.batchLanes()) before the workers load, and READY carries no lane count. So (b) needs the ranks to agree on a width before the load agreement, READY to carry it, and the provider to register the slot from it. That is more than a small, versioned addition to the load agreement, so per the instructions it is not built.
  • The fallback built instead (ed36754ff3):
    • On the gate's sample, QwenDenseStageLoadPolicy.lanesAdmitted finds the widest width, from the saved one down to one lane, that the gate admits. LOAD reserves it, and the real gate checks it. If the real gate then refuses a width wider than one (the sample moved between the two looks), LOAD asks for one lane.
    • The load line adds reserved_lanes=, and a stderr line says when it is narrower: "GLM tensor-parallel LOAD reserves 6 of its 8 lanes: the memory gate admits no more now; each further lane is admitted as it comes, or refused alone".
    • The pair still serves and advertises the saved width, and both ranks bind it into their load agreement unchanged. Each lane beyond the reserved width is admitted by its own live gate (reserveLane) or refused alone, retryably, as every lane was before this PR.
    • This sits between the review's minimal alternative (reserve one lane, as 0.10.11 did) and (b): where memory allows, the whole width is still reserved at LOAD.
  • Downgrade (release runbook). 0.10.11's ClusterConfiguration.validate refuses 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 at savedConfiguration(). Run the setup again on that pair.

Stacked on #1936 (Gemma 4 tensor parallel sized by memory), whose width mechanism it reuses. Its base is feat/gemma-tp-lanes-by-memory; it is retargeted to dev once #1936 merges.

Before

  • GLM-5.3-Flash in tensor parallel served a fixed eight lanes on any pair.
    • DistributedInstalledPlan.tensorParallelLaneAdapters[.glm5NextLayerStage] was tensorParallelBatchLanes, 8, whatever the Macs held.
    • Its LOAD reserved one request (requestReserve). Each further lane was admitted against live memory when it came.
    • Guided placement saved no width: ClusterConfiguration.validate refused a GLM tensor-parallel batchLanes.
  • So the setup screen and the coordinator's max_concurrency said 8, even on a pair whose memory holds fewer. The lanes it could not hold were refused one by one when they arrived (through Darkbloom: "at capacity").

After

  • A GLM tensor-parallel placement saves the widest of 8, 6, 4 and 2 lanes both Macs admit now, the way feat(cluster, provider): 0.10.12 — Gemma 4 tensor parallel serves as many requests at once as both Macs admit #1936 sizes Gemma 4. Where none fits, it saves no width and serves one request at a time.
    • The lane charge (GLM5NextTensorParallelRequestCharge.laneBytes) is an upper bound on what reserveLane asks for one more lane beside those held, at the memory plan's request (65,536 tokens):
      • the lane's state (laneStateBytes: KDA recurrent and convolution state, NextN verification windows);
      • its DSA and NextN history pages, three times: the pages, and the page pool's growth copy (old and new slabs coexist while a lane's pages are added);
      • a sliced prompt frame's held arrays (prefillFrontierBytes).
      • Pages are priced at FP32 rows, as LOAD prices them before the pool exists.
      • On the registered row that is about 9.7 GB: state 1.09 GB, pages 2.42 GB × 3, frame 1.34 GB (from the real config.json, the allocator rounded to 16 KiB pages).
    • The layout states it. GLM5NextPlacementFamily writes it into ClusterTensorParallelFamilyPlan.laneBytes, with the allocator bound its NextN head already uses.
    • Validation. A lane charge no longer needs a request allowance: GLM states none (the plan prices one request from the layout's state). It must be 1 byte to a worker's capacity, and within the allowance's request part where one is stated (Gemma).
    • The planner. Each lane after the first is added on top of what one request is priced at: the allowance, or the layout's state where the family states none (ClusterPlacementPlanner.tensorRequirement).
      • Gemma 4's numbers are unchanged: all 1,653 earlier PlacementChecks lines are identical, byte figures included.
    • The cap. savesTensorParallelWidth includes GLM, so qualifiedLanes is 8: what GLM served before, provisional until the M5 Ultra pair qualifies it (C1).
  • LOAD reserves the width, as far as memory then allows (round 2, P2-3). Each rank's gate admits reservedBytes(contextTokens:lanes:): one request's charge and a lane charge for each lane after the first, the figure the plan priced. Where it admits fewer lanes now, LOAD reserves the widest width it admits, never fewer than one lane. The load line reports reserved= and reserved_lanes=. Each lane is still admitted against live memory, and one the host can't hold is refused alone.
  • One number. ClusterConfiguration.validate accepts a GLM tensor-parallel width of 2, 4, 6 or 8 with serial prefill. The setup screen, both owners, the slot's max_concurrency and the local API read it through DistributedInstalledPlan.batchLanes, unchanged.
  • Without a saved width, one request at a time, as every other tensor-parallel family. tensorParallelBatchLanes is gone, DistributedInstalledPlan.tensorParallelLaneAdapters is a set, and one predicate (servesTensorParallelLanes) decides both a tensor-parallel pair's default and whether its lanes retire alone.
    • Existing pairs: after the Darkbloom update the control leader plans each pair again by itself (ClusterOnboardingUpdate), which saves its width then.
  • The M5 Ultra pair (recorded profile, PlacementChecks and PlacementSetupCheck): one request needs 154.7 GB a rank, eight lanes 222.6 GB, of 234.4 GB admissible now. So it keeps eight.
    • The D6 window's real GLM TP load line today sums to 154.4 GB for one request (shard 88.70, NextN 4.18, vision 1.13, request 56.12, buffer cache 4.29), within the plan's 154.7.
  • Unchanged:
  • One behaviour to note: a GLM pair whose Macs hold fewer than eight now says, and serves, fewer. A pair with no room for a second request serves one at a time (before: told eight, then refused lanes when they came).
flowchart LR
  subgraph Before
    A1["GLM TP placement"] --> B1["no width saved: validate refuses one"]
    B1 --> C1["owner and worker: fixed 8 lanes"]
    C1 --> D1["LOAD reserves one request"]
    D1 --> E1["screen and coordinator: up to 8<br/>whatever memory holds"]
    E1 --> F1["lanes memory can't hold:<br/>refused when they arrive"]
  end
  subgraph After
    A2["GLM TP placement"] --> B2["price 8, 6, 4, 2 lanes:<br/>one request + (w-1) x lane charge per rank"]
    B2 -->|"widest both Macs admit now (cap: 8, provisional)"| C2["setup saves width w"]
    B2 -->|"none fits"| C3["no width: 1 lane"]
    C2 --> D2["LOAD reserves one request + (r-1) x lane charge,<br/>r = widest of w..1 memory admits now"]
    D2 --> E2["owner, worker, screen, max_concurrency: w<br/>lanes past r admitted live"]
  end
Loading
flowchart TD
  subgraph "Code flow (after)"
    F["GLM5NextPlacementFamily<br/>tensorParallelLaneBytes"] -->|"laneBytes, no allowance"| P["ClusterPlacementFlow.decide"]
    P --> W["ClusterPlacementTensorWidth.plan<br/>qualifiedLanes = 8"]
    W -->|"tensorParallelLanes = w"| T["ClusterPlacementPlanner.tensorRequirement<br/>max(state, floor) + (w-1) x laneBytes"]
    W --> 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["GLM5NextTensorParallelResidentRuntime.load<br/>requestCharge.reservedBytes(contextTokens:lanes: w)"]
  end
Loading

Tests (red first)

8afb8d66a8 (red, tests only, with #1936's own APIs), then 6067d0001a (the change) and 1759d4b042 (an older width test still pinned GLM's fixed eight: the first CI run's one issue):

Check What it proves On #1936's 0092c1fed3 (8afb8d66a8) After 1759d4b042
PlacementSetupCheck.glmTensorParallelPair (CPU runner) GLM's golden layout with a stated lane charge, through the guided step on the recorded M5 Ultra pair: both setups save 8, each lane after the first adding it to every rank's need. Without one, no width fails locally: "glm pair: a layout that states GLM's lane charge is read" passes locally: 277
ConfigurationCheck (CPU runner) A GLM TP setup keeps 2/4/6/8 with serial prefill fails locally: "A planned batch width requires a supported pipeline or tensor-parallel width with serial prefill" passes locally: 14 groups
InstalledBatchLanesCheck (CPU runner) A GLM TP setup serves one request without a width; its saved 2/4/6/8 reaches its owner lease, its actual owner child and the rank; a malformed override at 8 falls back to one fails locally: "GLM tensor parallel served lanes without a saved width" passes locally
ClusterPlacementTensorWidthTests.aGLMTensorParallelPlacementSavesTheWidestWidthItsLaneChargeAdmitsNow A GLM row (lane charge, no allowance) saves 8, 6, 4, 2 or none as free memory falls; each rank's need grows by exactly one lane charge a lane; the smaller Mac decides; the screen says that number red by construction (the layout's lane charge is refused without an allowance) passes in CI (Provider Unit Tests)
DistributedInstalledLanesTests.glmTensorParallelServesItsSavedWidth, DistributedInstalledCancellationTests GLM TP defaults to one lane, saves a width, and its lanes retire alone red by construction (default 8, no saved width) passes in CI (Provider Unit Tests); otherFamiliesAndUnsizedSetupsKeepTheirLanes now pins the unsized default at one
GLM5NextNativeContextTests.aSavedWidthIsReservedAtLoadAsThePlanPricesIt (added with the change: it calls its API) The lane charge is the state, three times the pages and the frame; contiguous histories have no pages; LOAD reserves one request and a lane charge per further lane, at the rank's own geometry, 1...8 lanes — passes in CI (Cluster Runtime Tests)
PlacementChecks GLM (10 checks, added with the change) A lane charge without an allowance validates; 0 or past capacity is refused; one request plans byte for byte as before; at 2/4/6/8 lanes each rank's request need, need and GPU-resident bytes grow by exactly the lane charges; the recorded M5 Ultras hold 8, Macs capped between 4 and 6 lanes hold 4; the retained layout prices no width — passes locally and in CI (Focused Checks): 1,663, every earlier line identical

Also local, with the change: run-flow.sh (33 passed), ClusterConsoleChecks (79,396 expectations), ClusterInstalledSessionChecks (passed), changelog check (69 valid), docs-impact-check (coverage OK), docs-check (only paths my sparse worktree leaves out: docs/reports/, landing/, the libs/mlx-swift-lm submodule).

CI on d6369b5049: green (run 42728914739): every job, Provider Unit Tests and the GLM runtime tests included, after the refactor pass and the merge of #1936's 4e7a1a6f03. Before it, CI on 1759d4b042: green (run 42676090227): all 25 checks, including the five Cluster Runtime Tests shards, both Provider Unit Tests shards, Cluster Release Build Checks, both Focused Checks shards and the three non-blocking two-rank Cluster GPU Tests shards. The first run, on 6067d0001a, failed one provider test that still pinned GLM's old eight (fixed in 1759d4b042).

Inside the non-blocking GPU shards, nine GPU tests fail on #1936's head too, with the same issue counts (run 42661043947): Qwen TP batch MTP windows (wideKernelRowsEqualEachRowsOwnWindowCall, wideKernelVariantThroughput), fused gated-delta and RMS-norm kernels, the CPU-stream sums, and fullHistoryGatherIsOnePromptFramesTransient. None comes from this change; the jobs pass because they are non-blocking.

Refactor pass (independent, bad81ce7b4..d6369b5049)

Behaviour unchanged. Signed commits, with #1936's new head merged in (bad81ce7b4, no conflict):

  • 169734fda0, the tensor-parallel lane families: tensorParallelLaneAdapters became a set (with GLM's fixed eight gone every value was defaultBatchLanes), and servesTensorParallelLanes is the one predicate behind a tensor-parallel pair's default and its lanes retiring alone.
  • 169734fda0, GLM's lane charge: GLM5NextTensorParallelRequestCharge.laneBytes re-derived the history length and the paged-history bytes. It now shares static historyTokens and pagedHistoryBytes with the request charge and reserveLane, so the page arithmetic lives in one place.
  • 169734fda0, smaller cleanups:
    • GLM5NextPlacementFamily.tensorParallelPlan lost a default no caller used.
    • The lane-charge test helpers serve GLM as well as Gemma, so they are named for what they do.
  • d6369b5049: one of those renames collided with the Qwen cases' savedLanes, and CI's provider test build refused it (run 42717960634, the only failure). The helper is now savedAndScreenLanes.
  • Mutants: 10 on GLM's planner growth, the lane charge's bounds, the setup's GLM width and the installed GLM lanes. All 10 are killed by PlacementChecks, ConfigurationCheck and InstalledBatchLanesCheck. They include the growth hidden under the state estimate, which is what moving laneGrowth out of max fixed. The shared width search's mutants were run on feat(cluster, provider): 0.10.12 — Gemma 4 tensor parallel serves as many requests at once as both Macs admit #1936 (its body), and the GLM cases pass in the same scratch harness through decide.
  • Screen, workers and coordinator: they read DistributedInstalledPlan.batchLanes, as for Gemma (feat(cluster, provider): 0.10.12 — Gemma 4 tensor parallel serves as many requests at once as both Macs admit #1936's body).
  • Checked, true:
    • A GLM pair set up before the update is planned again by itself (ClusterService.checkForUpdate → replanAfterUpdate, coordinator pairs included).
    • After a Darkbloom update the old setup's pinned worker digest no longer starts, so no updated pair keeps serving one request with a pre-update setup.
  • Not covered by CI: the GLM layout's lane charge from the real artifact. The premise was wrong: the registered config.json is checked in as CapabilityChecks/Fixtures/registered-glm53-flash.configuration.json. Round 2 adds the blocking test (P1-1, top).

Qualification on the M5 Ultra pair (window C1, 2026-11-10)

  • C1WIN-1110T0113Z: L1 (one lane) passed (reserved=56124572169). LW, LWL and LF (8 lanes) were refused at Mac A's LOAD gate: 211.10 GiB needed against 200.19 GiB admissible, with 38.68 GiB of other programs' memory in use. That is P2-3, fixed above.
  • C1WIN-1110T0148Z: LW6, LWL6 and LF6 (6 lanes) passed: every lane's tokens equal its solo run, the logprob waves bit for bit, the fault run's newest lane aborted alone.
  • C1WIN-1110T0156Z: LW at 8 lanes passed once memory allowed: waves 1/2/4/8, every lane's tokens equal its solo run; aggregate 105.4 / 111.5 / 99.8 / 88.9 tok/s at 1 / 2 / 4 / 8.
  • The plan for C1, as requested, was:
  • pair-check with real weights, JACCL over rdma_en3, encrypted_v1, at the width the setup saves (8 expected);
  • solo runs, then waves of 1, 2, 4 and 8 lanes, with staggered joins and a mid-batch cancel;
  • tokens of every lane equal to its solo run, and logprobs bitwise through the pair-check tooling PR;
  • no hang, and both ranks exit 0;
  • each rank's load line reserved=, and its memory peak within it;
  • the layout from the real artifact (darkbloom-cluster-plan layout --model-dir … on either Mac, CPU only) states laneBytes of about 9.7 GB, and the guided plan on the pair's own profiles saves 8;
  • the aggregate throughput gain, and a lone request's cost at lanes 8 against lanes 1.

Limitations

  • The cap stays eight (C1 gave every lane its solo tokens at 6 and 8). Above two lanes the aggregate falls (C1: 111.5 tok/s at 2, 88.9 at 8).
  • The pair advertises the saved width even when LOAD reserved fewer lanes (P2-3's fallback). Lanes past the reserved width are admitted live and refused alone when memory is short.
  • The lane charge is priced at the memory plan's request (65,536 tokens). A longer request is charged at its own context when reserved, as today, and refused alone if it doesn't fit.
  • Pages are priced at FP32 rows. The real pool's pages are about half that (98,368 bytes a 64-token page on the D6 load line), so the charge is about 3.6 GB a lane above what the pool holds. On a tight pair that can cost one width step; it keeps eight on the M5 Ultra pair.
  • A width is sized once, when the pair is planned (setup, an update's re-plan, a model change).
    • Before, GLM admitted up to eight lanes live on any pair.
    • Now a pair planned while its Macs held little free memory keeps that width until it is planned again. Automatic replacement never widens GLM, and a coordinator pair never widens.
  • The refactor pass is done (above), and so is the independent review (round 2, top).

jonathan308 and others added 2 commits November 9, 2026 09:56
…s admit, and one without it (red)

Red first for 0.10.12's third concurrency step, stacked on #1936 (the
Gemma TP width), whose sizing it reuses. GLM-5.3-Flash tensor parallel
serves a fixed eight lanes on any pair: `tensorParallelLaneAdapters`
names 8 whatever the Macs' memory, its LOAD reserves one request, and
`ClusterConfiguration.validate` refuses a GLM tensor-parallel width.
So the coordinator is told eight on a pair whose memory may hold fewer,
and a pair that holds one request is told eight too.

These checks state the behaviour wanted, with #1936's APIs:

- PlacementSetupCheck.glmTensorParallelPair (CPU runner): GLM's golden
  layout with a lane charge stated as the plan tool will state it (9 GiB
  standing in), through the guided step on the recorded M5 Ultra pair:
  both setups save the widest width both Macs admit now (8 there), each
  lane after the first adding it to every rank's need. The golden layout
  without one still saves none.
- ClusterPlacementTensorWidthTests: a GLM row whose family states a lane
  charge and no allowance saves 8, 6, 4, 2 or none as free memory falls,
  the smaller Mac decides, and the setup screen says that number or one.
- ConfigurationCheck: a GLM TP setup keeps 2, 4, 6 or 8 with serial
  prefill.
- InstalledBatchLanesCheck, DistributedInstalledLanesTests,
  DistributedInstalledCancellationTests: a GLM TP setup serves its saved
  width on its owner, its owner child and the rank, and one request at a
  time without one.

On #1936's head 0092c1f each fails: the layout's lane charge is
refused without an allowance, the width is refused at validation, and
GLM serves eight without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… requests at once as both Macs admit

GLM-5.3-Flash tensor parallel served a fixed eight lanes on any pair: its
LOAD reserved one request and the coordinator was told eight, whatever
the Macs held. It now saves a width at placement, sized by both Macs'
memory and reserved at LOAD, through #1936's mechanism:

- GLM's lane charge (`GLM5NextTensorParallelRequestCharge.laneBytes`):
  an upper bound on what `reserveLane` asks for one more lane beside
  the others at the memory plan's request: the lane's state, its DSA and
  NextN history pages three times (the pages, and the page pool's growth
  copy: old and new slabs coexist while a lane's pages are added) and a
  sliced prompt frame's held arrays. Pages at FP32 rows, as LOAD prices
  them before the pool exists. About 9.7 GB on the registered row.
- `GLM5NextPlacementFamily` states it in the layout
  (`ClusterTensorParallelFamilyPlan.laneBytes`), with the allocator bound
  its NextN head uses.
- Validation accepts a lane charge without a request allowance (1 byte to
  a worker's capacity, and within the allowance's request part where one
  is stated). The planner adds each lane after the first on top of what
  one request is priced at (the allowance, or the layout's state where
  the family states none): Gemma 4's numbers are unchanged, every
  PlacementChecks line byte for byte.
- `savesTensorParallelWidth` includes GLM, so the guided setup tries 8, 6,
  4 and 2 and saves the widest both Macs admit now (capped at 8 until the
  M5 Ultra pair qualifies it), and `ClusterConfiguration.validate`
  accepts it.
- LOAD reserves `reservedBytes(contextTokens:lanes:)`: one request's
  charge and a lane charge for each lane after the first, the figure the
  plan priced; the load line reports it (`reserved=`).
- Without a saved width GLM serves one request at a time, as every other
  tensor-parallel family (`tensorParallelBatchLanes` is gone). After the
  Darkbloom update the control leader plans each pair again by itself
  (`ClusterOnboardingUpdate`), which saves its width.

On the recorded M5 Ultra 256 GB pair one request needs 154.7 GB a rank
and eight lanes 222.6 GB of 234.4 GB admissible now, so it keeps eight;
the D6 window's load line (shard, NextN, vision, one request, buffer
cache) sums to 154.4 GB, within the plan.

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

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Nov 10, 2026 5:04am UTC
darkbloom-status Ready Ready Preview Nov 10, 2026 5:04am UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 10, 2026 5:04am UTC

Request Review

…st in the width tests too

`ClusterPlacementTensorWidthTests.otherFamiliesAndUnsizedSetupsKeepTheirLanes`
still pinned GLM tensor parallel's old fixed eight
(Provider Unit Tests, shard 1, on 6067d00: the run's one issue). A GLM
setup saved without a width now serves one request at a time, as a Qwen
TP one does; its saved width is pinned by the GLM width test beside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 and others added 2 commits November 9, 2026 13:55
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>
…families; GLM's lane charge reuses LOAD's page arithmetic

Refactor pass on the GLM tensor-parallel width (behaviour unchanged):

- DistributedInstalledPlan.tensorParallelLaneAdapters is a set: with GLM's
  fixed eight gone, every value was `defaultBatchLanes`. One predicate,
  `servesTensorParallelLanes` (GLM, Gemma 4 and a Qwen TP row without
  private images), now decides both a tensor-parallel pair's default and
  whether its lanes retire alone, which had each spelled it out.
- GLM5NextTensorParallelRequestCharge.laneBytes (the planner's and LOAD's
  lane charge) re-derived the history length and the paged-history bytes
  that `historyTokens` and `pagedHistoryBytes` already compute for a
  request. Both now have a static form that the lane charge, the request
  charge and `reserveLane` share, so the page arithmetic lives in one place.
- GLM5NextPlacementFamily.tensorParallelPlan takes the lane charge without
  a default: its one caller always states it.
- ClusterPlacementTensorWidthTests: the lane-charge helpers serve GLM as
  well as Gemma, so they are named for what they do (`laneChargeFixture`,
  `decideLaneCharged`, `savedLanes`).

Mutants of the planner's GLM growth (request need, GPU-resident bytes, the
growth hidden under the state estimate), the lane charge's bounds, the
setup's GLM width and the installed GLM lanes are killed by PlacementChecks,
ConfigurationCheck and InstalledBatchLanesCheck.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The refactor pass renamed the lane-charge helper that returns what both
Macs saved and what the setup screen says to `savedLanes`, which the Qwen
width cases already name (one saved width): CI's provider test build
refused the ambiguous call. It is `savedAndScreenLanes`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 and others added 2 commits November 9, 2026 19:10
#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>
…loads a width one lane fits (red)

Red first for the independent review of C1 (P1-1, P2-3):

- P1-1. `theRegisteredRowStatesItsLaneCharge` (Cluster Runtime Tests,
  blocking): the GLM placement family built from the registered
  config.json the worker's capability checks keep (its pinned SHA-256)
  states a lane charge equal to `tensorParallelLaneBytes` at the memory
  plan's request and MLX's allocation bounds, 9.6-10 GB (9,700,905,472
  bytes before allocator rounding). Dropping `laneBytes:` from the family,
  or a plan that does not forward it, fails it; until now only stand-in
  charges grafted into the golden layout were checked. It passes on this
  commit; it is not a red test.
- P2-3. Tonight GLM at 8 lanes did not load on Mac A: 38.68 GiB of other
  programs' memory in use, 200.19 GiB admissible against the 211.10 GiB an
  8-lane LOAD asks for, although one lane needs 143.8 GiB. PlacementChecks
  rebuilds that sample (admissible within 1 MB of the refusal's) and the
  8-lane requirement byte for byte (226,675,370,385 with the headroom):
  - it refuses eight lanes, as Mac A did;
  - it must load at six, the widest width it admits (193.03 GiB);
  - an idle 256 GB Mac reserves all eight; an idle 128 GB Mac, which one
    lane does not fit, is refused.
  The width LOAD reserves is now one function of the gate's policy,
  `QwenDenseStageLoadPolicy.lanesAdmitted`, with today's rule: the saved
  width or nothing. The runtime does not call it yet.

PlacementChecks: 1 failed (six lanes: nil), 1,669 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er refusing a load one lane fits (review P2-3)

Tonight an 8-lane GLM pair did not load on Mac A: its LOAD gated the whole
saved width (211.10 GiB) against 200.19 GiB admissible, with 38.68 GiB of
other programs' memory in use, although one lane needs 143.8 GiB. The memory
re-plan narrows only after two refusals, at most every 10 minutes, and
nothing widens it again.

The saved width is now a ceiling for GLM's LOAD. On the gate's sample,
`QwenDenseStageLoadPolicy.lanesAdmitted` finds the widest width from the
saved one down to one lane that the gate admits; LOAD reserves that width
(the load line's `reserved_lanes=`, and a line saying so when it is
narrower) and the real gate checks it. If the real gate then refuses a width
wider than one, LOAD asks for one lane, so a load one lane fits is never
refused. Each lane beyond the reserved width is admitted as it comes by the
lane's own live gate, or refused alone, as before this width existed.

Not done: the review's preferred option (b), where the width that loaded
becomes the pair's advertised width. The slot's `max_concurrency` comes from
the saved plan before the workers load, and READY carries no lane count, so
(b) needs the ranks to agree on a width before the load agreement, READY to
carry it, and the provider to register the slot from it: more than a small
addition to the agreement. The pair still serves and advertises the saved
width, and both ranks bind it into their load agreement unchanged.

PlacementChecks: 1,670 passed (tonight's sample now loads at six; an idle
256 GB Mac reserves eight; an idle 128 GB Mac is still refused). The runtime
change runs in CI's Cluster Runtime build only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 and others added 2 commits November 9, 2026 20:50
…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>
From the review-only refactor pass over this round (it found the LOAD
retry sound, the merge's planner line correct and no compile risk):
- One formula for a tensor-parallel gate's requirement,
  `QwenDenseStageLoadPolicy.tensorParallelRequiredBytes` (the bytes and the
  loading headroom, never below the floor): `lanesAdmitted` and
  `ClusterLiveMemory.requireTensorParallel` both call it, so the first look
  and the gate cannot drift apart.
- The retry's comment says why the gate may refuse a width its first look
  admitted (a later sample, or the compression it measures from its own
  first one).
- The LOAD width check takes the loading headroom from the gate's policy
  instead of a literal 4 GiB, and says one lane needs 147.8 GiB with it
  (143.8 without, beside 211.10 and 193.03, which include it).
- `checkGLMCoverage` gets back its doc comment, which the new check had
  taken; no review or PR labels in files.

Not taken: replacing the registered row test's `lane == expected` (the
requirement and the range carry it), and re-trying one width narrower before
one lane.

PlacementChecks 1,670, placement setup, ProcessChecks and the scratch width
tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonathan308
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 0d6a80d)

# Conflicts:
#	libs/darkbloom-cluster/Sources/DarkbloomClusterRuntime/Support/ClusterMemoryFault.swift
jonathan308 added a commit that referenced this pull request Nov 10, 2026
… (0.10.12 candidate; head 022696b)

The reviewed resolution (review-c1 delta, scratch 0451645399: planner both gates; flow TP
qualified cap + pipeline size; plan #1939's Set, no Gemma default; test.md both), plus
D6's inference.md sentence on serial lanes (REVIEW-1937-merge.md).
@jonathan308

Copy link
Copy Markdown
Collaborator Author

Closing: this branch's head (0d6a80d) is already contained in dev.

@jonathan308 jonathan308 closed this Dec 2, 2026

This branch was successfully deployed

3 active deployments
Preview – eigen-homepages-darkbloom — 0d6a80d0 Deployed Nov 10, 2026 by vercel[bot]
Preview – d-inference-landing — 0d6a80d0 Deployed Nov 10, 2026 by vercel[bot]
Preview – darkbloom-status — 0d6a80d0 Deployed Nov 10, 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