h3.c icon indicating copy to clipboard operation
h3.c copied to clipboard

Mac air M5 32GB My first AI video with h3.c — an astronaut on Mars!

Open z6qaz opened this issue 3 months ago • 2 comments

Hi antirez! Thank you so much for h3.c. 🙏 I'm a hobbyist from China with a 32GB MacBook Air. Before h3.c, I couldn't run MiniMax H3 at all — the MLX version always OOM'd on my machine. With your C + Metal implementation, I generated my first AI video: an astronaut walking on Mars at sunset. The --ssd-streaming option made it run within 32GB of RAM, and the quality is amazing. I believe I'm one of the first people to run it successfully on a 32GB machine. Your work made video generation possible for people with ordinary Macs. Really appreciate it!

https://github.com/user-attachments/assets/d6baaa1f-dbbe-4871-9600-d4470f6fac23

https://github.com/user-attachments/assets/3c97c9c6-9b94-460a-be8c-1936307ca404

z6qaz avatar Aug 14 '26 05:08 z6qaz

Hi antirez! I'm the 32GB MacBook user from earlier. Here is the FULL benchmark report with the extra data (swap usage, SSD-streaming comparison, and observations from a fanless Air).

Hardware

  • MacBook Air (Mac17,4), Apple M5 base (10 CPU cores, Metal 4) — FANLESS
  • 32GB unified memory
  • APPLE SSD AP0512Z 500GB (Apple Fabric): ~14.9 GB/s read, ~6.0 GB/s write
  • macOS 26.5.2

Benchmark 1: WITHOUT --ssd-streaming (official README command)

./h3 --profile -d ./MiniMax-H3 -p "A hummingbird hovering over red flowers." --width 512 --height 512 --frames 22 --steps 20 --layers 45 --reuse 2

Results: H3 DiT: wall= 76.6s wait= 75.8s root-gpu= 2.16s peak= 17.05 GiB attention=497 video VAE: wall= 24.5s peak= 9.45 GiB Total: ~101s, peak memory 17.05 GiB

✅ Runs fine WITHOUT ssd-streaming on 32GB — 17GB peak fits, but...

Benchmark 2: WITH --ssd-streaming (same command)

./h3 --profile -d ./MiniMax-H3 -p "A hummingbird hovering over red flowers." --width 512 --height 512 --frames 22 --steps 20 --layers 45 --reuse 2 --ssd-streaming

Results: BF16 SSD stream: 356 GB read in 72.6s (4.9 GiB/s), unhidden wait 0.037s H3 DiT: wall= 128.3s wait= 127.3s root-gpu= 1.89s peak= 1.97 GiB!! video VAE: wall= 28.3s peak= 9.45 GiB Total: ~157s, DiT peak memory only 1.97 GiB

The key comparison

Metric No SSD-stream With SSD-stream
DiT time 76.6s 128.3s (+67%)
DiT peak memory 17.05 GiB 1.97 GiB (-88%)
SSD traffic — 356 GB @ 4.9 GiB/s

Swap data (CRITICAL finding)

System-wide swap while idle-ish with my normal apps open (Safari, WeChat, etc.): vm.swapusage: total = 25.6GB, used = 24.7GB, free = 0.9GB

macOS was using ~24.7GB of swap on my machine. With the non-streaming run (17GB peak on top of an already-swapping system), the OS is clearly under memory pressure — the high "wait" time (75.8s of 76.6s) is memory bandwidth / data movement, not GPU compute (root-gpu only 2.16s). With ssd-streaming (2GB DiT peak), the extra memory pressure is negligible.

Observations (fanless Air)

  • No thermal shutdown or visible throttling during ~100-160s runs, but the chassis gets noticeably warm
  • GPU utilization is the bottleneck story: root-gpu is ~2-3% of wall time on both runs — the M5 base's memory bandwidth limits throughput, not the GPU cores

Additional data points

  • 256x256, 4 steps, 40 layers, reuse 3: ~32s total, peak 15.0 GiB
  • 768x448 (render 384x224), 12 steps, 45 layers, reuse 3: ~67s total, peak 16.9 GiB — good balance

Bottom line: on a 32GB base M5, ssd-streaming trades +67% time for -88% memory, and given the system already uses ~25GB swap, that trade is very much worth it. Thanks again for making this possible! 🚀

z6qaz avatar Aug 14 '26 06:08 z6qaz

  1. Clean environment (closed all apps, 87% free memory): 512² DiT went from 79.8s → 77.8s (2.5% diff). The high wait is NOT caused by competing apps.
  2. Live vm_stat 1 monitoring during generation: pageouts stayed ~0/s the entire run (max 15/s). NO swap thrashing happens during generation — the memory bandwidth bottleneck is real, not disk-swap induced.
  3. Controlled variable test (fixed --steps 20 --layers 45 --reuse 2, only changed resolution): 256² = 41.7s vs 512² = 77.8s DiT time.
  4. The 24.7GB swapusage number is pre-allocated swap files, not active swapping — my live monitoring confirms this.

So the data stands: on a 32GB base M5, the bottleneck is unified memory bandwidth, not swap or thermal. The GPU is busy only ~2-3% of wall time.

z6qaz avatar Aug 14 '26 07:08 z6qaz