diff --git a/changelog.d/cluster-follow-final-outcome.md b/changelog.d/cluster-follow-final-outcome.md new file mode 100644 index 0000000000..57a69f5c0e --- /dev/null +++ b/changelog.d/cluster-follow-final-outcome.md @@ -0,0 +1,14 @@ +### The joining Mac ends with the leading Mac's outcome + +- While the pair is offered to Darkbloom and waits for Apple's verification or for the coordinator, the joining Mac now + keeps waiting. It shows a live row such as "Waiting for Apple to verify this Mac (Darkbloom retries by itself) · 2 of + 15 min". Before, it judged the pair by its own wait: on a real pair it ended with "✗ Not serving: This Mac isn't + verified by Apple yet …" while the leading Mac showed "✓ Serving … through Darkbloom on both Macs" 41 s later. +- Its last word is the leading Mac's: the same ✓, or the same ✗ with its next step. When the leading Mac's start + ends with ✗ on its screen, it publishes that ✗ in its status, and the joining Mac shows it named from its own side + ("This Mac isn't logged in to Darkbloom …"). +- "Choose Retry on the other Mac" appears only under that ✗, since the leading Mac's screen then shows Retry. It is no + longer said while a part restarts by itself. +- With a leading Mac on an earlier release, which publishes no outcome, the joining Mac waits until the stage's + 15 minutes run out. It then ends with "✗ Not serving: The other Mac (…) didn't say how its start ended within + 15 minutes.", the last state it saw, and where to look. diff --git a/changelog.d/cluster-mode-question-and-local-network-row.md b/changelog.d/cluster-mode-question-and-local-network-row.md index b0e436d81f..a8b8058395 100644 --- a/changelog.d/cluster-mode-question-and-local-network-row.md +++ b/changelog.d/cluster-mode-question-and-local-network-row.md @@ -4,9 +4,17 @@ that plan. Before, with nothing serving, GLM-5.3-Flash's pipeline was offered as "this Mac 1 layer / the other Mac 44 layers" and loaded as 44 / 1. A way chosen on the Mac that joined now loads too; before, the leading Mac loaded its own first choice. +- Two Macs of the same hardware (chip, GPU cores and macOS build) are planned at the same speed until the pair has + served the model. Before, each Mac's own one-second speed sample decided, and a sample 0.1% slower (taken just after + another app's pair stopped) offered GLM-5.3-Flash's pipeline as "1 layer / 44 layers" on two M5 Ultras, where 24 / + 21 is the split once the pair has served. - Each way also says how many requests it serves at once: "serves one request at a time" for GLM-5.3-Flash's pipeline, "serves up to 8 requests at once" for its tensor parallel. On a GLM-5.3-Flash pair, choose tensor parallel: through Darkbloom its pipeline turns every other request away as "at capacity". +- Each way's line fits the window as it is now, and the list draws again when the window is resized. Before, a line + was cut at the width the window had when the question opened, such as "… the other Mac 44 layers) · ser…" at 120 + columns, and it stayed cut after widening. A line that's too wide drops the split first, then what each Mac does. + The way's name and how many requests it serves at once always stay. - The Local Network hints on the setup screens, in `status` and `cluster status`, and in the log of the process that dials the other Mac name the row System Settings shows, "Darkbloom". The DevNet app's row has that name too, since both apps share one bundle ID. Where macOS never recorded an answer for the app and lists no row, the hints say to diff --git a/changelog.d/cluster-pair-version-split-follows-forward.md b/changelog.d/cluster-pair-version-split-follows-forward.md new file mode 100644 index 0000000000..c288422609 --- /dev/null +++ b/changelog.d/cluster-pair-version-split-follows-forward.md @@ -0,0 +1,6 @@ +### Two-Mac pairs: the Macs no longer stay on different versions + +- **Pair owners, for this update:** run `darkbloom update` on **both** Macs, then check that `darkbloom --version` shows the same version on both. If either Mac ever ran a plain `darkbloom start` before 0.10.8, run `darkbloom stop --solo` on that Mac first. +- When one Mac of a `darkbloom cluster` pair already runs a newer release, or is updating to one, the other Mac's cluster service notices within a minute and updates right away, instead of waiting for the pair's next update slot. This covers a Mac that updated alone (single-Mac serving or `darkbloom update`), or a Mac that was asleep at the slot. Each newer release gets one immediate try; after that the Mac tries again at the update slots as before. A release quarantined on that Mac is never installed this way. With automatic updates off, the log says which version the other Mac runs and to run `darkbloom update` on this Mac. +- The provider's background updater no longer leaves a pair split: when it updates a Mac whose pair runs there, it asks the cluster service to restart into the release together with the other Mac. The watchdog doesn't install a release while the pair runs on that Mac. A Mac that only serves alone, its pair gone, simply updates. +- When the two Macs run different versions, both screens say so at once: "The two Macs run different Darkbloom versions: the other Mac (…) runs 0.10.7, this Mac runs 0.10.8", with the Mac to run `darkbloom update` on. The start no longer loops: it offers to check the versions again, and a Retry checks them first. `darkbloom status`, `darkbloom cluster status --json` (`reason` and `next`) and the cluster service's wait lines also name the other Mac's version and the command. The version split is shown before single-Mac serving when both apply. DevNet builds say `darkbloom-dev`. diff --git a/changelog.d/cluster-solo-block-both-screens.md b/changelog.d/cluster-solo-block-both-screens.md new file mode 100644 index 0000000000..9b2c0f9a3b --- /dev/null +++ b/changelog.d/cluster-solo-block-both-screens.md @@ -0,0 +1,6 @@ +### Both Macs say when single-Mac serving blocks the pair + +- The Mac that joined now shows the same ✗ as the leading Mac when single-Mac serving blocks the pair. The ✗ names its own single-Mac provider and process, and gives `darkbloom stop --solo`. It also says that the leading Mac's screen offers to stop it and start the pair. Before, that window said "registering with the coordinator" for minutes. Once single-Mac serving stops, it follows the start by itself. +- Each Mac reports single-Mac serving as soon as it runs, not only once the pair wants to start. So the leading Mac sees it before anything starts. +- The leading Mac's part no longer starts and ends every 38 seconds while the other Mac reports single-Mac serving. It waits until that changes. The same rule covers any reason the other Mac reports that its part can't start. +- In `darkbloom cluster status`, `Next:` now says what to run on both Macs instead of "Both Macs keep trying by themselves". A `darkbloom start` run from a script ends its wait at once for this reason. diff --git a/changelog.d/cluster-solo-steps-aside.md b/changelog.d/cluster-solo-steps-aside.md new file mode 100644 index 0000000000..cd3d3ae7f6 --- /dev/null +++ b/changelog.d/cluster-solo-steps-aside.md @@ -0,0 +1,5 @@ +### Single-Mac serving steps aside for a started pair, and the pair goes back to Darkbloom at once + +- When the pair is started and wants this Mac's part, but single-Mac serving holds the Mac's serving lock and nobody chose it since the pair was started, the cluster service now stops it the way `darkbloom stop --solo` does. It logs why, and `darkbloom status` says so too. This covers single-Mac serving restarted by 0.10.8's updater during tonight's update, by a login, or by the watchdog. It doesn't step aside when you chose single-Mac serving yourself: `start --solo`, the terminal's "Serve on this Mac alone" and serving alone from the app record that choice, and starting the pair or `stop --solo` on that Mac clears it. A Mac updated from 0.10.8 has no recorded choice, so the started pair wins. It never steps aside while the pair isn't running there (serving alone stays as it is). +- Parts that ended because single-Mac serving held a Mac's serving lock no longer count toward the pair falling back to local-only serving. Once single-Mac serving stops, through the offer, `stop --solo` or a step aside, the count resets. An approval set aside for "parts kept ending" is offered to Darkbloom again at once, instead of after up to an hour. +- When the two Macs run different versions, the start's ✗ says that first, not the single-Mac block. diff --git a/changelog.d/cluster-solo-stop-on-the-right-mac.md b/changelog.d/cluster-solo-stop-on-the-right-mac.md new file mode 100644 index 0000000000..149f6bbc78 --- /dev/null +++ b/changelog.d/cluster-solo-stop-on-the-right-mac.md @@ -0,0 +1,6 @@ +### `stop --solo` on the wrong Mac finds the right one + +- If `darkbloom stop --solo` finds no single-Mac serving on this Mac but finds it on the other Mac of the pair, it names that Mac and its process and offers to stop it there. `--yes` stops it without asking, for scripts. It no longer points to plain `darkbloom stop`, which stops the pair and leaves single-Mac serving running. +- While single-Mac serving blocks a started pair whose other Mac answers, `darkbloom start` starts the pair (in a terminal, the screen that offers to stop it). It no longer offers "Serve on this Mac alone", which would recreate the block. +- "Single-Mac serving is set up" now means its job is loaded, not that its file exists. After `stop --solo`, a pair whose other Mac goes quiet no longer gives up its part for single-Mac serving that can't come back. +- An orphaned pair part, one that outlived its cluster service, is never reported as single-Mac serving. `stop --solo` can't stop it, so you're never told to try. diff --git a/changelog.d/gemma-pair-eligibility.md b/changelog.d/gemma-pair-eligibility.md new file mode 100644 index 0000000000..8f2b3cde7d --- /dev/null +++ b/changelog.d/gemma-pair-eligibility.md @@ -0,0 +1,5 @@ +### A pair the coordinator won't pair for its model says why + +- A two-Mac pair offered through Darkbloom for a model that the coordinator's model catalog doesn't list waited on "waiting for the coordinator to pair both Macs" until the 15-minute limit, and `darkbloom cluster status` showed `loading` for as long as it ran. The coordinator refuses such a pair on every check (`serves_model`) and tells neither Mac. On DevNet this hit Gemma 4 26B and every other model that has a DevNet pair approval but no DevNet catalog entry. +- Each Mac's part now reads the coordinator's public model catalog once after it registers. If the catalog doesn't list the model, the part says so: "The coordinator does not pair Macs for : its model catalog does not list it". The setup screens on both Macs show that reason at once, and `darkbloom cluster status` and `darkbloom status` report the pair as not serving with that reason instead of `loading`. A catalog that can't be read changes nothing. The part keeps running, so a pair whose model is added to the catalog later still forms. +- A pair that the coordinator paired, but under an approval it serves only to this account's own requests, no longer shows "✓ Serving … through Darkbloom". On DevNet a Gemma 4 26B pair under the model approval `devnet/gemma-4-26b-qat-4bit/s1` showed ✓ while every public request got 429 `cluster_not_public … (unqualified)`. The coordinator serves the public only from a pair under a release's build-pinned approval, for a model the release approves for public pairs and in a mode it approves. Each Mac's part now checks its saved approval against that rule. Both screens and `darkbloom cluster status` say "Not serving publicly: the coordinator paired both Macs but doesn't send public requests to this pair (…)" and what to do: update both Macs to a release that approves the model, choose an approved model, or choose an approved mode. A pair that meets the rule still shows ✓ once it serves; the provider doesn't see the coordinator's other public-serving checks. diff --git a/changelog.d/glm-pair-128gb-load.md b/changelog.d/glm-pair-128gb-load.md index 2d24c587e6..d4aca91bbc 100644 --- a/changelog.d/glm-pair-128gb-load.md +++ b/changelog.d/glm-pair-128gb-load.md @@ -2,5 +2,6 @@ - Two M5 Max Macs with 128 GB each now load and serve GLM-5.3-Flash together, about half the model on each Mac. Before, `darkbloom cluster` refused the pair even with plenty of free memory, because each Mac set aside room for the longest possible request before loading. - Each Mac now loads its half on what loading needs, and each request is checked against the memory free when it arrives. If a Mac is busy, the pair serves shorter requests and answers a longer one with a retryable "busy" error before it starts, never by running out of memory. Closing large apps brings back the full context. -- New: `darkbloom cluster gpu-limit` lets the GPU of an M5 Mac with 128 or 256 GB keep more memory (its memory less 16 GiB: 112 GiB on a 128 GB Mac), which leaves room for long requests. Run it on each Mac: it asks you once, then macOS asks for an administrator password, and the setting stays after a restart. `darkbloom cluster gpu-limit --undo` puts macOS's default back. Darkbloom never changes the limit on its own. After macOS approves, the command reads the setting back and shows ✓ only if it took effect; otherwise it shows ✗, what is off and what to run next. +- New: `darkbloom cluster gpu-limit` lets the GPU of any Apple silicon Mac with 128 GB or more keep more memory (its memory less 16 GiB: 112 GiB on a 128 GB Mac), an M4 Max or M3 Ultra as well as an M5, which leaves room for long requests. Run it on each Mac: it asks you once, then macOS asks for an administrator password, and the setting stays after a restart. `darkbloom cluster gpu-limit --undo` puts macOS's default back. Darkbloom never changes the limit on its own. After macOS approves, the command reads the setting back and shows ✓ only if it took effect; otherwise it shows ✗, what is off and what to run next. - When a Mac's GPU limit is what stops a plan, the plan now says so and names that command on the Macs it runs on. A Mac that cannot load its part says which memory it is short of. +- `darkbloom cluster` offers only the ways a pair can actually run GLM-5.3-Flash: on two 128 GB Macs, including an M4 Max with an M5 Max, that is the pipeline. When nothing fits as the Macs are, the model's row says either "Needs `darkbloom cluster gpu-limit` first" (with the Mac and the figures) or "Needs more memory" with the reason, instead of the old "Too large … even with every application closed". The plan counts a GPU-limit raise only on Macs the command runs on (Apple silicon with 128 GB or more), so it never asks for a step that would be refused; Intel Macs and Macs under 128 GB are refused with the reason, and a Mac that does not report its GPU limit is never changed. diff --git a/docs/architecture/inference.md b/docs/architecture/inference.md index 0af34cdb4c..3b175e09ba 100644 --- a/docs/architecture/inference.md +++ b/docs/architecture/inference.md @@ -1,6 +1,6 @@ # Provider inference engine -> Last updated: 2026-11-04 +> Last updated: 2026-11-05 How a chat-completion request is served inside the `darkbloom` provider process: one in-process engine (`mlx-swift-lm` @@ -403,6 +403,11 @@ over the cable and ends with the same ✓/✗ block, bounded like the leader's s width (`ClusterOnboardingDriver.followWaitingLine`). The terminal reads that width at each redraw and climbs back over the rows a reflowed window shows (`ClusterOnboardingTerminal.climb`), so a redraw never leaves a wrapped copy behind. +- **The mode question's lines.** Each mode's line is asked for its text again at every draw, for the room a row has + then (`ClusterOnboardingDriver.modeLine(_:recommended:room:)`, `ClusterOnboardingTerminal.chooseFitting`), and the + list draws again within about 100 ms of a resize. Too wide, a line drops the split, then what each Mac does, then + the long words. The mode's name and how many requests it serves at once are never cut; at 40 columns they take two + rows. Plain output prints each whole line. - **How the wait ends.** A refusal ends the wait at once with the leader's ✗ (`followRefused`; different builds: `differentBuildsLines`). Running out of time ends it with a ✗ and next steps (`notStartedReason`, `notStartedLines`). @@ -3956,6 +3961,18 @@ Mac whose pair doesn't run clears the intent and waits for the part to end (`ClusterService.releaseForSingleMac`) before single-Mac serving starts ([going back to serving on one Mac](../provider/two-mac-cluster.md#going-back-to-serving-on-one-mac)). +Single-Mac serving holds a Mac's one serving lock and never ends by itself, so +neither Mac's part starts beside it. Each Mac's status reports it in +`soloServing` whenever no part of its own holds the lock, and says why its part +can't start in `heldBack` (0.10.9; both nil from an older build). At each +15-second sync the leading Mac reads the other Mac's reason +(`ClusterService.heldBack(of:)`: `heldBack`, else its `soloServing`), and while +one is reported its own part doesn't start +(`ClusterControlPartChoice.waitsForOtherMac`): a part started anyway only waits +for its missing follower and ends again. The rule applies only while this Mac +leads and runs the cluster, and never to serving alone (`solo:`); a Mac that +doesn't answer reports nothing, so its absence follows the control lease. + ## Cluster service listeners follow the cable and the pairing Each Mac's cluster service answers the other Mac on two listeners: the setup @@ -5344,7 +5361,7 @@ See [focused MiMo V2.6 tensor-parallel checks](../developer/test.md#focused-mimo ## Exact-quote placement -`ClusterPlacementPlanner.rankQuoted` is the model-independent decision seam for adapters that provide exact simultaneous native/host peaks and current bounds. It filters infeasible shapes and unsupported modes, then uses the same hardware-only ordering as `plan`: candidates whose every range fits its Mac's hardware (`ClusterDeviceProfile.hardwareFits`: buffer and allocator limits, the GPU-resident part (`ClusterPlacementRank.gpuResidentBytes`, the `withinGPUWorkingSet` figure) within the GPU limit, and the whole need within the at-rest admissible memory `atRestAdmissibleBytes`, physical memory less what macOS wires, because the load gate counts every file-backed page), then predicted request time, ties and the tensor-parallel margin. Live free memory and file cache never order candidates; each rank's live fit is reported and the load gate still decides each load. A supported TP adapter must supply TP layout facts and keyed reduction measurements. Neither resource balance nor chip-name rules replace request-time scoring; balance only breaks ties. Candidates whose predicted times differ only by rounding (relative 1e-9, as every serial pipeline cut does on identical Macs) are ordered by `capacityBalance`, the smallest share of a rank's hardware capacity (`min(residentCapacityBytes, atRestAdmissibleBytes)`) left beyond its need, before the lower cut, so identical Macs split evenly and live free memory cannot pick the cut. Every structural boundary, including one layer on a slower member, remains available when its adapter quotes fit. A candidate is `possible` when every rank fits the hardware, or the live gate admits it now and its GPU part is within the limit: a split the GPU cannot keep resident is never offered because memory happens to be free. `ClusterPlacementMemoryVerdict.assess` runs the caller's planning step on the Macs as they are and, when nothing fits, with each GPU limit raised to `ClusterGPUMemoryLimit.ceilingBytes` (physical memory less 16 GiB, or a sixteenth from 512 GB): `fits`, `needsGPULimitRaise` (each Mac's GPU need, limit now and ceiling, with `ClusterGPULimitRaise.question`) or `doesNotFit`. It is data only: no setup screen calls it yet, and `darkbloom cluster` never raises the limit itself. The one command that does is `darkbloom cluster gpu-limit`, which its owner runs on an M5 Mac with 128 or 256 GB, with consent and macOS's administrator prompt, to the same ceiling (`GLM5NextGPULimitEligibility`; see [GLM pair admission](#glm-pair-admission)). `ClusterDeviceMemory.fit` reports `gateCountsLess` only on a sample whose gate counts file cache; above normal pressure, where the gate counts none, the answer is `afterApplicationsRelease`. A rank's live fit is the gate's decision on one sample, so it cannot foresee the gate withdrawing the file cache during the load once compression or swap-out since the load's first sample passes its limits (`QwenDenseStageLoadPolicy.maximumCompressedSinceFirstSampleBytes`, described above); the at-rest ceiling assumes the share loads into free pages, not into a file cache full of the model's own files. +`ClusterPlacementPlanner.rankQuoted` is the model-independent decision seam for adapters that provide exact simultaneous native/host peaks and current bounds. It filters infeasible shapes and unsupported modes, then uses the same hardware-only ordering as `plan`: candidates whose every range fits its Mac's hardware (`ClusterDeviceProfile.hardwareFits`: buffer and allocator limits, the GPU-resident part (`ClusterPlacementRank.gpuResidentBytes`, the `withinGPUWorkingSet` figure) within the GPU limit, and the whole need within the at-rest admissible memory `atRestAdmissibleBytes`, physical memory less what macOS wires, because the load gate counts every file-backed page), then predicted request time, ties and the tensor-parallel margin. Live free memory and file cache never order candidates; each rank's live fit is reported and the load gate still decides each load. A supported TP adapter must supply TP layout facts and keyed reduction measurements. Neither resource balance nor chip-name rules replace request-time scoring; balance only breaks ties. Candidates whose predicted times differ only by rounding (relative 1e-9, as every serial pipeline cut does on identical Macs) are ordered by `capacityBalance`, the smallest share of a rank's hardware capacity (`min(residentCapacityBytes, atRestAdmissibleBytes)`) left beyond its need, before the lower cut, so identical Macs split evenly and live free memory cannot pick the cut. Every structural boundary, including one layer on a slower member, remains available when its adapter quotes fit. A candidate is `possible` when every rank fits the hardware, or the live gate admits it now and its GPU part is within the limit: a split the GPU cannot keep resident is never offered because memory happens to be free. `ClusterPlacementMemoryVerdict.assess` runs the caller's planning step on the Macs as they are and, when nothing fits, with each GPU limit Darkbloom raises lifted to `ClusterGPUMemoryLimit.ceilingBytes` (physical memory less 16 GiB, or a sixteenth from 512 GB): `fits`, `needsGPULimitRaise` (each Mac's GPU need, limit now and ceiling, with `ClusterGPULimitRaise.question`) or `doesNotFit`. Only Macs `ClusterGPUMemoryLimit.raisedByDarkbloom` names (Apple silicon, any M generation, with 128 GB or more) are lifted (`ClusterDeviceProfile.withGPUMemoryLimitRaised` is nil elsewhere), so an Intel Mac or a Mac under 128 GB is held to the limit macOS keeps. `darkbloom cluster` never raises the limit itself. The one command that does is `darkbloom cluster gpu-limit`, which its owner runs on such a Mac, with consent and macOS's administrator prompt, to the same ceiling (`GLM5NextGPULimitEligibility` delegates to the same rule; see [GLM pair admission](#glm-pair-admission)). When no placement fits a pair as its Macs are, the setup's model row (`ClusterSetupPlanning.decide`) plans again with those Macs lifted: if a placement fits then, the row is blocked with that step (`ClusterSetupPlanning.gpuLimitSteps`: each Mac whose part needs more GPU memory than macOS allows, the need, the limit and the raised limit); otherwise it says "Needs more memory" with the reason (`refusalWords`: the GPU limits when every part fits its Mac's memory at rest, else the model's size). Nothing is offered that would load and then fail. `ClusterDeviceMemory.fit` reports `gateCountsLess` only on a sample whose gate counts file cache; above normal pressure, where the gate counts none, the answer is `afterApplicationsRelease`. A rank's live fit is the gate's decision on one sample, so it cannot foresee the gate withdrawing the file cache during the load once compression or swap-out since the load's first sample passes its limits (`QwenDenseStageLoadPolicy.maximumCompressedSinceFirstSampleBytes`, described above); the at-rest ceiling assumes the share loads into free pages, not into a file cache full of the model's own files. GLM's placement family (`GLM5NextPlacementFamily`, `libs/darkbloom-cluster/Sources/DarkbloomClusterRuntime/Models/GLM5Next/Metadata/GLM5NextServingMetadata.swift`) offers the two-rank plan `glm5_next_heads_and_expert_channels_v1` whenever the registered row lists `tensor_parallel_v1` and the geometry halves. Each text-layer tensor is divided or replicated exactly as the SDK's `GLM5NextTensorShard.splitAxis` loads it; the embedding, final norm and head are replicated, and the NextN layer and vision tower belong to no text range. Every rank decodes in speculative rounds with the NextN layer, which it holds whole beside its share, so the plan states it (`ClusterTensorParallelFamilyPlan.speculativeHead`, `GLM5NextPlacementFamily.tensorParallelSpeculativeHead`): the planner charges each tensor-parallel rank the layout's `speculativeHead` part (4,183,320,576 stored bytes, each tensor in whole pages, as `mtp_bytes` on the worker's load line) and the request memory the rounds add at the memory plan's context (the larger of the contiguous and the paged NextN charge of `GLM5NextTensorParallelRequestCharge`), and divides a token's predicted decode step by the speed-up the pair measured at the runtime's depth over one token per step (76.0 against 62.6 tok/s at depth 2, `GLM5NextPlacementFamily.measuredTensorParallelDecode`). Served tensor-parallel requests are taken back to one-token steps by the same speed-up before they correct the shares (`ClusterServedCalibration`), so the next plan predicts what was served. Without it the plan priced no NextN bytes and one token per step: it could admit a pair the load gate then refused, and it predicted decode too slow. Three terms of the load gate are not in the plan yet: the vision tower rank 0 holds for media (1.13 GB), the freed-buffer cache (`GLM5NextTensorParallelResidentRuntime.freedBufferCacheBytes`) and the bulk prefill's further workspaces and sealed sums' buffers (`bulkPrefillChunkTokens`). On two M5 Ultra 256 GB, adding them to the planner's estimate as it stands would put each rank's need above the at-rest ceiling (`ClusterDeviceProfile.atRestAdmissibleBytes`), so the pair would no longer plan tensor parallel; they wait for the gate's own charge to replace the estimate rather than be added to it. The plan sums two partials of the 4096-wide residual per layer and one per step (91 per decode step); the partials are the row-parallel projections' bfloat16 outputs, sent as they are and added in float32 with one rounding (`GLM5NextTensorParallelResidentRuntime.partialsTransport`, bound into the load agreement). That is bit-identical to widening them to float32 before the link, as `ClusterTensorParallelTerms.current` (`partialsDType` float32) describes, with half the bytes: GLM's projections never kept float32 partials (flagged for platform review) and holds request state whole on each rank, since the DSA latent cache is replicated. The pipeline's private image profile stays pipeline-only, in both the layout and the capability; tensor parallel serves media under the text profile (below). The hardware prior (`ClusterHardwarePrior.decodeBytesPerToken`) counts a mixture of experts' routed experts at the fraction a token is routed to (`ClusterRoutedExperts`; 8 of GLM's 288), not every expert byte. Of the bytes a step reads, a tensor-parallel share divides only the plan's divided bytes (`dividedDecodeFraction`), because every rank reads its replicated bytes whole. On two identical M5 Ultra 256 GB with GLM measured alone the product's rule (tensor parallel first wherever it fits) places tensor parallel on equal shares with the NextN layer priced, both on a new pair before any load measured the link and after the first load's keyed probe; the planner's own speed comparison (the plan tool without `--tensor-parallel-first`) chooses tensor parallel once the keyed link is measured and a pipeline before (`GLMTensorParallelChecks`; through `ClusterPlacementFlow.decide` in `PlacementSetupCheck.glmTensorParallelPair`). The pair serves it with eight lanes (`DistributedInstalledPlan.tensorParallelBatchLanes`). diff --git a/docs/architecture/security/local-control.md b/docs/architecture/security/local-control.md index d055b21ba3..7b7de55e06 100644 --- a/docs/architecture/security/local-control.md +++ b/docs/architecture/security/local-control.md @@ -1,6 +1,6 @@ # Local control channels -> Last updated: 2026-11-04 +> Last updated: 2026-11-05 Two local channels can take a provider out of serving without the coordinator: the add-on hold socket and the lifecycle mailbox behind `darkbloom addon`. This @@ -98,7 +98,7 @@ through `/usr/bin/osascript` (`ClusterLinkApproval`); Darkbloom never uses | Command | What it changes | Values | Undo | |---|---|---|---| | `darkbloom cluster link --fix` | A link-local address on the cluster's Thunderbolt port, and its keeper job | Generated from the port; no operator text (`ClusterLinkPrivilegedRequest`) | `--remove` | -| `darkbloom cluster gpu-limit` | The GPU and user wire limits, and a boot job that reapplies them | From this Mac's own memory: the GPU keeps at most its memory less 16 GiB; M5 Macs of 128 or 256 GB only (`GLM5NextWiredLimitRequest`) | `--undo` | +| `darkbloom cluster gpu-limit` | The GPU and user wire limits, and a boot job that reapplies them | From this Mac's own memory: the GPU keeps at most its memory less 16 GiB (a sixteenth from 512 GB); Apple silicon Macs with 128 GB or more only, and never where the limits cannot be read (`GLM5NextWiredLimitRequest`) | `--undo` | `gpu-limit` also requires a terminal and one confirmation before the prompt. A raised GPU limit removes no admission check: the host memory gate still decides diff --git a/docs/provider/agent-setup.md b/docs/provider/agent-setup.md index 512565c918..b3f2d78044 100644 --- a/docs/provider/agent-setup.md +++ b/docs/provider/agent-setup.md @@ -780,7 +780,7 @@ yet"](troubleshooting.md#a-two-mac-cluster-says-not-serving-yet) and | Signal | Cause | Do | |---|---|---| | The human stopped clustering, and the Mac is online but gets no requests; `darkbloom status` says ``The other Mac (…) hasn't answered for 15 min; this Mac's part stopped.`` or ``The pair hasn't served for … min``; on 0.10.8 `darkbloom start --solo` says ``This Mac's part of the pair holds its serving lock`` | The Mac kept the pair's saved start, so its cluster service ran its part of a pair that no longer forms. That part registers only as a pair member, which gets no ordinary requests | With the human's go, run `darkbloom start` on that Mac (0.10.9 or later): it stops the leftover part and serves this Mac alone. On 0.10.8: `darkbloom cluster pair --status`, then `darkbloom cluster pair --forget `, then `darkbloom start`. Never plain `darkbloom stop` on 0.10.8 for this: it acts on the pair | -| ``✗ The pair can't start: a single-Mac Darkbloom provider (process ) is serving on , …``; a cluster status or log line ``a single-Mac Darkbloom provider (process ) is serving on this Mac, so this Mac's part can't start``; an incident `local_provider_running`. In 0.10.8 the same cause read ``another update operation owns the lock (pid , provider-instance)`` and looped ``this Mac's part ended … and starts again by itself`` | Single-Mac serving runs on that Mac and holds its one serving lock, so the pair's part can't start there. It doesn't end by itself | **STOP**: ask the human whether to stop single-Mac serving on each Mac named. With their go, run `darkbloom stop --solo` on that Mac, then `darkbloom start` (on DevNet, `darkbloom-dev`). In `darkbloom cluster`, **Stop single-Mac serving on both Macs and start the pair** does both. Never plain `darkbloom stop` for this: on a paired Mac it stops the pair and leaves single-Mac serving running | +| ``✗ The pair can't start: a single-Mac Darkbloom provider (process ) is serving on , …``; a cluster status or log line ``a single-Mac Darkbloom provider (process ) is serving on this Mac, so this Mac's part can't start``; an incident `local_provider_running`. In 0.10.8 the same cause read ``another update operation owns the lock (pid , provider-instance)`` and looped ``this Mac's part ended … and starts again by itself`` | Single-Mac serving runs on that Mac and holds its one serving lock, so the pair's part can't start there. It doesn't end by itself | **STOP**: ask the human whether to stop single-Mac serving on each Mac named. With their go, run `darkbloom stop --solo` on that Mac, then `darkbloom start` (on DevNet, `darkbloom-dev`). In `darkbloom cluster`, **Stop single-Mac serving on both Macs and start the pair** does both. Both Macs' `darkbloom cluster status` say the block, with `next` ``Single-Mac serving doesn't stop by itself: …`` (`state` `not_serving`, exit status 3), and the joining Mac's window shows the same ✗. Neither Mac keeps restarting its part meanwhile; don't wait for it to clear by itself. From 0.10.9, single-Mac serving that nobody chose since the pair was started steps aside by itself (`darkbloom status` says ``Single-Mac serving stepped aside for the pair …``). Only a choice the human made (`start --solo`, **Serve on this Mac alone**) keeps it. `darkbloom stop --solo` on the other Mac finds it there and asks (`--yes` for scripts) Never plain `darkbloom stop` for this: on a paired Mac it stops the pair and leaves single-Mac serving running | | The leader's ✗ says ``The other Mac can't reach this Mac over the cable: macOS keeps Darkbloom there off the local network.``, then ``The other Mac (…): System Settings → Privacy & Security → Local Network → turn on “Darkbloom”; if it isn't listed, click Allow when macOS asks on that Mac's screen, the next time Darkbloom dials over the cable (on a Mac with no display, through Screen Sharing). Then choose Retry here.``. On that other Mac: ``This Mac can't reach the other Mac over the cable: macOS keeps Darkbloom off the local network.`` (on DevNet, both name Darkbloom Dev, and add that macOS lists Darkbloom Dev as “Darkbloom”). `darkbloom cluster status` shows the same reason as ``✗ Not serving: .``, then ``Next: …`` (`--json`: `state` `not_serving`, exit status 3), on that Mac at once, and on the leading Mac from about 20 seconds into its part, steadily after that while that Mac stays refused | macOS keeps that Mac's cluster service off the local network, so its link to the other Mac is refused | **STOP**: the human, at that Mac's screen (Screen Sharing if it has no display), opens System Settings → Privacy & Security → Local Network and turns on “Darkbloom” (the DevNet app is listed under that name too), or, with no such row, clicks **Allow** when macOS asks on that screen. Then choose **Retry** where the ✗ offers it (usually on the leader), or run `darkbloom start` on either Mac, as `next` says. Until then, `darkbloom start` on the Mac that is kept off ends at once with the same lines and exit status 1 | | doctor: ``[FAIL] cluster savedConfiguration: saves this Mac's cluster setup, but other users can open it (mode 644); run `chmod 600 ` …`` | The saved setup is in a file other users can open | **STOP**: tell the human, and run that `chmod 600` command only with their go ([step 2](#2-log-in-and-check-the-mac-every-mac)) | | After installing another Darkbloom app on a paired Mac (DevNet beside production, or the signed release over a local build), `darkbloom cluster` shows the old pairing as usual, or says the other Mac isn't answering, and offers no **Pair again** | The apps share the pairing, and the new app may not notice that its key differs | With the human's go, choose **Start over (unpair and set up again)** → **Yes, start over** on both Macs, then pair as in step 5. It unpairs the Mac for both apps | diff --git a/docs/provider/cli-reference.md b/docs/provider/cli-reference.md index f2106e0cae..7df757ec72 100644 --- a/docs/provider/cli-reference.md +++ b/docs/provider/cli-reference.md @@ -1,6 +1,6 @@ # Provider CLI reference -> Last updated: 2026-11-04 +> Last updated: 2026-11-05 Reference for the `darkbloom` command-line tool: every subcommand and flag, the files and identifiers it creates, the `provider.toml` keys it reads with their @@ -693,8 +693,9 @@ darkbloom cluster gpu-limit [--undo] | `--undo` | flag | `false` | Remove the job that keeps the limit raised and return `iogpu.wired_limit_mb` to the macOS default | Lets this Mac's GPU keep its memory less 16 GiB resident, so GLM-5.3-Flash runs -on two 128 GB Macs with room for long requests (M5 Macs of 128 or 256 GB only; -exit 2 elsewhere). It prints the current and the new limit, asks once (`y`), and +on two 128 GB Macs with room for long requests (Apple silicon Macs with 128 GB +or more only; exit 2 elsewhere, with the reason, and where the Mac does not +report the limits). It prints the current and the new limit, asks once (`y`), and then macOS asks an administrator to approve. Where the limits are already met, it installs the boot job that keeps them if that job is missing or differs, and changes nothing if it is in place. It needs a terminal; without one it prints @@ -790,6 +791,14 @@ through Darkbloom" (`OnboardingLive.notOfferedLines`): planned for Darkbloom). Or serve locally only: `darkbloom cluster local` on ." - `darkbloom start` without a terminal stops waiting at once on this reason (exit 3). +While single-Mac serving runs on either Mac of a started pair, the pair can't start there and it doesn't stop by +itself. Both Macs read `not_serving` (exit 3), never "keep trying by themselves": +- `reason` is "The pair can't start: a single-Mac Darkbloom provider (process ) is serving on , and the pair + can't share a Mac with it". +- `next` is "Single-Mac serving doesn't stop by itself: run `darkbloom stop --solo` on each Mac named, then + `darkbloom start` on either Mac. Or `darkbloom cluster` on offers to stop it and start the pair." +- `darkbloom start` without a terminal stops waiting at once on this reason (exit 3). + During a model or mode change, or while the pair updates Darkbloom, `status` and `cluster status` can read `stopped` (exit 4) or `unknown` for a minute or two while the pair is actually reloading. If such a change happened recently, or the status showed "Updating…", wait about a minute and check again before acting. Run `darkbloom start` only if it diff --git a/docs/provider/hardware-requirements.md b/docs/provider/hardware-requirements.md index cd606382ef..123ff04862 100644 --- a/docs/provider/hardware-requirements.md +++ b/docs/provider/hardware-requirements.md @@ -1,6 +1,6 @@ # Provider hardware requirements -> Last updated: 2026-11-04 +> Last updated: 2026-11-05 Reference for what a Mac needs to run the `darkbloom` provider: the minimum requirements, the chip families the provider distinguishes, which catalog @@ -61,11 +61,19 @@ and `vm.global_user_wire_limit=261134011596` and `vm.user_wire_limit=26113401159 keep them after a reboot. Only the 256 GB values are defined for one Mac (`provider-swift/Sources/ProviderCore/Diagnostics/GLM5NextWiredLimit.swift`, `GLM5NextWiredLimit.recommendation`); they change no admission or capacity -figure. A rank of a GLM pair, which on a 128 GB M5 Max holds about half the +figure. A rank of a GLM pair, which on a 128 GB Mac holds about half the model, uses the same derivation for 128 and 256 GB, applied with [`darkbloom cluster gpu-limit`](../reference/configuration.md#gpu-memory-limit-for-a-glm-pair) (`GLM5NextWiredLimit.pairRankRecommendation`). +A GLM pair of 128 GB Macs serves as a pipeline only. An M4 Max can be one of +them: its part is sized to the GPU limit its macOS reports (107.52 GiB on +macOS 26). `darkbloom cluster gpu-limit` raises the limit on any Apple silicon +Mac with 128 GB or more (an M4 Max, M3 Ultra, M2 Ultra, M1 Ultra or M3 Max as +well as an M5), so where a raise makes a split fit the setup names that step +first, and otherwise says "needs more memory" +([two-Mac cluster](two-mac-cluster.md)). + Current backend behavior is owned by the [platform's latest default branch](https://github.com/Layr-Labs/darkbloom-platform/tree/master). Immutable external citations below preserve evidence snapshots, not current diff --git a/docs/provider/two-mac-cluster.md b/docs/provider/two-mac-cluster.md index 87bf658cf6..49093dae81 100644 --- a/docs/provider/two-mac-cluster.md +++ b/docs/provider/two-mac-cluster.md @@ -1,6 +1,6 @@ # Two Macs as one provider (guided setup) -> Last updated: 2026-11-04 +> Last updated: 2026-11-05 Two Apple Silicon Macs joined by one Thunderbolt 5 cable serve a model together: each Mac holds part of its layers, and the pair serves as one provider. Setting @@ -141,7 +141,18 @@ follows the start from the cluster's status the two Macs exchange over the cable in `darkbloom cluster` on either Mac) and this Mac keeps following. Offered, it says "Offered to Darkbloom as a pair for ; waiting for Darkbloom to accept this pair…" and waits as the leader does, so both screens end the - same way. Every start the leader's screen makes publishes its test's outcome, + same way. When Darkbloom's model catalog does not list the model, Darkbloom + never pairs the Macs for it; each Mac's part reads the catalog after it + registers, and both screens and `darkbloom cluster status` end with "✗ Not + serving: The coordinator does not pair Macs for : its model catalog + does not list it" (`ClusterLocalServing.catalogRefusal`) instead of waiting. + A pair Darkbloom pairs under an approval that serves only this account's own + requests (a model approval such as `devnet//s1`, a pair approval saved + by hand, a model a release doesn't approve for public pairs, or a mode it + doesn't approve) ends with "✗ Not serving publicly: the coordinator paired + both Macs but doesn't send public requests to this pair ()." and what to + do, never ✓ (`ClusterPublicServingCheck`). + Every start the leader's screen makes publishes its test's outcome, and this Mac ends with it, without a test of its own: a pass with the leader's response time ("Test response in 0.61 s (the leading Mac's test)"), a failure with the same ✗, reason and note ("Setup saved, but the test failed."; through @@ -156,16 +167,28 @@ follows the start from the cluster's status the two Macs exchange over the cable leading Mac failed." under the not-serving line. Switching between local only and serving through Darkbloom, the next start or serve, and a stop clear it. -3. It ends with the same ✓ or ✗ block as the leader's screen. After ✓: "You can - close this window." After ✗: the reason, then "Choose Retry on the other Mac - (…): its screen shows the choices."; after a failed test, "To test again, run - `darkbloom cluster` on the other Mac (…) and choose the model it serves." +3. Offered to Darkbloom and not serving yet, it waits for the leading Mac's + outcome and never judges the pair by a wait of its own. A reason that clears + by itself keeps it waiting, with a live row and the time of the bound, e.g. + "Waiting for Apple to verify this Mac (Darkbloom retries by itself) · 2 of + 15 min" or "Waiting for Darkbloom to pair both Macs". +4. It ends with the leading Mac's outcome. After ✓, the same ✓ block, then "You + can close this window." After the leading Mac's ✗ (`ClusterControlReply.start` + with phase `failed`, named from this Mac's side), the same ✗ and next step, + then "Choose Retry on the other Mac (…): its screen shows the choices." That + line appears only in that ✗, since the leading Mac's screen shows Retry then. + After a failed test: "To test again, run `darkbloom cluster` on the other Mac + (…) and choose the model it serves." It ends early only for a reason of its + own, such as a different Darkbloom build. q leaves at any time: "The pair keeps going; run `darkbloom cluster` here to see it." The follow is bounded like the leader's start: 15 minutes for the start to begin, then 15 minutes for each of its stages (loading; the test and the check -with Darkbloom; the registration's restart), then the pair's own wait once it is -offered. Its end always says why. A signed +with Darkbloom; the registration's restart; the wait once it is offered). A +leading Mac that says no outcome within a stage's bound (an earlier release +publishes none) ends it with "✗ Not serving: The other Mac (…) didn't say how +its start ended within 15 minutes.", the last state, and "Its screen shows how +the start ended and what to do next." Its end always says why. A signed Darkbloom.app's login agent keeps serving; without one, as for a development build, the screen ends "Keep this window open." and the Mac serves only while the window stays open. The Start step opens with "Loading @@ -938,12 +961,30 @@ half on what loading needs, and each request is checked against the memory free when it arrives (a longer request than fits then gets a retryable "busy" answer, never an out-of-memory crash). Its plan fits two M5 Max 128 GB at the default limit too. When a GPU limit is what stops a GLM plan, the plan says so and, on -an M5 Mac with 128 or 256 GB, names the one command that changes it: +an Apple silicon Mac with 128 GB or more, names the one command that changes it: `darkbloom cluster gpu-limit`. Run it on that Mac yourself: it asks once, then macOS asks an administrator, and it raises the limit to the Mac's memory less 16 GiB (112 GiB of 128 GB), also after restarts. `darkbloom cluster gpu-limit --undo` takes it back ([GPU memory limit for a GLM pair](../reference/configuration.md#gpu-memory-limit-for-a-glm-pair)). +Only modes that load on the pair are offered. On two 128 GB Macs that is the +pipeline: tensor parallel needs more than either Mac has. On an M4 Max with an +M5 Max, each Mac's part is sized by its own GPU limit (107.52 GiB on macOS 26), +and `darkbloom cluster gpu-limit` runs on both (any Apple silicon Mac with +128 GB or more), so the plan counts a raise on either. When nothing fits as the Macs +are, the model's row says which of two things holds: + +- **"Needs `darkbloom cluster gpu-limit` first"**, naming the Mac, its part's + GPU need and the limit: a split fits once that Mac's limit is raised. Run the + command there, then `darkbloom cluster` again. Nothing loads before. +- **"Needs more memory"**, with the reason: no split fits even with the limits + Darkbloom can raise, or the Macs together cannot hold the model. Intel Macs + and Macs under 128 GB are never raised. + +These rules (`ClusterGPUMemoryLimit.raisedByDarkbloom`, +`ClusterSetupPlanning.gpuLimitSteps`, `refusalWords`) are checked pair by pair +in `libs/darkbloom-cluster/Tests/PlacementChecks/GLMPairOfferChecks.swift`. + When several splits predict the same time (two identical Macs, or Macs with equal measured speed), the one that leaves each Mac the largest share of its own memory is chosen: identical Macs split the layers evenly, and a Mac with @@ -1075,6 +1116,11 @@ happens by itself; `darkbloom cluster` says which applies to each Mac. ## Updating Darkbloom on the pair +**For pair owners:** run `darkbloom update` on **both** Macs, then check that +`darkbloom --version` shows the same version on both. If either Mac ever ran a +plain `darkbloom start` before 0.10.8 (which meant single-Mac serving), run +`darkbloom stop --solo` on that Mac first. + The Macs of a pair update themselves together, as a single Mac does, while `auto_update` is on (the default) and `DARKBLOOM_NO_UPDATE_CHECK` is not set on either Mac. Nothing needs to be run. Every 30 minutes, at the pair's update slot @@ -1132,6 +1178,47 @@ from a plain `darkbloom start` before 0.10.8, which meant single-Mac serving), says so, with `darkbloom stop --solo` to remove it. The watchdog doesn't start it again while the pair is started. +### When the two Macs run different versions + +One Mac can end up on a newer release than the other: it updated alone through +single-Mac serving, `darkbloom update` ran on it only, or the other Mac was +asleep or off at the pair's update slot. Then: + +- **The older Mac catches up within about a minute** (from 0.10.9), once its + cluster service sees the other Mac running a newer release, or updating to + one. It runs the pair's update at once instead of waiting for the slot: one + immediate try per release, then the slots as before. It never installs a + release it quarantined. With automatic updates off, its cluster service log + says "the other Mac runs v, newer than this Mac's v, and + automatic updates are off on this Mac: run `darkbloom update` on this Mac". +- **The provider's own background updater does not leave the pair split.** When + it updates a Mac whose pair actually runs there, it also asks that Mac's + cluster service to restart into the release together with the other Mac, as + `darkbloom update` does, so the other Mac follows. The watchdog doesn't + install a release while the pair runs on that Mac. A Mac that only serves + alone, its pair gone, simply updates. +- **Both screens say it at once:** "✗ The two Macs run different Darkbloom + versions: The other Mac (…) runs 0.10.7, this Mac runs 0.10.8.", then "On , run `darkbloom update`; the pair starts once both Macs run + ." The start doesn't wait or loop. It offers **Check the versions + again** (it reads both versions again, and starts the pair once they match) + or **Leave**. A Retry after any other failure checks the versions first. The + version split is said before single-Mac serving when both apply. +- **`darkbloom status` and `darkbloom cluster status --json`** give the reason + "the two Macs run different Darkbloom versions, and : run + `darkbloom update` on the Mac with ", and as `next` the Mac to update, + named for each Mac: "On this Mac, run `darkbloom update`; …" or "On the other + Mac (…), run `darkbloom update`; …". +- **The wait lines in the cluster service log name the other Mac's version:** + the leader's "Darkbloom changed on …: waiting until both Macs answer with the + same build …" and the other Mac's "waiting for the other Mac's setup for + v …" end with "; the other Mac runs v, this Mac v: + run `darkbloom update` on ". + +The other Mac's version comes from its cluster service, which publishes it from +0.10.7 on. If the other Mac publishes no version, check with `darkbloom --version` +on both Macs. DevNet builds say `darkbloom-dev`. + While a Mac serves, the re-plan uses the speed it measured while idle and never runs a GPU benchmark beside the model ([device profile](../architecture/inference.md#automatic-local-cluster-batching)). @@ -1257,7 +1344,7 @@ of the leading Mac's start, and where to choose Retry when a part keeps ending. model on each Mac. If the plan names `darkbloom cluster gpu-limit` for a Mac whose GPU keeps too little resident, run it on that Mac (it asks once, then macOS asks an administrator), then `darkbloom cluster` again. The plan names - it only on the Macs it runs on, M5 Macs with 128 or 256 GB. Running it on + it only on the Macs it runs on, Apple silicon Macs with 128 GB or more. Running it on both Macs leaves room for long requests. `darkbloom cluster gpu-limit --undo` takes it back. A request longer than what fits at that moment is refused, not run out of memory ([figures](../architecture/hardware-support.md#glm-53-flash-pairs-on-128-gb-macs)). @@ -1293,7 +1380,32 @@ serving on both Macs and start the pair** (or on the one Mac named) and **Leave**. It stops nothing unless you choose to, and it never retries by itself. Each Mac's cluster service doesn't start its part while single-Mac serving runs there. Its status names that provider, so the other Mac's screen says the -same thing instead of "no error reported". Plain `darkbloom stop` on a paired +same thing instead of "no error reported". The Mac that joined shows the same +✗ in its own window, naming its own provider ("… is serving on this Mac"), +with `darkbloom stop --solo` and that the leading Mac's screen offers the stop. +It never says it is registering with the coordinator meanwhile, and it follows +the start by itself once single-Mac serving stops. The leading Mac's part +waits too: it doesn't start, and end again every half minute, while the other +Mac reports single-Mac serving. `darkbloom cluster status` says the block on +both Macs, with `Next:` ``Single-Mac serving doesn't stop by itself: run +`darkbloom stop --solo` on each Mac named, then `darkbloom start` on either +Mac. …``, and a scripted `darkbloom start` ends its wait at once with that +reason (exit status 3). + +When nobody chose single-Mac serving since the pair was started on that Mac +(for example, the update from 0.10.8 restarted a job a plain `darkbloom start` +left set up, or a login or the watchdog started it), the Mac's cluster service +stops it by itself, as `darkbloom stop --solo` does. It writes that to its log, +and `darkbloom status` on that Mac says ``Single-Mac serving stepped aside for +the pair at