Repository navigation
fix(studio): stop offering a transformers upgrade where it cannot load anything - #9878
NilayYadav merged 4 commits into
Conversation
…d anything Loading an architecture newer than the installed transformers pops the "New model architecture" dialog, which offers to install the latest release. `check_upgrade_for_model` fires whenever a config's `model_type` is absent from every installed overlay and the tier tables, on the premise its docstring states: that is "exactly when today's load would fail with an unrecognized-architecture error". That premise does not hold on MLX. The inference backend is chosen by hardware, and the MLX branch returns before the transformers backend is ever constructed, so mlx-lm and mlx-vlm decide what loads there and transformers only supplies the tokenizer. Muse Glimmer is the case in hand: `muse_glimmer` is absent from transformers 5.5.0's `CONFIG_MAPPING_NAMES`, yet text and vision inference and training all run on it. The offer is not merely redundant on that hardware, it is unactionable -- no transformers version can make an architecture loadable when transformers is not what builds it -- and accepting it costs a minutes-long install for no change. Skip the check on MLX hosts, the same reason GGUF is already skipped one branch above. Every other device is untouched, and a failure to detect hardware falls back to offering the upgrade so a detection problem cannot silence a real one. Deciding this per model instead -- suppressing the offer when mlx-lm or mlx-vlm ships that particular `model_type` -- was tried and dropped: a wrapper whose top-level type MLX ships can still carry a brand-new nested backbone that neither backend can build, so module presence does not establish that the config loads. The tests for this check now pin a device rather than reading the host's, since on Apple Silicon they would otherwise exercise the short-circuit instead of the behaviour they assert.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
The MLX short-circuit is right for the case it was written for, but the blanket form also drops one offer that is genuinely actionable. bitsandbytes repos on MLX are built by transformers. mlx-lm cannot read bnb weights, so and transformers 5.5.0 on that second repo raises exactly the error this dialog exists to fix: The offered install does reach that call: I have pushed a narrowing rather than a revert: the skip still applies, unless the config is bitsandbytes-quantized. That required moving the check below the config load, since the decision now needs the config. Everything the PR set out to suppress still is — measured on an M5 Pro where
Two smaller notes:
On CI: the six red checks here are pre-existing on |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d9bd02ba4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Refined the narrowing in Keeping the offer for any bnb config re-raises the dialog for Measured on the M5 Pro against the real Hub configs, nothing stubbed:
So the behaviour you shipped is unchanged on both repos that actually exist for this architecture; only the third-party/local bnb case, which does fail inside transformers, gets its offer back. The one thing worth your judgement: this mirrors a naming rule that lives in unsloth_zoo, so if that remap changes, this has to follow. The alternative is to drop the exception and accept that a third-party bnb repo on a brand-new architecture has no in-product route to the install it needs. I went with the mirror and a test that names the coupling, but it is your call. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2133a6df9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Following up on the tokenizer/processor point, because it turns out to be the load-bearing one and I do not think it can be patched around. Measured on transformers 5.5.0 (the installed tier), against the real Hub configs:
It does not raise. This lands on all three architectures the PR is for. So for the models in the description, the pre-PR dialog was not redundant: installing the newer transformers is what gives them a working image processor, and the sidecar is activated for the MLX worker, so it does reach them. I have not pushed anything for this. The bnb case narrowed cleanly because a rule already existed to mirror; this one does not — an exemption honest enough to cover it (keep the offer whenever the config is multimodal) suppresses nothing for any of the three motivating models, which is the PR reduced to a no-op for its own examples. That is a call for you and the maintainers, not something to land from a review. Three options as I see them:
I would not merge as-is: on this Mac, with this PR, Everything else on the branch stands — the bnb narrowing in |
Reproduction CIA/B on a disposable fork, cut from this PR's own merge base (
Both negatives fail at the intended assertion, not at setup: Worth recording that both hosted runners report On real Apple Silicon (M5 Pro,
|
| repo | merge base | this branch |
|---|---|---|
mlx-community/Muse-Glimmer-30B-4bit |
offer: transformers 5.16.1 | no offer |
unsloth/Muse-Glimmer-30B-unsloth-bnb-4bit |
offer: transformers 5.16.1 | no offer |
someorg/Muse-Glimmer-30B-bnb-4bit (third-party bnb) |
offer | offer (kept by the narrowing) |
Same thing through two independently installed Studios on this box — the /api/inference/validate payload the dialog is built from:
// merge base 5409ea338d
"requires_transformers_upgrade": true,
"transformers_upgrade": {"model_type": "muse_glimmer", "pypi_version": "5.16.1",
"supported_in_pypi": true, "supported_in_main": true}
// this branch
"requires_transformers_upgrade": false,
"transformers_upgrade": nullCI on this PR
The red checks are not from this branch. (Python 3.13) fails with 12 failures, all in tests/test_gpu_init_crash_message.py, alongside 34408 passed; Repo tests (CPU) and workflow-trigger lint fail on the orphaned Playwright suite and the read_text() encoding guard. All of them are red on main and on every open PR right now, and #9877 is the dedicated fix for two. Nothing in test_transformers_latest.py fails in CI.
I did not capture a screenshot of the dialog itself: it is raised at model load, and the only architectures that trigger it here are 30B repos, so a real capture means a ~60 GB download. The /validate payloads above are the values that drive it.
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Resolved the processor question in Checked first whether this could be fixed upstream instead — it cannot right now: mlx-vlm The guard now skips only when the config declares no modality, using the same three fields unsloth_zoo's own Real Hub configs, on this M5 Pro with
Worth being straight about what this costs: all three architectures in the description carry a Two test changes worth flagging, since one is yours:
101 passed. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2436c815b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37c910318a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e83ff9839f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
59215c3 to
90f2f77
Compare
Branch reset to
|
| transformers | Qwen/Qwen3.8-Flash-Next |
zai-org/GLM-5.3-Flash |
|---|---|---|
| 5.5.0 (installed) | TokenizersBackend, image_processor None |
TokenizersBackend, image_processor None |
| 5.16.1 (what the dialog offers) | Qwen3VLProcessor + Qwen2VLImageProcessor |
Glm5NextProcessor + Glm5NextImageProcessor |
So for text training and text chat — which is what #1120 validates and, realistically, what anyone does with an 83 GB MoE on a Mac — you are right and the install is wasted minutes. For chat with images on these models, the install is the thing that makes images work, and with the skip in place that load comes up image-less. I did not verify what Studio shows the user in that case; it may be an error rather than silent.
I think the right resolution is neither "wall" nor "skip" but a third exit in the dialog — continue on the installed transformers, text-only — so the text path is unblocked and an image user is told the truth. That is a product change and yours to decide; happy to put it up as a follow-up if you want it.
Also a small factual update for the description: 5.16.1 now ships muse_glimmer, qwen4_exp and glm5_next (checked via the same snapshot the dialog uses), so "no transformers version" is no longer literally true — the argument about mlx-vlm building the weights still holds.
Codex's approval is on this exact head; CI reds are the repo-wide pre-existing set (#9877 fixes two). Nothing further from my side.
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Loading an architecture newer than the installed transformers pops the "New model architecture" dialog, which offers to install the latest release.
check_upgrade_for_modelfires whenever a config'smodel_typeis absent from every installed overlay and the tier tables, on the premise its docstring states: that is "exactly when today's load would fail with an unrecognized-architecture error".That premise does not hold on MLX. The inference backend is chosen by hardware, and the MLX branch returns before the transformers backend is ever constructed, so mlx-lm and mlx-vlm decide what loads there and transformers only supplies the tokenizer. The offer is not merely redundant on that hardware, it is unactionable — no transformers version can make an architecture loadable when transformers is not what builds it — and accepting it costs a minutes-long install for no change.
Muse Glimmer is one case in hand:
muse_glimmeris absent from transformers 5.5.0'sCONFIG_MAPPING_NAMES, yet text and vision inference and training all run on it. Qwen3.8-Flash-Next and GLM-5.3-Flash are two more, and there will be others — MLX support for a new architecture routinely lands before transformers ships it.What changed
Skip the check on MLX hosts, for the same reason GGUF is already skipped one branch above. Every other device is untouched, and a failure to detect hardware falls back to offering the upgrade, so a detection problem cannot silence a real offer.
Deciding this per model instead — suppressing the offer when mlx-lm or mlx-vlm ships that particular
model_type— was tried and dropped: a wrapper whose top-level type MLX ships can still carry a brand-new nested backbone that neither backend can build, so module presence does not establish that the config loads.The tests for this check now pin a device rather than reading the host's, since on Apple Silicon they would otherwise exercise the new short-circuit instead of the behaviour they assert.
Why it is on its own
Split out of #8422 so it can land independently. It is self-contained — two files, no dependency on the rest of that branch — and unslothai/unsloth-zoo#1120 needs it before Qwen3.8-Flash-Next and GLM-5.3-Flash can be loaded from Studio at all: without it, both architectures hit the upgrade dialog before any MLX code runs.
Validation
98 passed. Removing the guard from
check_upgrade_for_modelfails exactly one test,test_mlx_host_is_never_offered_a_transformers_upgrade, and nothing else — so the behaviour is pinned rather than merely exercised.