Skip to content

chore: adopt MLX core 0.32.2 across the inference stack - #790

Merged
Gajesh2007 merged 1 commit into
masterfrom
chore/adopt-mlx-0.32.2
Aug 31, 2026
Merged

Gajesh2007 merged 1 commit into
masterfrom
chore/adopt-mlx-0.32.2

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Adopts the already-merged MLX 0.32.2 upgrade into the serving stack:

Why

Our previous core pin was 33 commits behind v0.32.0, plus the 279 commits to v0.32.2. That range is dense with kernels aimed at exactly our B=1–5 decode workload (geometry verified from served checkpoint configs):

  • GQA-8 decode attention reads each K/V byte once (mlx#4077) — Qwen 3.5/3.6 35B are 16:2 heads and GPT-OSS 20B is 64:8, all GQA-8
  • Fused full-attention path for head_dim 256 on NAX (mlx#3842) — both Qwen 35Bs; supersedes our hand-ported perf/head256-fused-attention branches
  • qmv_wide / gemv_wide few-row matmul kernels + raised qmv batch limit on M5-class GPUs (mlx#3764, #3888, #3791) — supersedes the hand-ported qmv_wide on darkbloom-base
  • Quantized-MoE NAX matmul improvements (mlx#4352, #4171, #4023)
  • Correctness riders: dequantize-in-fp32 (#4241), qmm floor fix (#4251), qmm_n_nax re-disable + group_size<64 fix (#4202; we ship g64), thread-safe compile-cache erase (#4248) plus the fork's CompileCacheRegistry
  • Head-dim-72 Metal full attention (mlx#4330) — compounds with the vision-tower fused-SDPA work in Layr-Labs/mlx-swift-lm (perf/vlm-vision-batch)

Content of the new core pin was verified against the upstream v0.32.2 tag: git diff v0.32.2 <pin> shows exactly the 16-file darkbloom set (E=256 expert-tile route, Gemma 4 expert-QMM tile kernel, Metal buffer-count bounds, gpu::eval UAF fix, resource-count telemetry, compile-cache registry) and nothing else.

Verification

  • swift build -c release of provider-swift against the new pins: clean.
  • make provider-test (2,294 tests in 236 suites, source-matched metallib): all pass. A first run under heavy parallel build load had 2 flaky failures; the identical suite is clean on rerun.
  • mlx-swift-lm × new mlx-swift compiles and passes tests locally: its Package.swift tracks Layr-Labs/mlx-swift main (= 6b0505c since 8/25), and this branch's provider release build, the full provider test suite, and an lm SPM test build all compiled lm against it. Note the lm fork's "Build and Test" workflow currently hits startup_failure on every recent branch, so no fork CI has actually exercised the combination — the local runs above are the evidence.
  • B=1–4 before/after sweep on qwen3.6-35b-a3b-vl-mtp-mxfp8 (darkbloom benchmark --sweep) to follow as a PR comment; the benchmarks workflow also runs on this PR.

Follow-ups (not this PR)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Bk1FuSDRgDnyQUrgJj9VHF

Bump libs/mlx-swift to 6b0505c (fork main, PR #16: vendored MLX/MLX-C at
0.32.2 + regenerated JIT sources) and libs/mlx to 734241bb (fork main,
PR #10: the 0.32.2 core squash carrying the darkbloom patch set).

Content of the new core pin vs the previous darkbloom-base line, verified
against the upstream v0.32.2 tag: identical to v0.32.2 plus the 16-file
darkbloom set (E=256 expert-tile route, Gemma 4 expert-QMM tile kernel,
Metal buffer-count bounds, gpu::eval UAF fix, resource-count telemetry,
thread-safe CompileCacheRegistry). The hand-ported qmv_wide on
darkbloom-base is superseded by upstream's real kernel inside 0.32.2.

What the serving stack gains at B=1-5 (geometry verified from served
checkpoint configs): read-each-K/V-byte-once GQA-8 decode attention
(Qwen 3.5/3.6 35B are 16:2 heads, GPT-OSS 20B is 64:8), a fused
full-attention path for head_dim 256 on NAX (both Qwen 35Bs), qmv_wide/
gemv_wide few-row matmuls, quantized-MoE NAX matmul improvements, and the
raised qmv batch limit on M5-class GPUs, plus the dequantize-in-fp32 and
qmm floor correctness fixes.

libs/mlx .gitmodules branch moves darkbloom-base -> main: PRs #10/#16
made main the integration line; darkbloom-base remains as the legacy
pre-0.32.2 base.
@vercel

vercel Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
d-inference Ready Ready Preview Aug 31, 2026 5:40am
d-inference-console-ui-dev Ready Ready Preview Aug 31, 2026 5:40am
d-inference-landing Ready Ready Preview Aug 31, 2026 5:40am

Request Review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-31T05:41:59.339690Z d540c6d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Gajesh2007

Copy link
Copy Markdown
Member Author

Local B=1/B=4 before/after bench: prepared but deferred — the host was running other workloads during the window (BenchCBv2 itself flagged HOST CONTENDED, numbers suspect at load 34.5), so no numbers worth trusting yet. The E2E Benchmarks workflow on this PR will post CI numbers.

A clean local A/B is staged and ready on a quiet machine — both sides are built with source-matched metallibs, same mlx-swift-lm commit (81dd564), differing only in the core:

  • old core (606d28c → mlx 0a725e30): .claude/worktrees/bench-baseline/libs/mlx-swift-lm
  • new core (6b0505c → mlx 734241bb): .claude/worktrees/adopt-mlx-0322/libs/mlx-swift-lm
cd <side>/libs/mlx-swift-lm
./.build/release/BenchCBv2 \
  --model ~/.cache/huggingface/hub/models--EigenLabs--Qwen3.6-35B-A3B-MLX-VL-4bit-g64-router8-mtp/snapshots/baseline-work \
  --mode perf --batches 1,4 --steps 64 --prompt-lengths 512 --label <old-core|new-core>

This same run doubles as the E=256-expert-tile-route re-check flagged in the PR description.

Separately: the Threat Model Review check fails in 9s with anthropic.AuthenticationError: 401 API key is invalid — a repo secret issue, not specific to this PR.

@Gajesh2007

Copy link
Copy Markdown
Member Author

Caveat on the bench repro above: the one BenchCBv2 execution under contention printed the ## Performance header but no table, and the pipeline masked its exit code — so treat the staged A/B as unvalidated until a quiet-host run confirms a table appears (check echo $?). A concurrent session on this machine also recorded a BenchCBv2 SIGTRAP at B=8 on qwen; this A/B uses B=1,4, but if the quiet run trips the same way, fall back to the E2E Benchmarks numbers on this PR.

@antojoseph antojoseph left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@Gajesh2007
Gajesh2007 merged commit 64b80eb into master Aug 31, 2026
18 of 20 checks passed
@Gajesh2007
Gajesh2007 deleted the chore/adopt-mlx-0.32.2 branch August 31, 2026 07:05
Gajesh2007 added a commit that referenced this pull request Aug 31, 2026
…60822

Brings the test-suite refactor up to date with the 22 commits master
gained since the last sync (#700-#790: Qwen3-VL and Qwen3.8 serving,
first-content deadline admission, MTP-in-the-weights, serial-number
privacy, MLX core 0.32.2, usage-checkpoint fixes).

Every master-side test added or modified inside files this branch
deletes, splits, or rewrites was re-homed into the refactor's successor
suites and lanes rather than dropped, including:

- PrefillDeadlineProductionConfigTests and the Qwen required-tool-choice
  tests into the slimmed EngineV2ProductionWiringTests
- bridgeDeadlineRefusalReleasesRealStaging into
  SSDPrefixCacheReservationTests
- excludesInferenceControls into WatchdogRecoveryTests
- the rewritten #777 MTP config/beta suites into ConfigTests and
  BetaFeaturesTests (MTPConfigTests stays deleted)
- vision/DeepStack/media additions into the split EngineV2Vision* and
  MediaIngest suites
- the #704 writeDeferred provider-writer tests, first-content-budget
  wire test, #730 serial-privacy subtests, and #752 benchmark-control
  tests into their branch successors

Master-added test files were audited against the lane architecture:
the Qwen3.8 production canary trio moved to Live/ (with a #filePath
depth fix), SchedulerPrefillDecision's real-weights suite split out to
Probes/ behind its per-probe gates, and hermetic additions stay in the
default lane. docs/developer/test.md updated to match.

Production-code unions of note: registry.go keeps both the branch's
PrivateOnly/catalog public-listing gates and master's per-model
capability gating; provider_writer.go carries both determinism-seam
families; LaunchAgent forwards the union of both env allowlists;
postgres_model_registry.go extends nil-canonicalization to master's new
required_provider_capabilities column. The branch-side prefill-keepalive
tests were dropped with the feature master removed in #704.

Two master-branch interaction defects fixed so the merged tree is green:
the store contract harness now re-seeds the usage_totals counter row its
truncate wipes (the #665 migration guard treats the bare marker as
corruption), and the #730 log-report migration test restores the pooled
connection's search_path before release.

Submodules: mlx-swift and mlx-swift-lm test branches merged with
master's 0.32.2-era pins; relocated suites verified present.

Verified: go vet + full coordinator/testbed tests green; store contracts
green twice consecutively against real Postgres 16; swift build
--build-tests clean; default Swift lane 2,264 tests in 248 suites all
passing.

This branch had an error being deployed

1 failed and 3 active deployments
Preview – d-inference — d540c6d4 Deployed Aug 31, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — d540c6d4 Deployed Aug 31, 2026 by vercel[bot]
Preview – d-inference-landing — d540c6d4 Deployed Aug 31, 2026 by vercel[bot]
benchmarks — d540c6d4 Deployed Aug 31, 2026 by Gajesh2007 via E2E Benchmarks #564
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.

2 participants