Repository navigation
Catch prism up with ml-explore/mlx-swift main (4 commits past 0.33.0) - #31
Merged
Merged
Conversation
…#517) Since ml-explore#502 every macOS build whose SDK ships <infiniband/verbs.h> links the JACCL distributed backend (RDMA over Thunderbolt 5), and dead stripping cannot remove it: `distributed::init("any")` reaches `jaccl::init`, and `MLXDistributed.Group` and the sharded MLXNN layers keep that path alive. An app that never forms a Thunderbolt cluster has no way to opt out. On a minimal MLX + MLXNN executable (release, stripped) the backend costs 1,065,280 bytes, 841 KB of them `__text`. Add a `JACCL` package trait, enabled by default, so an app can leave it out with `traits: []`: - `Package.swift` declares the trait and defines `MLX_USE_JACCL` for Cmlx when it is enabled. SwiftPM passes traits to Swift targets only, so C++ needs the explicit define. - `jaccl_conditional.cpp` requires `MLX_USE_JACCL` and compiles the `no_jaccl.cpp` stub otherwise. - `Cmlx.xcconfig` always defines `MLX_USE_JACCL`, so the Xcode project and its xcframeworks build as before. - `install.md` documents the trait and that SwiftPM enables the union of the traits that dependents request. The define follows the `MLX_USE_ACCELERATE` naming. Default on keeps the behaviour of ml-explore#502. The define states only the choice; platform and SDK gating stay in `jaccl_conditional.cpp`, so iOS, tvOS and visionOS keep building the stub whatever the trait. The CMake build keeps mlx's own JACCL gating.
* switch some tests to Swift Testing - migrate off of xctest onto swift testing - this is round 1
…sults (ml-explore#518) * fix callers of mlx_vector_array_values to handle potentially empty results - if a call to mlx_quantize fails it can produce an empty result - but the calling code expects 2 or more valeus in the array - if using withError to catch the error, this crashes instead - fix by allowing callers to specify the minimum number of arrays they need - those values are not usable, but work fine as stand-ins - fixes ml-explore#516
…e#523) The noMetalCmlxExcludes entry was spelled "mxl/mlx/backend/metal/cross_entropy.cpp", so the file was not excluded on Linux and the SwiftPM build failed with: mlx/backend/metal/device.h:5:10: fatal error: 'Metal/Metal.hpp' file not found The typo was introduced in ml-explore#508 and first shipped in 0.33.0
… prism (numen-tech/gemma4-qat#1691) Upstream: the JACCL package trait (ml-explore#517, default on), Swift Testing for most MLXTests suites (ml-explore#519), the empty mlx_vector_array_values guards (ml-explore#518) and the Linux exclude typo (ml-explore#523, already fixed on prism). Conflicts: Cmlx.xcconfig keeps MLX_VERSION 0.32.4 and takes MLX_USE_JACCL=1; the fork's test additions in DistributedNNTests, FP8Tests (NaN-aware E4M3 compare), MLXFastKernelTests (free SDPA forceFused) and MLXArray+InitTests (linspace endpoint overloads) are carried into upstream's Swift Testing / withRandomState form. The vendored core stays at numen-tech/mlx 0676be67f.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
jeethu
added a commit
to numen-tech/mlx-swift-lm
that referenced
this pull request
Nov 15, 2026
…ch/mlx-swift#31 merges SwiftPM refuses two branch requirements for one package, so the host (numen-tech/gemma4-qat, building against the unmerged branch heads) can pin catchup-1691 only if this package names the same branch. Revert this commit (back to prism) once numen-tech/mlx-swift#31 is merged, before this merges.
jeethu
added a commit
to numen-tech/mlx-swift-lm
that referenced
this pull request
Nov 15, 2026
…umen-tech/mlx-swift#31 merges" This reverts commit d531ffb.
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.
Catches
prismup with ml-explore/mlx-swift maina557dd6, the four commits past 0.33.0 (numen-tech/gemma4-qat#1691). A merge, as the 0.33.0 sync was (#23). The vendored core stays at numen-tech/mlx0676be67fand mlx-c ata26f2d5(v0.8.0): upstream did not move either.Upstream commits:
mlx_vector_array_valueshandle an empty result (MLXFast.gatedDeltaUpdate, the quantize wrappers and others no longer indextuple[1]unguarded, so a failed op underwithErrorthrows instead of crashing). Wanted before numen-tech/gemma4-qat#1693 callsgatedDeltaUpdate.traits: [].MLXTestssuites move to Swift Testing (TestingUtils.swift,.randomSeed(_:)).cross_entropy.cppexclude typo, already fixed onprism; no change here.Conflicts and how they were resolved:
xcode/xcconfig/Cmlx.xcconfig: keepsMLX_VERSION="0.32.4"and takesMLX_USE_JACCL=1.Tests/MLXTests/DistributedNNTests.swift: upstream wrapped each body inwithRandomState; the fork's added checks inshardingEdgeCasesBody(segment validation, stream threading, frozen keys) are carried inside it unchanged.Tests/MLXTests/FP8Tests.swift: keeps the fork's NaN-aware compare for E4M3 0x7F/0xFF, now#expect(... allClose(equalNaN: true) ...).Tests/MLXTests/MLXFastKernelTests.swift: the fork'stestFreeSDPAForceFusedbecomes@Test(.randomSeed(0)) func freeSDPAForceFused()withexpectEqual(rtol: 1e-4, atol: 1e-5).Tests/MLXTests/MLXArray+InitTests.swift: the fork's linspaceendpoint:overload checks useexpectEqual.The fork-only XCTest files (Apple6, compile cache, lock ordering, quantization, optimizer additions) stay XCTest.
What ran:
xcodebuild test -scheme mlx-swift-Package -destination platform=macOS -skipPackagePluginValidationon an M3 Max: XCTest 240 executed, 5 skipped, 0 failures; Swift Testing 315 and 700 tests passed; CmlxTests 1 passed. The gemma4-qat side (repin, full NumenKit plan,NAXPolicyTestsroute-version assertions) runs in the dependent gemma4-qat Draft PR. Not run: Linux, iOS devices (no core or kernel change, so no device leg is needed).