Fine-tune mixture-of-experts models on a Mac
Mixture-of-experts models are some of the best open models out there, and some of the hardest to fine-tune locally. Each token only uses a few experts, but all of them have to be somewhere. Qwen3-235B is about 132 GB at 4-bit. Qwen3-Coder-480B is 270 GB.
Paged Trainer keeps the shared backbone in memory and pages the experts from the SSD through a budgeted cache, the same way the PagedMoE engine runs them for inference. Steps run layer by layer for the whole batch, so the expert weights are read about twice per step instead of once per row. Only the experts the router picks are computed, and the gradients match a fully loaded run.
Measured on one 48 GB Mac
| Model | Quant | Size on disk | Tokens/s | Peak memory | One epoch |
|---|---|---|---|---|---|
| Qwen3-Coder-Next | 6-bit | 64.7 GB | 123 | 29.9 GB | 4h 37m |
| Qwen3-235B-A22B | 4-bit | 132.2 GB | 63 | 31.5 GB | 9h 06m |
| Qwen3.8-Flash-Next | 6-bit | 148.0 GB | 61 | 29.3 GB | 9h 20m |
| GLM-4.7 | 4-bit | 198.6 GB | 24 | 31.4 GB | 23h 59m |
| Qwen3-Coder-480B | 4-bit | 270.1 GB | 24 | 33.9 GB | 1d 0h |
FAQ
Why are MoE models hard to fine-tune on a Mac?
The total weights are huge even though each token only uses a few experts. A 235B MoE is about 132 GB at 4-bit, far past what most Macs have in memory.
How does Paged Trainer handle that?
It keeps the shared backbone in memory and pages the experts from the SSD through a budgeted cache. Steps run layer by layer for the whole batch, and only the experts the router picks are computed.
Does streaming change the result?
No. Prefetch and caching only change timing. The router picks the experts and the gradients are the same as a fully loaded run.
Related
© QWERTY Code LLC. Paged Trainer is a product of QWERTY Code LLC.