Repository navigation
Bump mlx to 0.32.4 and nanobind to 3.1.0 - #41
Open
Wildebeest wants to merge 1 commit into
Open
Wildebeest wants to merge 1 commit into
Wildebeest wants to merge 1 commit into
Conversation
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.
Summary
Upgrades
mlxfrom0.32.0to0.32.4andnanobindfrom2.13.0to3.1.0:mlx==0.32.4(engine/pyproject.toml):g13–g16+ M5g17NAX) kernel improvements between0.32.0and0.32.4, including faster quantized MoE (SwitchGLU) /gather_qmm/ SDPA prefill kernels, the Metal concurrent fence deadlock fix (ml-explore/mlx#3469), and the NAX>32Kprompt token integer-overflow fix (ml-explore/mlx#3492).nanobind==3.1.0(engine/pyproject.toml):mlx==0.32.4wheels are built againstnanobind 3.1.0(ml-explore/mlx#3512). Bumping the build-system requirement from2.13.0to3.1.0keepsengine/native/grammar_native.cpp'snb::ndarraytype-caster ABI matched withlibmlx.mx.random.statecompatibility (engine/src/rec_mlx/kernels/masked_sampling.py,engine/tests/validate_resident.py):mlx>=0.32.2(ml-explore/mlx#3495),mx.random.statereturns a read-only tuple rather than a mutable list, somx.random.state[0] = keyraisesTypeError: 'tuple' object does not support item assignment.uint32Threefry key[hi, lo]viamx.random.seed((int(hi) << 32) | int(lo))constructs the identicalmx.random.keystate (mx.array([hi, lo], dtype=mx.uint32)) and preserves exact EOS RNG truncation parity.Benchmarks & Testing
Measured on
flint-int4(Apple Silicon Metal, 64 GB unified memory, 128-token greedy decode after cold prefill):mlx==0.32.0TTFTmlx==0.32.4TTFTmlx==0.32.0Prefillmlx==0.32.4Prefill1.89 s1.46 s546.6 tok/s716.2 tok/s7.10 s5.71 s578.1 tok/s719.5 tok/s7.07 s5.79 s580.7 tok/s708.7 tok/s15.14 s12.24 s541.6 tok/s670.1 tok/s15.03 s12.27 s545.5 tok/s668.9 tok/sTested:
cd engine && .venv/bin/pytest -v -rs: 66 passed, 1 skipped (including native_grammar_nativeC++ extension rebuild andm4_max_prefillMetal kernel compilation check)make test-engineruntime packaging (packaging/build-mlx-runtime.pyon standalone CPython 3.12.12,tests/smoke_test.py, andtests/protocol_test.py): all passedengine/tests/validate_resident.py: 61 / 61 numerical parity cases, 9 / 9 EOS truncation RNG checks, and 3 / 3 cancellation checks passuvx ruff@0.17.1 checkanduvx ruff@0.17.1 format --check: clean