Repository navigation
Conversation
This branch has not been 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.
Motivation
MLX has released v0.32.5 (2026-11-25), the first release with ml-explore/mlx#4791 (the 4D gates of
gated_delta_updatethat Ming3 needs), so the runtime no longer has to build from a main commit. One of the two patches we carry, ml-explore/mlx#4860, is in the release and can go; the other, ml-explore/mlx#4852, is still open upstream.Modifications
Pin:
fc344c986c(main, 2026-11-06) → the v0.32.5 release, commitcfc675e9e5.build_runtime.shstill fetches by commit hash, with the tag in a comment, so a moved tag cannot change the build. MLX is still built from source, because the release wheels cannot carry Reuse in-flight Metal buffers on the same stream ml-explore/mlx#4852.5598dfa0aereviewed below, then [CUDA] Synchronize LayerNorm reduction scratch reuse ml-explore/mlx#4866 (CUDA only) and Fix macOS 14 build ml-explore/mlx#4960 (FP8 conversion in the CPU backend for deployment targets below macOS 15; we build for 15.0). Neither touches a file the patch changes.version.hsays 0.32.5, so CMake's version check and the cookbooks do not change. The Mac CI cache key hashesbuild_runtime.shand the patches, and the build directory is named after the commit and the patch set's hash, so both change by themselves.Voxt/NOTICEnames the release.Patches in
scripts/mlx-patches/:qmv_mma)5598dfa0aeand is mergeable, with the same added and removed lines as our patchThe rebase of ml-explore/mlx#4852 had two conflicts, both with ml-explore/mlx#4885 (allocator statistics under the mutex): a new function in
mlx/allocator.hnext to the patch'sAllocationScope, and the new assert inMetalAllocator::free. The added and removed lines of the patch are unchanged. I kept ml-explore/mlx#4885's assert after the patch's early return, whereactive_memory_is updated.Runtime code: no change. Our sources have no custom Metal kernels and no
mlx/backendincludes (onlymlx/mlx.handmlx/memory.h), so nothing else depends on the pin. The whole runtime and all five test targets compile against the new one.Static review of the upstream commits
I read the diffs of the commits that touch the Metal backend, the allocator, the scheduler, eval, compile, the ops and the fast ops. Of the CUDA, CPU kernel, docs, CI and Windows commits I only looked at the title and file list. None of this is measured: the directions below are read from the diffs and from the upstream PRs' own numbers, which are for other machines and other models.
Our shipped build has deployment target macOS 15.0, for which MLX compiles no NAX kernels (
Building without NAX kernelsin the build log). Everything below that only concerns NAX is therefore not reached by Voxt.qmv_mmafor 2/3/5/6 bits, and from N * K = 2^20 on gen 15+qmv_mmafrom 4 rows on M1 and M2 Ultra, which had kept the vector kernelsqmv_mmaon M3 Ultra and newer for layers with N and K of at least 4096; on NAX from 4 rows for 4-bitconfig.json); I did not check the other models' sizes. NAX is not builtx @ Wwith W stored[in, out](gemv_t)Checkpoint::Linearand the LSTMs transpose their weights, and Ming3's MoE gate is a transposed view, whichcheck_transposereports as transposed: I found no path to this kernelwait_for_capacityis called for each evaluated array and now locks the allocator mutex to compare active memory while tasks are in flightquantizeallocation,MLX_METAL_RUNTIME_COMPILEswitchfast.cppchanges are the bool mask conversion behindsupports_bool_mask(), which is true on Metal, andwindow_sizein the SDPA VJP primitivel2_normPossible regressions to look at:
is_main_thread()is now true for the process's main thread, not for the first thread that used MLX. Our servers load and run on other threads (the loader, the worker, and civetweb's threads for the VAD), so MLX no longer treats any of them as main: their command encoders are all thread-local. The servers leave throughstd::_Exit, so those encoders are not torn down at shutdown. The CPU streams' error check on enqueue, which only the main thread does, no longer happens there; errors still surface when an array or a stream is waited for. I did not trace which thread each server touches MLX on first, and Mac CI's stub server loads no model, so one real request per server kind is worth a check.Minimum macOS does not change.
Related Issues
Follow-up to #4181.
Accuracy Test
Not run. This is a pin update; no test, transcription check or golden comparison was run on any machine. The last accuracy numbers are in #4181, for the old pin.
Benchmark & Profiling
Not run. The table above is a reading of the diffs, not a measurement. The speed-relevant points for a later run are the DFlash verify blocks on Ultra machines and the allocator mutex on the decode loop.
Compiled only, on an M4 Air (macOS 27 SDK, Release):
build_runtime.shfrom a clean work directory with v0.32.5 and the patch (deployment target 15.0): MLX and the whole runtime build and install.stub_server,audio_chunk_test,ming3_mtp_probe,fishaudio_drama3_experts_testandfishaudio_drama3_codec_testalso link.5598dfa0aewith the same patch; I did not repeat it on v0.32.5, whose two extra commits do not touch the Metal backend (the shipped build does not use NAX).Checklist
.patchfiles are excluded from pre-commit, so nothing else needed formatting.)MLX-only change: Mac CI needs the
run-mac-cilabel. The first run has no cached MLX build and compiles MLX first.🤖 Generated with Claude Code