Skip to content

update: advance MLX pin to 6371f1ce - #3685

Open
hephaex wants to merge 5 commits into
lablup:mainfrom
hephaex:upgrade/mlx-pin-6371f1ce
Open

hephaex wants to merge 5 commits into
lablup:mainfrom
hephaex:upgrade/mlx-pin-6371f1ce

Conversation

@hephaex

@hephaex hephaex commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Advances the pinned ml-explore/mlx commit from 5a48f9cc (2026-11-28) to 6371f1ce (2026-11-29) — 14 upstream commits. No other file stores this value; both parsers still read only the GIT_TAG line.

Overlay reconcile

Drift was measured rather than assumed: of the 52 overlays carrying a Modified from upstream MLX <sha> declaration, two lie on files upstream changed in this range, for four upstream commits total. Both were 3-way merged (git merge-file, base = old pin, theirs = new pin).

overlays/metal/mlx/backend/metal/matmul.cpp — three upstream commits:

  • #4961 "Use 32x32 tiles in the steel GEMM for small M" — the alignment precondition gains mat_ld % 4 == 0 and all_aligned(mat_batch_stride, 4), and the register-tile pass count becomes tile_cap = (out.dtype() == float32) ? 4 : 5; int passes = ceildiv(M, tile_cap);.
  • #4977 "Enable FP32 gemv_wide for small M" — float32 joins the eligible dtypes.
  • #5018 "Fix gemv_wide dtype eligibility check" — the guard changes from || to &&. The previous form was always true for any dtype, so the eligibility check never rejected anything.

The mlxcel delta is preserved: the generations-13/14 dense-GEMV branch and dense_gemv_row_limit() are untouched, and the merged file still carries the // Patched by mlxcel: few-row dense products keep GEMV on GPU generations 13/14. header.

overlays/cuda/mlx/backend/cuda/layer_norm.cu — one upstream commit, #5014 "Fix tail vector indexing in layer_norm_vjp" (wn[i] → wn[i - index * N_READS]). The overlay already carried that exact fix as mlxcel#2759, so the merge output is byte-identical to what was there; only the base declaration moves. Worth noting for review: upstream and mlxcel independently found the same tail-indexing bug.

overlays/rocm/UPSTREAM — retargeted_to_mlx_pin advanced to the new pin. No primitives were added upstream in this range (mlx/primitives.h and primitives.cpp are unchanged between the two pins), so no new NO_GPU stub is required and LOCAL_FIXES needs no entry.

Post-merge drift check across all 52 declared overlays against 6371f1ce: 0 commits.

Validation

$ bash scripts/ci/mlx_pinned_commit.sh
6371f1ce724c2b48928fe5e2c32d5d16266d8c45

$ bash scripts/ci/mlx_pinned_commit_test.sh
all cases passed            # 13 cases, including short_sha/uppercase_sha/branch_name -> rejected

$ cargo test -p mlxcel-mlx-pin
test result: ok. 60 passed; 0 failed            # unit
test result: ok. 1 passed; 0 failed             # cross_parser

$ bash scripts/mlxcelverse/rocm_overlay_test.sh
rocm_overlay_test: OK (29 checks)

$ cargo build --features metal
Finished `dev` profile [unoptimized + debuginfo] target(s) in 5m 39s

The build is the load-bearing check here: it fetches and compiles MLX at the new pin, so the merged overlays compile against upstream's new signatures rather than merely applying cleanly.

Targeted runtime checks on M1 Pro at 6371f1ce:

$ cargo test -p mlxcel-core --lib gemv
test result: ok. 2 passed; 0 failed

$ cargo test -p mlxcel-core --lib layer_norm
test result: ok. 2 passed; 0 failed

Full cargo test -p mlxcel-core --lib → 2613 passed, 2 failed:

cache::turbo::codebook::tests::device_boundary_indices_match_host_at_the_edges
cache::turbo::quant::device_tests::device_pack_handles_boundary_ties_and_extremes

Both are pre-existing and not caused by this bump. I attributed them rather than assuming: with GIT_TAG reverted to 5a48f9cc and the tree rebuilt (3m 28s), both fail identically. They are left unfixed here to keep the bump reviewable, and they are separate from the pin (cache::turbo device-vs-host index agreement, not an MLX API change).

Not validated

  • No CUDA or ROCm compile. This machine is an M1 Pro with no GB10 or AMD host. layer_norm.cu and the ROCm overlay retarget are text-level only: the merge is clean and the ROCm overlay harness passes, but no nvcc/hipcc build ran. Per the update: advance MLX pin to 5a48f9cc #3517 precedent, a GB10 run should confirm both before merge.
  • No greedy-generation or benchmark comparison against the old pin. update: advance MLX pin to 5a48f9cc #3517 validated numerics on M3 Ultra with model runs; this PR does not, because the perf-relevant change here (#4961/#4977) targets small-M steel GEMM shapes and would need a model run to be meaningful.

Given that, this PR is not asserting a performance improvement — it is asserting that the pin advances without breaking the build, the overlays, or the parser contracts. The two small-M Metal changes are best confirmed by whoever has a GB10 or an M3+ host to run them on.

Refs #1047

Moves the pinned upstream MLX commit from `5a48f9cc` (2026-11-28) to
`6371f1ce` (2026-11-29), 14 upstream commits. No other file stores this
value; both parsers still read only this line.

Drift was measured rather than assumed: two declared overlays lay on changed
upstream files, and both were rebased onto the new pin.

- `overlays/metal/mlx/backend/metal/matmul.cpp` — three upstream commits
  (#4961 32x32 tiles for small M, #4977 FP32 gemv_wide, #5018 dtype
  eligibility). 3-way merged; the mlxcel generations-13/14 dense-GEMV branch
  is preserved and `gemv_wide_config` now rejects non-float dtypes with `&&`
  instead of the previous always-true `||`.
- `overlays/cuda/mlx/backend/cuda/layer_norm.cu` — #5014 tail vector
  indexing in `layer_norm_vjp`. The overlay already carried that exact fix as
  mlxcel#2759, so only the base declaration moves; no code delta.
- `overlays/rocm/UPSTREAM` — `retargeted_to_mlx_pin` advanced. No new
  primitives were added upstream in this range, so no ROCm stub is needed.
- Drift check across all 52 declared overlays against `6371f1ce`: 0 commits.

Verified:
- `scripts/ci/mlx_pinned_commit.sh` → `6371f1ce724c2b48928fe5e2c32d5d16266d8c45`
- `scripts/ci/mlx_pinned_commit_test.sh` → all 13 cases passed
- `cargo test -p mlxcel-mlx-pin` → 60 passed, 1 cross-parser passed
- `scripts/mlxcelverse/rocm_overlay_test.sh` → OK (29 checks)
- `cargo build --features metal` → Finished, MLX compiles at the new pin
- Full `cargo test -p mlxcel-core --lib` → 2613 passed, 2 failed. Both
  failures (`cache::turbo::codebook::tests::device_boundary_indices_match_host_at_the_edges`,
  `cache::turbo::quant::device_tests::device_pack_handles_boundary_ties_and_extremes`)
  reproduce identically at the old pin `5a48f9cc`, so they are pre-existing
  and not caused by this bump. Left unfixed here to keep the bump reviewable.

Refs lablup#1047
`make verify-rocm-overlay` failed in CI on lablup#3685 while `rocm_overlay_test.sh`
alone passed locally. The target runs `rocm_overlay.py records` first, which
compares the residual against the pin byte-for-byte, and I advanced
`retargeted_to_mlx_pin` without regenerating `CORE_RESIDUAL.diff`. That was a
skipped step in the documented procedure, not a false positive.

The new residual picks up `CMakeLists.txt`, which the fork's core overlay now
carries a delta for: upstream #5002 turns the Windows GGUF guard into an
`MSVC` test, and #5003 drops the `MLX_BUILD_PYTHON_BINDINGS` condition so
`CMAKE_INSTALL_BINDIR` is `.` for every Windows build. Reconstructed from pin
plus fork with no merge conflict, so this is upstream follow-through rather
than a local fix -- recorded anyway because `records` requires a
`LOCAL_FIXES.md` note for every residual file. Added as item 81.

Verified:
- `python3 scripts/mlxcelverse/rocm_overlay.py records` ->
  `records OK: 114 backend + 16 core files, 81 LOCAL_FIXES entries,
  11 core files with a noted residual, pin 6371f1ce`
- `make verify-rocm-overlay` -> all five steps pass (records, the tool's own
  29 negative cases, allocator ownership, runtime dir, hsaco cache)

Refs lablup#1047
Moves the pinned upstream MLX commit from `5a48f9cc` (2026-11-28) to
`6371f1ce` (2026-11-29), 14 upstream commits. No other file stores this
value; both parsers still read only this line.

Drift was measured rather than assumed: two declared overlays lay on changed
upstream files, and both were rebased onto the new pin.

- `overlays/metal/mlx/backend/metal/matmul.cpp` — three upstream commits
  (#4961 32x32 tiles for small M, #4977 FP32 gemv_wide, #5018 dtype
  eligibility). 3-way merged; the mlxcel generations-13/14 dense-GEMV branch
  is preserved and `gemv_wide_config` now rejects non-float dtypes with `&&`
  instead of the previous always-true `||`.
- `overlays/cuda/mlx/backend/cuda/layer_norm.cu` — #5014 tail vector
  indexing in `layer_norm_vjp`. The overlay already carried that exact fix as
  mlxcel#2759, so only the base declaration moves; no code delta.
- `overlays/rocm/UPSTREAM` — `retargeted_to_mlx_pin` advanced. No new
  primitives were added upstream in this range, so no ROCm stub is needed.
- Drift check across all 52 declared overlays against `6371f1ce`: 0 commits.

Verified:
- `scripts/ci/mlx_pinned_commit.sh` → `6371f1ce724c2b48928fe5e2c32d5d16266d8c45`
- `scripts/ci/mlx_pinned_commit_test.sh` → all 13 cases passed
- `cargo test -p mlxcel-mlx-pin` → 60 passed, 1 cross-parser passed
- `scripts/mlxcelverse/rocm_overlay_test.sh` → OK (29 checks)
- `cargo build --features metal` → Finished, MLX compiles at the new pin
- Full `cargo test -p mlxcel-core --lib` → 2613 passed, 2 failed. Both
  failures (`cache::turbo::codebook::tests::device_boundary_indices_match_host_at_the_edges`,
  `cache::turbo::quant::device_tests::device_pack_handles_boundary_ties_and_extremes`)
  reproduce identically at the old pin `5a48f9cc`, so they are pre-existing
  and not caused by this bump. Left unfixed here to keep the bump reviewable.

Refs lablup#1047
`make verify-rocm-overlay` failed in CI on lablup#3685 while `rocm_overlay_test.sh`
alone passed locally. The target runs `rocm_overlay.py records` first, which
compares the residual against the pin byte-for-byte, and I advanced
`retargeted_to_mlx_pin` without regenerating `CORE_RESIDUAL.diff`. That was a
skipped step in the documented procedure, not a false positive.

The new residual picks up `CMakeLists.txt`, which the fork's core overlay now
carries a delta for: upstream #5002 turns the Windows GGUF guard into an
`MSVC` test, and #5003 drops the `MLX_BUILD_PYTHON_BINDINGS` condition so
`CMAKE_INSTALL_BINDIR` is `.` for every Windows build. Reconstructed from pin
plus fork with no merge conflict, so this is upstream follow-through rather
than a local fix -- recorded anyway because `records` requires a
`LOCAL_FIXES.md` note for every residual file. Added as item 81.

Verified:
- `python3 scripts/mlxcelverse/rocm_overlay.py records` ->
  `records OK: 114 backend + 16 core files, 81 LOCAL_FIXES entries,
  11 core files with a noted residual, pin 6371f1ce`
- `make verify-rocm-overlay` -> all five steps pass (records, the tool's own
  29 negative cases, allocator ownership, runtime dir, hsaco cache)

Refs lablup#1047
# Conflicts:
#	src/lib/mlxcelverse/overlays/rocm/CORE_RESIDUAL.diff
#	src/lib/mlxcelverse/overlays/rocm/LOCAL_FIXES.md

This branch has not been deployed

No deployments
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