Skip to content

Fix two-Mac batching, admission, and numerical qualification - #1567

Closed
jonathan308 wants to merge 4 commits into
feat/cluster-two-mac-foundationfrom
fix/cluster-validation-batching
Closed

jonathan308 wants to merge 4 commits into
feat/cluster-two-mac-foundationfrom
fix/cluster-validation-batching

Conversation

@jonathan308

@jonathan308 jonathan308 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

This draft carries the provider and native-runtime changes exercised by local two-Mac candidate c05. Concurrent requests previously encountered mismatched installed lane counts, serial execution, joining/cancellation failures, or row-dependent numerical changes. The candidate binds effective lane counts and arithmetic to both workers, supports isolated native lanes, and can drain a live local session into a conservatively priced batch-capable plan while preserving the HTTP listener and queued response ownership.

The changes include encrypted batch record scopes; per-lane sampling, joining and cancellation; bounded credit coalescing; paged-state adapters and native batch owners; Qwen MoE tensor-plan support with failed-shape guards; request-scope and batch memory quotes; transactional automatic setup adoption/rollback; native completion/memory observations; and exact-artifact qualification fixes. The accompanying SDK drafts supply the model arithmetic/cache seams. Source changes also preserve measured shard rates rather than clamping them to a faster inferred value.

Before

flowchart TD
  A["Concurrent local requests"] --> B["Installed plan and provider admission"]
  B --> C["Worker settings may differ"]
  C --> D["Serial work or batch lifecycle failure"]
  C --> E["Wide-row arithmetic differs from solo"]
  I["Same HTTP request"] --> J["Standalone and cluster metadata paths differ"]
  J --> K["Ignored capture or min_p; scalar stop rejected"]
  classDef default fill:#e8f0fe,stroke:#174ea6,color:#102a43,stroke-width:2px;
  classDef guard fill:#fff4ce,stroke:#8a6100,color:#332500,stroke-width:2px;
  classDef success fill:#d7f0df,stroke:#176b39,color:#103b23,stroke-width:2px;
  classDef failure fill:#fde2e2,stroke:#9b1c1c,color:#571111,stroke-width:2px;
  class B,C guard;
  class D,E,K failure;
  class J guard;
Loading

After

flowchart TD
  A["Concurrent local requests"] --> B["Stable listener and bounded queue"]
  B --> C["Full-profile memory quote"]
  C --> D["Drain and prove old workers released"]
  D --> E["Adopt matching setup on both hosts"]
  E --> F["Native isolated lanes with bound arithmetic"]
  F --> G["Observed completed width and logical page retirement"]
  E --> H["Fresh rollback on recoverable startup failure"]
  I["Same HTTP request"] --> J["Shared normalization and request metadata"]
  J --> K["Engine validates requested capture"]
  K --> L["Usage, captured logprobs and min_p preserved"]
  classDef default fill:#e8f0fe,stroke:#174ea6,color:#102a43,stroke-width:2px;
  classDef guard fill:#fff4ce,stroke:#8a6100,color:#332500,stroke-width:2px;
  classDef success fill:#d7f0df,stroke:#176b39,color:#103b23,stroke-width:2px;
  classDef failure fill:#fde2e2,stroke:#9b1c1c,color:#571111,stroke-width:2px;
  class C,D,E guard;
  class F,G,L success;
  class J,K guard;
  class H failure;
Loading

Validation completed for this source snapshot:

  • Full release provider and native helper builds, recursive source guards, ad-hoc app signature verification, and identical app/qualification inventories installed on the M5 Max and M3 Ultra.
  • Focused installed child/session integration: all 15 registered profiles and nine lifecycle scenarios, including actual child environment propagation and setup adoption/rollback. Two selected canonical bilateral prefix tests also pass against the integrated metadata closure.
  • Focused implementation suites cover sampling, record binding, join progress, cancellation, placement/memory bounds, setup transactions and server replacement. The final measured-rate suite passes 1,108 metadata expectations. Final docs, docs-impact, changelog and preview checks pass.
  • Earlier source-bound candidates demonstrate exact Qwen/Bonsai native batch waves and cancellation. c04 Qwen27 reaches actual widths 1/2/4/8 with exact outputs. These results retain their original candidate identities; they are not relabeled c05 passes.

The first c05 Qwen27 automatic endpoint run preserves one live API process, changes its setup, and observes native width four on both hosts; dedicated cancellation, context checks and cleanup pass. Its endpoint suite fails byte comparisons spanning the old and new plans. That failure remains recorded. A later same-plan steady-repeat harness is separate from the c05 source snapshot and cannot convert that run into a full pass.

This remains a draft. No model is marked fully qualified by this PR. Gemma cross-chip prefill arithmetic, complete MiMo mode/paging validation, final automatic steady-state equality, per-family memory lifecycle evidence and useful throughput remain open. GLM 5.3 Flash and Flint are excluded from this validation. Coalescing has demonstrated wider execution, not a controlled absolute speed improvement. The Bonsai FP32 correction has a measured large-prefill cost that still needs full-model timing.

Independent source and behavior-preserving refactor reviews found no remaining issue in the frozen constituent patches after the reported fixes. Full integration/hardware gates remain separate. This draft does not publish or activate a release.

Base dependency: two-Mac foundation PR #1407. This is a new draft on that foundation branch. It pins companion SDK commits 6d432b0960d8636d43db0aea68747d09cab3e236 and b1f007a552f0d8310536274bd22c20f7c865a480; the companion drafts are MLX-Swift-LM #343 and MLX-Swift #61.

Fresh c05 GPT-OSS evidence: 8 short and 12 long numerical cases pass; native paged concurrency waves 1/2/4/8 match solo exactly. Both installed endpoint reports pass 36 checks with zero failures and two explicit skips, and cancellation/context pass. The complete automatic session fails: it remains at one lane with no setup transition; the stable multi-lane gate and automatic lifecycle gate fail. Endpoint success is not evidence of automatic batching.

Repository validation entry points:

swift build --package-path provider-swift -c release --jobs 4 -Xswiftc -DDEBUG
bash libs/darkbloom-cluster/Tests/PlacementChecks/run.sh
bash provider-swift/Tests/ClusterInstalledSessionChecks/run.sh
make docs-check
make docs-impact-check BASE=030fa64b3179a2e9f603fdd5f8f6d0f2e9c99311
make changelog-check
make changelog-preview

The build and focused checks were executed using isolated pinned scratch closures; these are the repository entry points for rerunning them. The publication commit contains one documented EOF-whitespace normalization in GPTOSSBatchSettings.swift; c05 was built before that whitespace-only edit.

Evidence identity SHA-256
candidate-c05/recursive-source.json d3844e0c974973e2b0df3a2cc2c38ebcf740c98036307de0b19616729a0cfef1
c05-focused-cpu-integration-receipt.json ba4129f01f872e79393e00928b1f96a4116bb8bf74ecbf16c73d1779c02429f1
c05-final-doc-checks.json e296140397072ac73683fe55416e6517364001175ef9a2a6087108831afff0aa
product/gptoss-c05-automatic-01/session.json aa6fcb118b9b6fd40f5cdf3f307ce7b12b6906ddcaafbc4bea72ccea2a3b285c

Qwen 3.6 tensor parallel retains a negative 16K M3-leader record (7/5 ULP versus the unchanged threshold4); the failed orientation is withheld. GPT-OSS native concurrency8 reached observed native width6, not8. GPT-OSS full-artifact logs currently establish paged backend selection and teardown but do not expose per-request page-growth counters. GLM-specific and Flint code paths were not exercised; shared changes do not imply their compatibility has been requalified.

Publication follow-up: the SDK sources were formatted with their required Swift formatter, and the SDK fork ownership inventory was completed. The root now pins those signed follow-ups. Hardware c05 evidence was collected before these formatting and metadata changes; fresh CI for the published pins is a separate check.

Current acceptance scope: tensor parallel is required for every included non-GLM/non-Flint model, retaining every capability supported by the exact artifact and standalone serving path. Pipeline results are partial evidence and cannot replace a tensor-parallel pass. Phase-split tests are excluded. Existing text and unsupported-input refusal tests do not establish vision, audio or other capability retention; those gates remain open.

CI follow-up fixes real standalone/cluster HTTP differences: both paths now normalize the same supported request forms, forward explicit min_p, and use request-owned reasoning/logprob decorations. Updated contract tests follow the existing bundled qualification records and current thinking-off policy; no excluded-model runtime is changed. The unchanged baseline reproduced all seven family parity failures. The repaired 875-source ProviderCore closure passes 20 focused test definitions across three suites, including all seven family parameterizations, followed by 20 consecutive successful repeats. Independent review verified the exact 11-file patch (72071a708eb9034876a5b3e22e786743d1350f3d750ee4f9bd73f77c05341cda) and the two separate stale-test corrections. Docs-impact, docs lint and changelog checks pass.

The HTTP capture fixtures use fabricated capable engines. Native logprob support is not established. Multi-token SSE retains an unresolved per-content-frame association issue: ordered values are complete in the focused test, but asynchronous draining may attach them to an earlier content frame. The earlier strict failure is retained; no comparator field or tolerance was weakened. New remote CI for the published follow-up remains a separate gate.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
d-inference Ready Ready Preview Oct 23, 2026 2:59pm UTC
d-inference-console-ui-dev Ready Ready Preview Oct 23, 2026 2:59pm UTC
d-inference-landing Ready Ready Preview Oct 23, 2026 2:59pm UTC
darkbloom-status Ready Ready Preview Oct 23, 2026 2:59pm UTC
eigen-homepages-darkbloom Ready Ready Preview Oct 23, 2026 2:59pm UTC

Request Review

This branch was successfully deployed

5 active deployments
Preview – d-inference — aa5aa376 Deployed Oct 23, 2026 by vercel[bot]
Preview – d-inference-landing — aa5aa376 Deployed Oct 23, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — aa5aa376 Deployed Oct 23, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — aa5aa376 Deployed Oct 23, 2026 by vercel[bot]
Preview – darkbloom-status — aa5aa376 Deployed Oct 23, 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