Community MLX port: run Maya-2 natively on Apple Silicon Macs

#2
by aruntemme - opened

Hi Maya Research team, and congratulations on the release!

I ported Maya-2 Native inference to MLX, so it runs natively on Apple Silicon Macs. It loads the official weights from this repo unchanged and reuses your release code (normaliser, prompt packer, voices, guards). Only the tensor math is reimplemented:

πŸ‘‰ https://huggingface.co/aruntemme/maya2-native-mlx

On an M4 Max (one stream):

Time to make 1 s of audio Time to first audio
Official engine on MPS (small patch, included in the repo) 0.94 s 120 ms
MLX port, exact 0.41 s 60 ms
MLX port, fast (8-bit backbone + bf16 depth, opt-in) 0.30 s 50 ms

Parity checks against your PyTorch code, on the same inputs:

  • Backbone: error at or below PyTorch's own bf16 noise, with the same cb0 argmax.
  • Depth decoder: logit error vs fp32 of 1.4e-3, against 1.3e-3 for PyTorch fp16.
  • Mimi streaming decoder: 122 dB SNR against StaticMimi.
  • Intelligibility: Whisper character error rate across 8 languages and cross-lingual cloning is in the same range as the official engine.

The repo has the parity scripts and their raw output.

All 20 named voices, streaming, sampling controls and voice cloning work. It handles one stream at a time; there's no batching or server yet.

Two things you might find useful:

  1. A small patch (patches/maya2-mps.patch) lets the official engine run on Apple's MPS backend. On non-CUDA devices it uses gather attention, skips CUDA graphs and Triton, and guards the torch.cuda.* calls. The CUDA path is unchanged. I'm happy to open it as a GitHub PR if you'd like it upstream.
  2. A parity pitfall: AudioInputEmbed.norm is nn.RMSNorm with no explicit eps, so on bf16 inputs PyTorch uses fp32's epsilon. A port that assumes bf16's eps gets the backbone feedback embedding 50% wrong.

This is unofficial and not affiliated with you; all credit for the model goes to your team. Thanks for open-sourcing it!

Sign up or log in to comment