Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Move the Unsloth Studio MLX pins to mlx 0.32.3 and mlx-vlm 0.7.4 (#12334)

Long Yixingf07d552fcc14
diff --git a/studio/backend/tests/test_mlx_inference_backend.py b/studio/backend/tests/test_mlx_inference_backend.py
index 08cbc509677..bca2559b8ff 100644
--- a/studio/backend/tests/test_mlx_inference_backend.py
+++ b/studio/backend/tests/test_mlx_inference_backend.py
@@ -8315,7 +8315,7 @@ def test_mlx_vlm_every_release_reads_one_models_rate_the_same_way(
):
"""A model's declared rate must not depend on which mlx-vlm is installed.
- Studio pins ``mlx-vlm>=0.4.4,<=0.7.1``, which spans both shapes: releases with no resolver
+ Studio pins ``mlx-vlm>=0.4.4,<=0.7.4``, which spans both shapes: releases with no resolver
and, from 0.7.0, releases that have one. Reading the rate only through the resolver left
every install on the older shape sampling at the library default instead of the rate the
checkpoint asked for.
diff --git a/studio/backend/tests/test_mlx_repair.py b/studio/backend/tests/test_mlx_repair.py
index 12e9eea9ae4..a3e1fdf06e6 100644
--- a/studio/backend/tests/test_mlx_repair.py
+++ b/studio/backend/tests/test_mlx_repair.py
@@ -62,9 +62,9 @@ def test_uv_cmd_targets_this_interpreter_with_mlx_packages(monkeypatch):
# mlx-vlm keeps a floor so the resolver cannot backtrack to an old one that
# imports but breaks VLM Train/Export, and a ceiling so this unattended
# install cannot cross a major line on its own.
- assert "mlx-vlm>=0.4.4,<=0.7.1" in cmd
+ assert "mlx-vlm>=0.4.4,<=0.7.4" in cmd
# Pinned, not floored: see _MLX_INSTALL_SPECS.
- assert "mlx==0.32.2" in cmd
+ assert "mlx==0.32.3" in cmd
assert "mlx-lm==0.31.3" in cmd
# Look the requirement up by name rather than by prefix. Asserting on
# startswith("mlx==") could only ever be checked on a spec that already
@@ -87,7 +87,7 @@ def test_install_narrows_mlx_vlm_to_what_the_installed_zoo_declares(monkeypatch)
assert "<0.7.0" in vlm
# mlx and mlx-lm are pinned at both ends, so they are left alone: intersecting them with a
# zoo one patch release behind would empty the range and break every self-heal.
- assert "mlx==0.32.2" in packages
+ assert "mlx==0.32.3" in packages
assert "mlx-lm==0.31.3" in packages
@@ -258,7 +258,7 @@ def test_repair_rejects_inadequate_stack(monkeypatch):
def test_inadequate_stack_warning_names_the_floors_not_the_install_pins(monkeypatch):
# The gate this message reports on is mlx_stack_available(), which tests the
# floors. Quoting the install pins instead would tell an operator running a
- # perfectly usable mlx 0.33 that they need exactly 0.32.2.
+ # perfectly usable mlx 0.33 that they need exactly 0.32.3.
warnings = []
# Pin both, or this test measures the host. attempt_mlx_repair returns early
# when _uv_executable() finds nothing, long before the message under test, so
diff --git a/studio/backend/utils/mlx_repair.py b/studio/backend/utils/mlx_repair.py
index e4ac59fd681..b5cf1a57752 100644
--- a/studio/backend/utils/mlx_repair.py
+++ b/studio/backend/utils/mlx_repair.py
@@ -30,11 +30,11 @@ _UNRESOLVED_PYTHON_MARKER = "No virtual environment or system Python installatio
_MLX_MIN_VERSIONS = {"mlx": "0.22.0", "mlx-lm": "0.31.2", "mlx-vlm": "0.4.4"}
_MLX_PACKAGE_NAMES = tuple(_MLX_MIN_VERSIONS)
_MLX_RUNTIME_IMPORTS = ("mlx.core", "mlx_lm", "mlx_lm.sample_utils", "mlx_vlm")
-# What the self-heal INSTALLS, as opposed to the floors above, which judge a stack that is already there. Pinned rather than floored because this install is unattended and default-on and mlx ships breaking changes in patch releases: 0.32.1 broke model loading here (unslothai/unsloth#9466). Keep in sync with unsloth-zoo's pyproject darwin deps; mlx-vlm stays a range so the resolver can pick 0.7.1, where the installer overrides mlx-vlm's transformers requirement, and 0.6.4 under the plain cap. mlx moves to 0.32.2 because mlx-vlm 0.7.x floors it there; that release also retires the interpreter-finalization segfault 0.32.1 hit when a fused Metal custom kernel was the last work a process did, and still carries the fix for mlx#3833, where two fast.metal_kernel instances sharing a name but not a source ran the first kernel's code for the second.
+# What the self-heal INSTALLS (the floors above judge a stack already there). Pinned, not floored: this install is unattended and mlx breaks in patch releases (0.32.1, unslothai/unsloth#9466). Keep in sync with unsloth-zoo's darwin deps. mlx 0.32.3 rather than mlx-vlm's 0.32.2 floor: 0.32.2's GQA-8 decode kernel read the first sequence's KV for every batch row (mlx#4431). mlx-vlm stays a range: 0.7.4 under the installer's transformers override, 0.6.4 under the plain cap.
_MLX_INSTALL_SPECS = {
- "mlx": "==0.32.2",
+ "mlx": "==0.32.3",
"mlx-lm": "==0.31.3",
- "mlx-vlm": ">=0.4.4,<=0.7.1",
+ "mlx-vlm": ">=0.4.4,<=0.7.4",
}
MLX_PACKAGES = tuple(f"{name}{spec}" for name, spec in _MLX_INSTALL_SPECS.items())
@@ -398,7 +398,7 @@ def attempt_mlx_repair(*, timeout: int = _REPAIR_TIMEOUT_S) -> bool:
logger.warning(
"MLX self-heal produced an incomplete or too-old MLX stack "
"(need %s); staying chat-only.",
- # The floors, not MLX_PACKAGES: the gate above tests the floors, so quoting the install pins would tell someone on a usable mlx 0.33 that they need exactly 0.32.2.
+ # The floors, not MLX_PACKAGES: the gate above tests the floors, so quoting the install pins would tell someone on a usable mlx 0.33 that they need exactly 0.32.3.
", ".join(f"{name}>={ver}" for name, ver in _MLX_MIN_VERSIONS.items()),
)
return False
diff --git a/studio/install_python_stack.py b/studio/install_python_stack.py
index fa837a39e83..fbe4cb4dc07 100644
--- a/studio/install_python_stack.py
+++ b/studio/install_python_stack.py
@@ -642,7 +642,7 @@ def _macos_release_major() -> "int | None":
# The pinned MLX versions publish macosx_14_0_arm64 wheels, no sdist and no cp39, so
# macOS 13 and Python 3.9 have nothing to resolve to (`uv pip install --python-platform
-# aarch64-apple-darwin mlx==0.32.2`). Asked before the install, like
+# aarch64-apple-darwin mlx==0.32.3`). Asked before the install, like
# _torchcodec_spec_is_installable: pip_install exits on failure, so trying would end an
# install that today just comes up chat-only.
_MLX_MIN_PYTHON = (3, 10)
@@ -8830,10 +8830,10 @@ def _build_pip_cmd(args: tuple[str, ...]) -> list[str]:
# Every current caller also names these as positionals or via -r, but a
# future one might not, and pip would then upgrade nothing.
- # By canonical project name: `--upgrade-package mlx` beside `mlx==0.32.2` is one project,
+ # By canonical project name: `--upgrade-package mlx` beside `mlx==0.32.3` is one project,
# and pip refuses a double requirement where uv does not.
def _project(requirement: str) -> str:
- # _requirement_name stops at "==" and "@"; a range (mlx-vlm>=0.4.4,<=0.7.1) needs the
+ # _requirement_name stops at "==" and "@"; a range (mlx-vlm>=0.4.4,<=0.7.4) needs the
# rest.
return _canonical_package_name(
re.split(r"[<>=!~;\[ ]", _requirement_name(requirement), maxsplit = 1)[0]
@@ -9902,8 +9902,8 @@ def _has_working_git() -> bool:
# The MLX stack, one place; test_mlx_install.py compares it with utils/mlx_repair.py's
# _MLX_INSTALL_SPECS.
-_MLX_PINS: tuple[str, ...] = ("mlx==0.32.2", "mlx-metal==0.32.2", "mlx-lm==0.31.3")
-_MLX_VLM_SPEC = "mlx-vlm>=0.4.4,<=0.7.1"
+_MLX_PINS: tuple[str, ...] = ("mlx==0.32.3", "mlx-metal==0.32.3", "mlx-lm==0.31.3")
+_MLX_VLM_SPEC = "mlx-vlm>=0.4.4,<=0.7.4"
# Exact: llguidance.mlx / llguidance.hf are the API grammar_constraint.py binds to.
_LLGUIDANCE_PIN = "llguidance==1.8.0"
_MLX_NAMES: tuple[str, ...] = tuple(spec.partition("==")[0] for spec in _MLX_PINS) + ("mlx-vlm",)
diff --git a/tests/studio/install/test_dependency_pass_skips.py b/tests/studio/install/test_dependency_pass_skips.py
index a8eeca55f6e..24ca5b10a49 100644
--- a/tests/studio/install/test_dependency_pass_skips.py
+++ b/tests/studio/install/test_dependency_pass_skips.py
@@ -923,7 +923,7 @@ def test_a_pip_that_cannot_run_is_bootstrapped_again(monkeypatch) -> None:
def test_the_mlx_stack_is_current_only_when_all_four_hold(monkeypatch) -> None:
- versions = {"mlx": "0.32.2", "mlx-metal": "0.32.2", "mlx-lm": "0.31.3", "mlx-vlm": "0.5.0"}
+ versions = {"mlx": "0.32.3", "mlx-metal": "0.32.3", "mlx-lm": "0.31.3", "mlx-vlm": "0.5.0"}
monkeypatch.setattr(stack, "_installed_distribution_version", lambda name: versions.get(name))
# The closure of a stack that is not installed on this host is its own test below.
monkeypatch.setattr(stack, "_mlx_closure_unmet", lambda: False)
@@ -944,7 +944,7 @@ def test_the_mlx_stack_is_current_only_when_all_four_hold(monkeypatch) -> None:
def test_a_satisfied_mlx_pin_with_a_broken_closure_is_not_current(monkeypatch, tmp_path) -> None:
"""This step installs WITH dependencies, so it is what repairs an mlx-vlm whose own
miniaudio or mlx-audio is gone. Versions alone would skip that repair."""
- versions = {"mlx": "0.32.2", "mlx-metal": "0.32.2", "mlx-lm": "0.31.3", "mlx-vlm": "0.5.0"}
+ versions = {"mlx": "0.32.3", "mlx-metal": "0.32.3", "mlx-lm": "0.31.3", "mlx-vlm": "0.5.0"}
monkeypatch.setattr(stack, "_installed_distribution_version", lambda name: versions.get(name))
monkeypatch.setattr(stack, "_mlx_closure_unmet", lambda: True)
assert stack._mlx_stack_is_current() is False
@@ -1049,7 +1049,7 @@ def test_a_resident_codec_inside_the_window_needs_no_install(spec, installed, ex
def test_the_pip_fallback_never_names_one_project_twice() -> None:
- """pip refuses `mlx==0.32.2 mlx` outright with "Double requirement given", which
+ """pip refuses `mlx==0.32.3 mlx` outright with "Double requirement given", which
would fail the very step the fallback exists to rescue."""
cmd = stack._build_pip_cmd(
(
@@ -1057,13 +1057,13 @@ def test_the_pip_fallback_never_names_one_project_twice() -> None:
"mlx",
"--upgrade-package",
"mlx-vlm",
- "mlx==0.32.2",
- "mlx-vlm>=0.4.4,<=0.7.1",
+ "mlx==0.32.3",
+ "mlx-vlm>=0.4.4,<=0.7.4",
)
)
assert "--upgrade" in cmd and "--upgrade-package" not in cmd
assert cmd.count("mlx") == 0 and cmd.count("mlx-vlm") == 0
- assert "mlx==0.32.2" in cmd and "mlx-vlm>=0.4.4,<=0.7.1" in cmd
+ assert "mlx==0.32.3" in cmd and "mlx-vlm>=0.4.4,<=0.7.4" in cmd
def test_a_package_named_only_by_the_flag_is_still_passed() -> None:
diff --git a/tests/studio/install/test_mlx_install.py b/tests/studio/install/test_mlx_install.py
index 3ead5461195..0e50067fdcd 100644
--- a/tests/studio/install/test_mlx_install.py
+++ b/tests/studio/install/test_mlx_install.py
@@ -281,7 +281,7 @@ def test_mlx_command_preserves_pins_and_interpreter_on_fallback(monkeypatch, ret
if len(commands) > 1:
assert "--upgrade" in commands[1]
assert "--upgrade-package" not in commands[1]
- # ...and no project twice: pip refuses "mlx==0.32.2 mlx" with "Double requirement given".
+ # ...and no project twice: pip refuses "mlx==0.32.3 mlx" with "Double requirement given".
projects = [
arg.split(";")[0].split("[")[0].split("=")[0].split("<")[0].split(">")[0].strip()
for arg in commands[1]
@@ -306,7 +306,7 @@ def test_mlx_command_preserves_pins_and_interpreter_on_fallback(monkeypatch, ret
def test_mlx_pin_floor_matches_the_published_wheels(
monkeypatch, python_version, macos_major, installable
):
- """0.32.2 ships macosx_14_0_arm64 wheels, no sdist, and the pinned set starts at cp310."""
+ """0.32.3 ships macosx_14_0_arm64 wheels, no sdist, and the pinned set starts at cp310."""
monkeypatch.setattr(stack.sys, "version_info", python_version)
monkeypatch.setattr(stack, "_macos_release_major", Mock(return_value = macos_major))
assert stack._mlx_pins_are_installable() is installable
@@ -315,9 +315,9 @@ def test_mlx_pin_floor_matches_the_published_wheels(
def test_pin_floor_is_revisited_whenever_the_pins_move():
"""A pin bumped without its floor silently starts failing installs, so tie them here."""
assert _repair_specs() == {
- "mlx": "==0.32.2",
+ "mlx": "==0.32.3",
"mlx-lm": "==0.31.3",
- "mlx-vlm": ">=0.4.4,<=0.7.1",
+ "mlx-vlm": ">=0.4.4,<=0.7.4",
}
assert (stack._MLX_MIN_PYTHON, stack._MLX_MIN_MACOS_MAJOR) == ((3, 10), 14)