Resolve MLX integer arguments to Python ints for MLX 0.32.2 - #2424
Merged
jessegrabowski merged 8 commits intoSep 18, 2026
Merged
Conversation
Co-authored-by: guillaume-osmo <guillaume@osmo.ai>
Co-authored-by: guillaume-osmo <guillaume@osmo.ai>
mx.argsort returns uint32 while the Op declares int64.
Co-authored-by: guillaume-osmo <guillaume@osmo.ai>
jessegrabowski
force-pushed
the
mlx-static-int-args
branch
from
September 18, 2026 09:14
d5cb2e0 to
10595cb
Compare
Member
Cast at the end in the dispatch? |
ricardoV94
reviewed
Sep 18, 2026
|
|
||
|
|
||
| @mlx_funcify.register(SortOp) | ||
| def mlx_funcify_Sort(op, node, **kwargs): |
Member
There was a problem hiding this comment.
Sort is still like old join with symbolic axis? We should open an issue to make it static in the Op
ricardoV94
approved these changes
Sep 18, 2026
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.
The MLX
Reshape,Sort/ArgSortandPaddispatches now pass their shape, axis andpad_widtharguments as Python ints. MLX 0.32.2 upgraded nanobind and stopped acceptingmx.arraywhere its API takesintorSequence[int], so every reshape, sort and pad raisedTypeErroron that version. Constant arguments are resolved once at funcify time, and symbolic ones are converted at call time through the existingcoerce_to_intpath from the Alloc dispatch.A symbolic shape, axis or
pad_widthstill cannot be used undermx.compile, which is the default linker setting. That case raises the sameMLX compilation limitationerror Alloc already raises, now worded for all of these arguments.ArgSorton MLX now returnsint64.mx.argsortreturnsuint32while the Op declaresint64.CI no longer pins
mlx<0.32. Theeightest compares eigenvectors up to column sign, since 0.32.2 flips them relative to numpy.Closes #2386. Closes #2391. Closes #2392. Supersedes #2395, #2398 and #2400.