Repository navigation
Cluster: plan a serving cluster's model change again once its memory is free (local mode fell back to a pipeline) - #1677
Merged
Conversation
Changing the model of a serving two-Mac cluster (m in darkbloom cluster, or darkbloom cluster local <model>) planned while the running parts still held their memory, then stopped them and started that plan, so tensor parallel did not fit "now" and a pipeline started instead. On two M5 Ultras GLM-5.3-Flash came back as a pipeline at 47.9 tok/s, serving the pipeline's 65,536-token context instead of the native 1,048,576; with the memory released first the same command chose tensor parallel at 126.9 tok/s. localAdopt now waits until both Macs gave the stopped parts' memory back (awaitReleased, taken from the update path), plans again and adopts the model's new plan, found by its id (ClusterOnboardingUpdate.servableIndex, shared with the update and memory-refusal re-plans). When the re-plan cannot run, the listed plan stands. The memory-refusal re-plan logs the deployment the start recorded. Validation: ClusterOnboardingChecks 599 passed (7 new); swiftc -parse clean; docs-impact OK; changelog check OK; docs-check at the origin/dev baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 30, 2026
Closed
- The re-plan after the stop prefers the entry in the chosen folder: two folders can hold different artifacts under one model id. - The re-planned list and choices are read under one lock, and the entry must still name the chosen model. - A model change forwarded to the leader waits 600 s, not 240 s: the leader may drain for 5 minutes, wait for memory and plan again. - The changelog gives the measured speeds (47.9 and 126.9 tokens/s). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Review pass before merge (for David). Fixed in b3da012 (signed):
Not fixed in code: no test runs |
This was referenced Oct 31, 2026
This branch had an error being 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.
Summary
Changing the model of a serving two-Mac cluster (
mindarkbloom cluster, ordarkbloom cluster local <model>) planned the new model while the running parts still held their memory, then stopped them and started that plan. A tensor-parallel split therefore did not fit "now", and a pipeline started in its place.Found on DevNet (two M5 Ultra 256 GB, GLM-5.3-Flash,
0.10.4-dev.branch.8).darkbloom cluster local glm-5.3-flashwas run while the pair served GLM in tensor parallel:GLM5NextResidentAdmission.memoryProfile), not the native 1,048,576.s; both Macs back to 7 / 4 GiB wired) and running the same command chose tensor parallel 50/50:darkbloom-serving-context-v1 … tokens=1048576;The re-plan after a Darkbloom update (
ClusterService.checkForUpdate) already does this right: it stops both parts, waits until both Macs report "nothing left running", re-asks the other Mac (ClusterOnboardingUpdate.reportPricesPlan) and plans again. The guided model change never did.This change:
ClusterOnboardingLive.localAdopt: when it has to stop a serving cluster, after the parts drained it now:awaitReleased, extracted from the update path);localPlanModels, which asks the other Mac for a report taken after the stop);When the plan changed, one line says so ("Planned again with both Macs' memory given back: …"). A model that is no longer offered fails with the reason. When the re-plan cannot run, the listed plan stands; it was priced with less memory than the Macs then have.
ClusterOnboardingUpdate.servableIndex(of:in:): one rule for "this model, startable as listed". The guided change, the update re-plan and the memory-refusal re-plan all use it; before, the predicate was duplicated inline twice inClusterService.Memory-refusal re-plan (
ClusterService.noteMemoryRefusal): it adopts throughlocalAdopt, which now plans once more after the stop. Its log line therefore quotes the deployment the start recorded, not its own earlier plan's line.Docs and changelog:
docs/architecture/inference.mdanddocs/provider/two-mac-cluster.mddescribe the model change's re-plan;changelog.d/cluster-model-change-replans-after-stop.md.Before
flowchart LR subgraph Behavior A1["serving GLM, tensor parallel"] --> B1["darkbloom cluster local glm-5.3-flash"] B1 --> C1["plan while the parts hold ~96 GiB each: TP 'does not fit now'"] C1 --> D1["stop both parts"] --> E1["start the listed pipeline: ~48 tok/s, 65,536-token context"] end subgraph Code P1["chooseAndServe → planModels (parts running)"] --> Q1["localAdopt: localStop + drained"] Q1 --> R1["context.adopt(listed plan key)"] U1["checkForUpdate: stop → wait for release → localPlanModels → find by id → localAdopt"] endAfter
flowchart LR subgraph Behavior A2["serving GLM, tensor parallel"] --> B2["darkbloom cluster local glm-5.3-flash"] B2 --> C2["listed plan (parts running)"] --> D2["stop both parts, wait until both Macs gave the memory back"] D2 --> E2["plan again: tensor parallel fits"] --> F2["start TP: ~100+ tok/s, 1,048,576-token context"] end subgraph Code P2["chooseAndServe → planModels"] --> Q2["localAdopt: localStop + drained"] Q2 --> R2["awaitReleased → localPlanModels → servableIndex(model id)"] R2 --> S2["context.adopt(new plan key)"] U2["checkForUpdate: awaitReleased + servableIndex (shared)"] M2["noteMemoryRefusal: servableIndex; logs the recorded deployment"] endValidation
provider-swift/Tests/ClusterOnboardingChecks/run.sh: 599 passed, 0 failed, including 7 newservableIndexchecks:swiftc -parseon the changed Swift files.scripts/docs-impact-check.py --base origin/dev: coverage OK.scripts/changelog.py check: 103 valid.scripts/docs-check.sh: the same 4 submodule-link lines asorigin/dev, none added.localAdoptfollow.Refactor pass
An independent refactor/review pass found no bugs in the change. It:
choicesnor the decisionscontext.adoptreads, which is why the listed plan can stand;OnboardingLive), documented that path, and added one check.Checks rerun after the pass: onboarding 599 passed;
swiftc -parseclean; docs-impact OK; changelog 103 valid; docs-check at theorigin/devbaseline.Limitations
ClusterOnboardingLive.swiftandClusterService.swiftare compiled only by the full package build, which isn't run on the serving Macs. CI type-checks them; the new pure rule is covered by the onboarding checks.GLM5NextRegisteredSpecification.registeredOutputTokens, the catalog'smax_output_length), also in local-only mode.Need help on this PR? Tag
@codesmith-botwith what you need.