Repository navigation
Description
Follow-up from testing the training-page rework (#7633) on Apple Silicon. Filing rather than sending a patch because the fix is a design call about the load-mode vocabulary, not a mechanical change.
What happens
A prequantized MLX model that is not uniformly 4-bit cannot attest, so its checkpoints are never resumable. Real training runs on main (e96d02074), all completed, dataset attested in each:
| model | 4-bit toggle | pinned | provenance |
|---|---|---|---|
mlx-community/Qwen2.5-0.5B-Instruct-4bit |
on | yes | attested / prequantized_4bit |
mlx-community/Qwen3.5-0.8B-8bit |
on | yes | incomplete — no resume |
mlx-community/Qwen3.5-0.8B-8bit |
off | yes | attested / unquantized |
Neither row for the 8-bit model is right. With the toggle on the run is simply not resumable. With it off the run attests, but records unquantized for a model whose weights are 8-bit — so the marker misdescribes what was loaded, and a resume would restore under that description.
Why neither route accepts it
_attested_model_load_mode has two ways to attest a 4-bit request:
if _snapshot_declares_quantization(Path(snapshot)):
return _MODEL_LOAD_PREQUANTIZED_4BIT
if _loaded_model_is_4bit(model):
return _MODEL_LOAD_RUNTIME_4BIT
return None_snapshot_declares_quantization now answers "declares 4-bit" rather than "declares quantization" — any other width sets conflicting_width and it returns False:
mlx-community/SmolLM-135M-Instruct-4bit -> True
mlx-community/Qwen2.5-0.5B-Instruct-4bit -> True
mlx-community/Qwen3-0.6B-4bit -> True
mlx-community/Qwen3.5-0.8B-8bit -> False
fixture: flat 8bit -> False
fixture: flat 6bit -> False
fixture: mixed per-layer 4 + 8 -> False
fixture: per-layer all 4bit -> True
And _loaded_model_is_4bit cannot pick up the slack, because a prequantized MLX model loads with _unsloth_quantized_source == "mlx_config", which is deliberately excluded — test_mlx_runtime_4bit_attestation_requires_exact_runtime_policy pins that, and validate_exact_model_pin rejects a runtime_4bit whose snapshot declares quantization. That separation looks right to me: runtime_4bit means "the snapshot was not quantized and we quantized at load". I am not suggesting it change.
So the gap is specifically that prequantized_4bit is the only prequantized mode in the vocabulary, and anything not uniformly 4-bit falls between the two.
Mixed-width conversions make this broader than the 8-bit case — per-layer entries at differing widths are common in mlx-community repos, and they land on the same False.
Why I did not just send a patch
The obvious minimal change — let _snapshot_declares_quantization accept any declared width — unblocks resume but then labels an 8-bit model prequantized_4bit, which is a differently-wrong record rather than a fix.
Doing it properly means a width-aware load mode (prequantized_8bit, or a width-agnostic prequantized plus the width recorded alongside), and that changes the marker vocabulary under RESOURCE_PROVENANCE_VERSION = 1. Whether existing markers should be migrated, tolerated, or invalidated is your call, not something I should guess at.
Happy to implement whichever direction you prefer.
Reproducing
Any mlx-community/*-8bit model works. Pin it from the cached tab, start a LoRA run, and read the resource_provenance worker event; with the 4-bit toggle on the model side is incomplete with reason model_quantized_snapshot_unattested, and resource_provenance_allows_resume is False.
Tested on an M2 MacBook Air (16GB), mlx 0.31.2 / mlx-lm 0.31.2, unsloth_zoo 2026.8.4.
Activity
Mathews-Tom commentedon Sep 25, 2026
Opened #11940 for this, building on the analysis above. It records the snapshot's declared widths in the load mode (
prequantized_8bit,prequantized_4_8bit, withprequantized_4bitstaying exactly the uniform-4-bit case), so no marker migration or version bump is needed. It also fixes the toggle-off row that recorded 8-bit weights asunquantized. I checked it on an M1 Pro withmlx-community/Qwen3.5-0.8B-8bit: complete provenance withprequantized_8bit, and a stopped run resumes from its checkpoint. The PR asks the maintainers the open question about keeping version 1.fix(studio): record the bit widths of prequantized MLX models
fix(studio): record the bit widths of prequantized MLX models
fix(studio): record the bit widths of prequantized MLX models (unslot…