Skip to content

0.29.1

Latest

Choose a tag to compare

@davidkoski davidkoski released this 16 Oct 18:14
· 1 commit to main since this release
072b684

Integrate mlx 0.29.1

NOTE

This change contains some breaking API changes in the area of quantization. Specifically:

  • the quantized / dequantized methods now take a mode parameter (not breaking)
  • the biases result from quantized is now optional, e.g. (wq: MLXArray, scales: MLXArray, biases: MLXArray?)

We are keeping the same semver here to match with python mlx. Although the change is breaking, it will likely be limited to implementations of quantized layers, e.g. QuantizedLinear, or other code that uses quantization directly. mlx-swift-examples will have a synchronized release to reflect this change.

If you need to make a similar change, consider the changes from QuantizedLinear:

The properties changed from this:

    public let scales: MLXArray
    public let biases: MLXArray

to:

    public let mode: QuantizationMode
    public let scales: MLXArray
    public let biases: MLXArray?

A mode with parameter with a default value was added where needed: mode: QuantizationMode = .affine and the mode parameter was used in calls to the quantization APIs:

        var x = quantizedMatmul(
            x,
            weight,
            scales: scales,
            biases: biases,
            transpose: true,
            groupSize: groupSize,
            bits: bits,
            mode: mode
        )

and the Quantizable protocol was updated to have a mode parameter (protocol methods can't have default values):

    /// Return the module as a quantized representation
    func toQuantized(groupSize: Int, bits: Int, mode: QuantizationMode) -> Module

What's Changed

New Contributors

Full Changelog: 0.25.6...0.29.1