Repository navigation
MLX
- new mlx release: ml-explore/mlx@v0.32.2...v0.32.4
API Change
Source Breaking
-
compile(inputs:outputs:shapeless:_:)does not return@Sendableclosurecompile(shapeless:_:)requires a@Sendableclosure and returns a@Sendableclosure- see #469 and ml-explore/mlx-swift-lm#589
-
MLXCustomFunctionclosures are now@Sendable- see #481
Note: the compile() change should only be source breaking if it was being used in an incorrect way
(which wasn't clear in the past). In particular:
- functions and closures that capture
Modulestate should be usinginputs:and are notSendable - functions and closures that are not
Sendablecannot be madeSendablethrough this function
If you encounter a build failure:
- see if you should be using the
inputs:variant - see if you need
Sendableon the output - try to convert the function/closure to a pure function
Potentially Source Breaking
-
MLXArrayis notfinal, seeMaterializedArraybelow- see #418
-
Linear, QuantizedLinear, QuantizedEmbedding changed parameters from bare MLXArray to
@ParameterInfo -
Logging (MLXLog) no longer uses cLogSupport library -- much simpler now
- should be transparent as the library was internal
- see #494
Behavior Change
eval()no longer holds evalLock while waiting for the result- see #474
tripletLoss()now uses correct p-norm- see #505
.shardedToAllwith index segments now builds correct predicate for QuantizedLinear- see #503
- JACCL distributed backend enabled (#502).
New API
MLX
MaterializedArray(#418): an evaluated, immutable array that can be shared across concurrency domains.- It has its own +=, -=, *= and /= operators.
MLXArray.materialized()->MaterializedArrayis new.- mlx-swift-lm adoption will be in ml-explore/mlx-swift-lm#335 or a follow-on
materialize(_:): takes anMLXArrayor[MLXArray]and returnsMaterializedArrays- It traps if called inside a transform.
vmapSendable(_:inAxes:outAxes:)-- transforms@Sendableclosures
@sendable versions for the [MLXArray], 1-argument and 2-argument forms.- 3-parameter VJP:
VJP { primals, cotangents, outputs in … } - Safetensors loading:
MLXFast.gatedDeltaUpdate- chunked gated delta network forward passMemory.bufferSize(_:)- returns the size in bytes of the buffers behind the arrays, counting distinct storage only oncematrixTransposed(_:stream:)uniqued()-- returns fixed sized unique values
MLXNN
MaterializedModule<LayerType: Module>: an open class that is @unchecked Sendable- It wraps a module and seals it.
- After wrapping, mutating APIs on the original module (update, apply, freeze, train, …) trap.
- Module.logicalParameterCount (open var): counts parameters, accounting for quantized packing.
What's Changed
- Fix attention mask for
float16by @louen in #496 - be able to trigger workflows on main. notes about upcoming releases by @davidkoski in #489
- fix xcframework builds by @davidkoski in #495
- fix lock inversion between evalLock and dispatch_once on globalStreams by @davidkoski in #499
- idea for doing synchronous evals but not holding evalLock by @davidkoski in #474
- Fix leak when _updateInternal replaces an array with siblings by @ShankyShako in #501
- Enable JACCL by @ronaldmannak in #502
- Fix asArray crash on zero-size arrays by @tk1475 in #486
- compile and vmap can produce Sendable closures from Sendable inputs by @davidkoski in #469
- Fix iOS 26.2 launch crash from Logger.isEnabled by @pmanot in #494
- Fix shardInPlace wrong integer split positions on quantized layers by @ronaldmannak in #503
- Add Sendable closures and 3-parameter VJP support to MLXCustomFunction by @shubhransh-gupta in #481
- GPU.deviceInfo(): select the device like MLX, without the window server by @davidtai in #498
- MaterializedArray is a Sendable MLXArray by @davidkoski in #418
- Fix tripletLoss for non-default p-norm by @Silenterc in #505
- Add concurrent synchronous safetensors loading across files by @aleroot in #462
- Add byte-progress reporting for safetensors file loading by @aleroot in #427
- turn down warnings from the C++ code by @davidkoski in #506
- Fix crossEntropy and nllLoss for a class axis other than the last by @HamedShams in #509
- [CUDA] Allow selecting nvcc's host compiler, and invalidate on change by @GoodOlClint in #443
- [CUDA] Make the CUDA include roots configurable by @GoodOlClint in #444
- Add optimizer state save and restore by @sbkoth in #487
- mlx v0.32.4 by @davidkoski in #508
- fix compatibility issue in update(parameters:) by @davidkoski in #510
- debug CI failure by @davidkoski in #514
- Support for 0.32.4 distributed functions by @ronaldmannak in #512
- Fix a potential data race in ErrorBox.check() by @Silenterc in #513
New Contributors
- @ShankyShako made their first contribution in #501
- @tk1475 made their first contribution in #486
- @pmanot made their first contribution in #494
- @davidtai made their first contribution in #498
- @HamedShams made their first contribution in #509
- @sbkoth made their first contribution in #487
Full Changelog: 0.32.3...0.33.0