-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Studio: exclude mlx-lm 0.31.3 (broke gemma4/qwen3_5 QK-norm load on Apple Silicon) #6803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c36248e
aaee1b2
ce773ed
82e2ee2
4847bbd
7888043
81ef81e
4322dc3
4a23977
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,9 @@ transformers>=4.57.6 | |
| # anyio that also ImportErrors on TaskHandle and 500s the server. An override | ||
| # wins the fight, so force one consistent <4.14 here too. | ||
| anyio<4.14.0 | ||
|
|
||
| # mlx-lm 0.31.3 regressed QK-norm archs (gemma4 / qwen3_5): strict load_weights | ||
| # rejects q_norm/k_norm, so those checkpoints fail to load. mlx-lm #1242. | ||
| # The override also drops it from transitive resolution; keep the >=0.22.0 floor | ||
| # (mirrors mlx_repair.py _MLX_MIN_VERSIONS) or the resolver could go below it. | ||
| mlx-lm>=0.22.0,!=0.31.3 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For Apple Silicon installs using Useful? React with 👍 / 👎.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The override deliberately keeps the only enforceable floor (mlx-lm at least 0.22.0) and uv resolves mlx-lm 0.31.2, the last good release before the QK-norm regression and exactly the version this PR targets. mlx-vlm 0.6.3's declared floor (mlx-lm 0.31.3 or newer) is unenforceable here: 0.31.3 is the broken release being excluded and nothing newer exists, so enforcing it yields an empty set and fails the install. There is no reachable path to a too-old or broken mlx-lm, so the enforceable floor is already correctly preserved. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1532,6 +1532,10 @@ def _torch_step_label(suffix: str) -> str: | |
| ) | ||
| LOCAL_DD_GITHUB_PLUGIN = SCRIPT_DIR / "backend" / "plugins" / "data-designer-github-repo-seed" | ||
|
|
||
| # mlx-lm 0.31.3 broke gemma4 / qwen3_5 loading (strict load_weights rejects the | ||
| # QK-norm q_norm/k_norm tensors); exclude just that release. See mlx-lm #1242. | ||
| MLX_LM_BAD_VERSION_EXCLUSION = "!=0.31.3" | ||
|
|
||
| # Apple Silicon: override mlx-vlm/mlx-lm's transformers pin (see overrides). | ||
| # _uv_safe_path: uv truncates UV_OVERRIDE at the first space too (issue #6503). | ||
| _MLX_OVERRIDES = SINGLE_ENV / "overrides-darwin-arm64.txt" | ||
|
|
@@ -2092,6 +2096,8 @@ def install_python_stack() -> int: | |
|
|
||
| # macOS arm64: install MLX stack at latest (UV_OVERRIDE relaxes the | ||
| # mlx-vlm / mlx-lm transformers pin -- set at module load). | ||
| # Exclude mlx-lm 0.31.3 (see MLX_LM_BAD_VERSION_EXCLUSION); it broke | ||
| # gemma4 / qwen3_5 QK-norm loading. mlx-lm #1242. | ||
| if IS_MAC_ARM and not skip_base: | ||
| _progress("MLX stack (Apple Silicon)") | ||
| pip_install( | ||
|
|
@@ -2100,7 +2106,7 @@ def install_python_stack() -> int: | |
| "--upgrade", | ||
| "mlx", | ||
| "mlx-metal", | ||
| "mlx-lm", | ||
| f"mlx-lm{MLX_LM_BAD_VERSION_EXCLUSION}", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
On the normal Useful? React with 👍 / 👎. |
||
| "mlx-vlm", | ||
| ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appends
mlx-lm!=0.31.3only on the fresh non-migrated install path. In the legacy migration path above, a healthy$STUDIO_HOME/.venvis moved into$VENV_DIR,_MIGRATED=true, and the installer runs the separateinstall unsloth (migrated)command without this extra requirement before invoking setup withSKIP_STUDIO_BASE=1; for curl-piped Apple Silicon migrations there is also no repo-relative overrides file to export. That path can still resolve a missing/transitivemlx-lmto the known-bad 0.31.3 and leave QK-norm MLX models broken until runtime autorepair succeeds.Useful? React with 👍 / 👎.