Apple Silicon (M2) Benchmark & Optimization Notes — ONNX CPU is ~3-5x faster than PyTorch
Thank You!
First of all, huge thanks to the OpenMOSS team for this amazing project! A 0.1B param TTS model that produces quality 48kHz stereo audio and runs on CPU is genuinely impressive. The ONNX version is a game-changer for local deployment.
Setup
- Machine: Mac mini (M2, 8GB)
- macOS: Sequoia
- Python: 3.13 via Homebrew + venv
- Environment: No conda; installed
openfstvia Homebrew to buildpynini==2.1.7, thenWeTextProcessingviapip install --no-deps
Benchmark Results
Short text (~19 chars, 六國論 first sentence)
| Method | Time |
|---|---|
| PyTorch CPU fp32 | ~19s |
| PyTorch MPS fp16 | ~118s (slower!) |
| ONNX CPU 2 threads | ~3.7s |
Long text (~459 chars, 岳陽樓記 full text)
| Method | Time |
|---|---|
| PyTorch CPU fp32 | ~218s |
| ONNX CPU 2 threads | ~67s |
Key Findings
- ONNX CPU is the fastest path on Apple Silicon — ~3-5x faster than PyTorch
- MPS (Apple GPU) does NOT help — the 0.1B model is too small; data transfer overhead between CPU and GPU dominates
- CoreML EP fails — ONNX models use external
.datafiles which are incompatible withCoreMLExecutionProvider - Thread count matters — ONNX with 2 threads is optimal on M2 (4 performance + 4 efficiency cores); more threads cause contention
- WeTextProcessing works on Apple Silicon — built
pynini==2.1.7from source afterbrew install openfst
Minor Issues Found
app.pyhardcodesdevice=cpueven when--device autois passed (ignoring MPS/CUDA)resolve_device()does not checktorch.backends.mps— falls through to CPU on Apple Silicon- No
CoreMLExecutionProvideroption in ONNX path - Default
--cpu-threads 4may not be optimal for Apple Silicon (2 threads was faster in our tests)
Successful Generations
- ✅ 六國論 (full text, 655 chars) — male voice clone
- ✅ 岳陽樓記 (full text, 459 chars) — male voice clone
- ✅ Web demo (
app.py) working with all features
Thanks again for open-sourcing this wonderful project! Looking forward to MOSS-TTS 2.0
Thanks a lot for the detailed optimization notes! The Apple Silicon results are very helpful. Your observation that ONNX Runtime CPU is the best path on M2 is consistent with our expectations for this model size. Thanks again for testing and sharing the setup details.
Try https://huggingface.co/mlx-community/MOSS-TTS-Nano-100M in MLX-Audio