Skip to content

chore(mlx): bump pin to 9a795735 and rebase the four drifted overlays - #1198

Merged
inureyes merged 1 commit into
mainfrom
chore/mlx-pin-9a795735
Aug 17, 2026
Merged

inureyes merged 1 commit into
mainfrom
chore/mlx-pin-9a795735

Conversation

@inureyes

Copy link
Copy Markdown
Member

Summary

Moves the pinned MLX C++ commit from 2c46b953 (2026-08-05) to 9a795735 (2026-08-17), 168 commits.

The pin has one source of truth, the GIT_TAG in src/lib/mlx-cpp/CMakeLists.txt (#1047), and both parsers accept the new value (scripts/ci/mlx_pinned_commit_test.sh and cargo test -p mlxcel-mlx-pin both pass). The synthetic SHAs in those parser fixtures are deliberately left alone: they exercise parser shape, not the live pin, and churning them would imply a coupling that does not exist.

Overlay reconciliation

This tree carries 21 whole-file overlays. Upstream touched four of those targets in this range, so those four are the entire job:

overlay target upstream commits our delta merge
mlx/ops.cpp (patches-cuda) 23 (286/151 lines) 46/11 clean
mlx/backend/cuda/jit_module.cpp 1 71/6 clean
mlx/backend/cuda/reduce/init_reduce.cu 1 13/3 clean
mlx/backend/cuda/matmul.cpp 1 80/108 1 conflict

The two Metal overlays (compiled.cpp, kernels/utils.h) are byte-identical upstream across the range and are untouched here.

The one conflict is in GatherMM::eval_gpu. Upstream #3929 widened the empty-input guard to out.size() == 0 || a_pre.size() == 0 || b_pre.size() == 0, on the same lines where our overlay had renamed a_pre/b_pre to a/b. Those names bind to inputs[0] and inputs[1] in our version, exactly what upstream calls a_pre/b_pre, so the resolution takes upstream's added condition under our names.

The check that this went right: each merged overlay's delta measured against the new base is the same +/- count it had against the old base. Upstream's changes came in and ours stayed. An overlay that silently reverts an upstream change is how #830 / #831 happened, which is what that check exists to catch.

mlx/backend/cuda/quantized/ is untouched upstream in this range and quantized/qmm/qmm.h is byte-identical, so the dispatch call sites the quantized.cpp overlay's header comment asks to re-verify on every bump needed no adjustment. That comment now records this range's finding instead of restating the previous bump's.

API changes that do not reach this tree

  • #4207 removed the astype(array, Dtype, std::optional<bool> copy, StreamOrDevice) overload. Every call site in mlxcel-core and mlx-cpp/turbo uses the two- or three-argument form, which is unchanged.
  • #4184 added a required endpoint parameter to linspace's primary overload and kept a defaulted inline one. Our single call site resolves to the latter.

Validation

Apple M5 Max, 40 GPU cores, 128 GB, macOS 26.6.1, Xcode 26.5. Metal only.

  • cargo build --release --features metal,accelerate: clean, 5m52s. The _deps/.mlx-build-commit marker advances to the new SHA.
  • The three in-tree fused Metal kernel launchers, which CLAUDE.md requires re-validating after every bump, all pass well inside their RMS < 5e-3 contract: sparse_v_kernel_threshold_zero_matches_graph; delegated_fused_kernel_matches_reference_over_200_steps at 1.7263e-4; delegated_steel_envelope_matches_cold_only_fused_over_200_steps at 1.5259e-4.
  • cargo fmt --check clean, cargo clippy --all-targets --features metal,accelerate -- -D warnings clean.
  • No test regression, established against a rebuilt old-pin baseline rather than assumed. Isolated and repeated three times on each pin, the failure sets are identical and deterministic: -p mlxcel --lib fails the same 13 tests, -p mlxcel-core --lib reports 1472 passed / 4 failed. All 17 pass under MLX_ENABLE_TF32=0 and are the pre-existing M5 reduced-precision class of fix(core): f32 matmul and single-query SDPA lose ~fp16 precision on M5, breaking four numeric tests #1065.

Two artifacts turned up while building that baseline and are worth naming so nobody re-derives them as findings. A whole-workspace cargo test run on the old pin took a SIGSEGV 198 tests into the mlxcel-core binary, which truncated it and made #1065's four tests look like new failures; five isolated runs of that binary on the old pin are 1472/4 every time. And models::phixtral::tests::the_prefill_is_causal_without_being_handed_a_mask passes under whole-workspace parallelism and fails in isolation on both pins. Whole-workspace runs on this hardware are not a stable comparison basis; the per-target runs above are.

Not validated here

The four merged overlays are CUDA-only and were neither compiled nor run on this machine. Per CONTRIBUTING.md the CUDA backend has no CI test gate at all (release.yml builds under --features cuda but runs nothing), so make verify-test-cuda on NVIDIA hardware, single-threaded, is the only gate they will get. mlx/ops.cpp is the one to look at first: it took 437 lines of upstream churn around a 46/11 delta, which is the largest merge in this bump.

Note for #1186 / #1187

use_qmv_wide is unchanged at the new pin (mode != "affine" || d.get_architecture_gen() >= 15), and so is the M >= 2 dispatch that consumes it, so the temperature-0 block-vs-chain break at T = 2 on generation 15+ survives this bump. The op-parity sweep confirms it: every quantized column still breaks at T = 2 on this host. Upstream main carries no knob to bypass that path, so #1187 cannot be closed by pinning forward.

get_qmv_batch_limit did change (#3791): generation 17 at a non-d architecture size now returns 33 / 25 / 13 by operand size, where the old code fell through to a default branch returning 14 / 10 / 6. That moves the second cliff, which #1186 currently documents at 10 for an M5 Max. The equal/diverges sweep cannot observe the move because use_qmv_wide already breaks at T = 2 here and hides the batch-limit region; it is visible only as a magnitude step in differing-byte counts. Measuring that needs a test change, so it is deliberately left out of this PR and filed as follow-up on #1186.

168 commits on from 2c46b953. Upstream touched only four of the 21 overlay
targets in that range, so the reconciliation is four three-way merges and
nothing else: matmul.cpp, jit_module.cpp, reduce/init_reduce.cu, and ops.cpp
through 23 commits. The two Metal overlays are byte-identical across the
range.

Three merged cleanly. matmul.cpp conflicted once, where #3929 added
out.size() == 0 to GatherMM::eval_gpu's empty-input guard on the same lines
our overlay renames a_pre/b_pre to a/b; the resolution takes upstream's
condition under our names. Each merged overlay's delta against the new base
is the same +/- count it had against the old one, so upstream landed and
ours survived.

quantized/ is untouched upstream here and qmm/qmm.h is byte-identical, so
the call sites that overlay's comment asks to re-verify needed no change.
The comment now records that instead of the previous bump's reasoning.

Validated on Apple M5 Max, Metal only. The three fused Metal kernel
launchers re-validate at RMS 1.7263e-4 and 1.5259e-4 against a 5e-3
contract. Isolated failure sets are identical at both pins over three runs
each, 13 in mlxcel and 4 in mlxcel-core, all pre-existing M5
reduced-precision failures that pass under MLX_ENABLE_TF32=0.

The four merged overlays are CUDA-only and were not compiled here.
@inureyes inureyes added type:chore Maintenance tasks (build, CI, etc.) priority:high High priority area:core mlxcel-core: MLX FFI, primitives, KV cache, layers platform:macos macOS (Apple Silicon) specific status:review Under review labels Aug 17, 2026
@inureyes
inureyes merged commit 4e414bd into main Aug 17, 2026
7 checks passed
@inureyes
inureyes deleted the chore/mlx-pin-9a795735 branch August 17, 2026 07:10
@inureyes inureyes self-assigned this Aug 27, 2026
@inureyes inureyes added status:done Completed and removed status:review Under review labels Sep 6, 2026
be-free-snowboy pushed a commit to freestylejs/snowbrain-mlxcel that referenced this pull request Oct 27, 2026
…lablup#1198)

168 commits on from 2c46b953. Upstream touched only four of the 21 overlay
targets in that range, so the reconciliation is four three-way merges and
nothing else: matmul.cpp, jit_module.cpp, reduce/init_reduce.cu, and ops.cpp
through 23 commits. The two Metal overlays are byte-identical across the
range.

Three merged cleanly. matmul.cpp conflicted once, where #3929 added
out.size() == 0 to GatherMM::eval_gpu's empty-input guard on the same lines
our overlay renames a_pre/b_pre to a/b; the resolution takes upstream's
condition under our names. Each merged overlay's delta against the new base
is the same +/- count it had against the old one, so upstream landed and
ours survived.

quantized/ is untouched upstream here and qmm/qmm.h is byte-identical, so
the call sites that overlay's comment asks to re-verify needed no change.
The comment now records that instead of the previous bump's reasoning.

Validated on Apple M5 Max, Metal only. The three fused Metal kernel
launchers re-validate at RMS 1.7263e-4 and 1.5259e-4 against a 5e-3
contract. Isolated failure sets are identical at both pins over three runs
each, 13 in mlxcel and 4 in mlxcel-core, all pre-existing M5
reduced-precision failures that pass under MLX_ENABLE_TF32=0.

The four merged overlays are CUDA-only and were not compiled here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core mlxcel-core: MLX FFI, primitives, KV cache, layers platform:macos macOS (Apple Silicon) specific priority:high High priority status:done Completed type:chore Maintenance tasks (build, CI, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant