Fine-tune models larger than your Mac's memory

The usual rule is that the model has to fit in memory to train. Paged Trainer breaks that rule for mixture-of-experts models. On an M5 Pro with 48 GB, a 270 GB Qwen3-Coder-480B fine-tuned with peak memory under 34 GB. A 132 GB Qwen3-235B ran at 63 tokens per second.

The trick is that LoRA leaves the base weights frozen. Frozen weights are read-only, so the experts can stay on the SSD and stream in every step, while the backbone and the adapters stay in memory. The planner sizes the batch and the expert cache to your Mac, and a memory guard backs off if macOS gets tight.

The numbers

Apple M5 Pro, 48 GB. SFT, QLoRA r16 on all linear layers, seq 2048, streamed. Epoch is 1,000 rows of 2,048 tokens.
ModelQuantSize on diskTokens/sPeak memoryOne epoch
Qwen3-Coder-Next6-bit64.7 GB12329.9 GB4h 37m
Qwen3-235B-A22B4-bit132.2 GB6331.5 GB9h 06m
Qwen3.8-Flash-Next6-bit148.0 GB6129.3 GB9h 20m
GLM-4.74-bit198.6 GB2431.4 GB23h 59m
Qwen3-Coder-480B4-bit270.1 GB2433.9 GB1d 0h

Every model in that table is bigger than the Mac's memory. Speed tracks SSD read speed, so keep big checkpoints on the internal drive.

Download - Paged Trainer

FAQ

Is it really training, or just inference?

Real training. Forward and backward passes run every step and LoRA adapters update. The base weights stay frozen and read-only, which is what lets the experts live on the SSD.

What limits speed?

Mostly SSD read speed. Every step reads the expert weights, so the internal SSD is the fastest place for the checkpoint. The bench tab measures it on your own Mac.

Will it freeze my Mac?

It is built not to. The planner leaves room for the system, and a memory guard gives memory back under macOS pressure without changing the gradients.

Related

© QWERTY Code LLC. Paged Trainer is a product of QWERTY Code LLC.