An ExecuTorch 1.5.1 export of gradium/phonon-31m-en
(revision 541f575) and its decoder gradium/phonon-mimi
(revision 33519be), for XNNPACK, the CPU backend. For everything about the model itself, see
the original model card. This card only covers
the export.
| file | weights | size |
|---|---|---|
xnnpack_int8/phonon.pte |
dynamic int8 (GPTQ) transformer and flow head, the rest fp32 | 112 MB |
xnnpack_fp32/phonon.pte |
fp32 | 190 MB |
tokenizer.json |
the model's tokenizer (its tokenizer.5.0.0.json) |
|
voices/*.bin |
the 37 English voices of gradium/phonon-voices, voices.json lists them |
9 MB |
One program, five methods. Only forward and decode have state, kept inside the program.
embed_prompt(input_ids [1,T] int64, voice [P,512]) -> embeds [1,T,512]
embed_latent(latent [1,1,32]) -> embeds [1,1,512]
forward(embeds [1,T,512], cache_position [T] int64) -> hidden [1,512], eos [1]
flow(hidden [1,512], noise [1,32]) -> latent [1,32]
decode(latents [1,C,32], frame [1] int64) -> waveform [C*1920], float32 at 24 kHz
tokenizer.json, without special tokens. Text longer than
get_max_text_tokens (50) is split as the processor's split_text does, and each piece is
spoken on its own.get_audio_prompt_token_id per voice frame, then the text,
then get_audio_bos_token_id. A voice file is little-endian float32 [frames, 512]
(125 frames).forward(embed_prompt(ids, voice), 0..T-1).latent = flow(hidden, randn(1, 32) * sqrt(get_temperature)).eos over get_eos_threshold starts a countdown of get_frames_after_eos
frames. Texts of at most get_short_text_max_words words use
get_frames_after_eos_short_text instead. The frame on which the countdown reads zero is
the last one, and is kept.forward(embed_latent(latent), [next position]) for the next frame.frame the index of the chunk's first frame. Frame 0 resets
the decoder. Decoding a sentence a few frames at a time gives the same audio as decoding it
whole, so playback can start after the first frames.The cache holds get_max_cache (1024) positions, prompt included. The other constants are
methods too: get_sample_rate, get_samples_per_frame and get_latent_dim.
All of these are numerically equivalent to upstream:
ceil, which does not
lower.In xnnpack_int8, the transformer's and the flow head's linear layers are dynamic int8, with
per-channel int8 weights rounded by GPTQ. GPTQ was calibrated on 99 English sentences
(export/calib_en.txt). Mimi stays fp32.
metadata.json records each export, including what XNNPACK delegated. ops.txt lists the
portable kernels a selective ExecuTorch build needs. export/ holds the scripts:
python export/export_phonon.py --model-dir phonon-31m-en --mimi-dir phonon-mimi \
--out-dir xnnpack_int8 --int8 tts,flow --gptq --calib export/calib_en.txt
Each export checks itself against eager PyTorch. It feeds both eager's latents frame by frame, then decodes them whole and a frame at a time:
Round-trip WER on 40 held-out English sentences, 3 seeds each, transcribed by asr4all-m. It measures the TTS and the recogniser together, so it is only a comparison:
| WER | |
|---|---|
| eager PyTorch | 2.34% |
xnnpack_fp32 |
2.34% |
xnnpack_int8 |
1.91% |
Speed is per 80 ms frame of audio, on 4 threads of an i9-12900K:
| transformer + flow | real-time factor | first audio | |
|---|---|---|---|
xnnpack_fp32 |
4.1 ms | 0.091 | |
xnnpack_int8 |
2.4 ms | 0.07 | ~30 ms after the text |
Apache-2.0, as Phonon and its voices (see LICENSE). The programs, tokenizer and
voice files are converted from Gradium's phonon-31m-en, phonon-mimi and phonon-voices.
voices/alfie.bin 256 kBvoices/azgorath.bin 256 kBvoices/bryony.bin 256 kBvoices/captain-silas-blackwater.bin 256 kBvoices/delia.bin 256 kBvoices/easton.bin 256 kBvoices/edwin.bin 256 kBvoices/elodie-rose.bin 256 kBvoices/everly.bin 256 kBvoices/fairy-godmother.bin 256 kBvoices/fennick-the-young-elf.bin 256 kBvoices/freya.bin 256 kBvoices/grub-the-ogre.bin 256 kBvoices/hadley.bin 256 kBvoices/harper.bin 256 kBvoices/hugh.bin 256 kBvoices/imogen.bin 256 kBvoices/juniper.bin 256 kBvoices/lottie.bin 256 kBvoices/maeve.bin 256 kBvoices/master-aldric.bin 256 kBvoices/micah.bin 256 kBvoices/miles.bin 256 kBvoices/morwenna-of-the-deep.bin 256 kBvoices/old-mortlake.bin 256 kBvoices/pippa.bin 256 kBvoices/preston.bin 256 kBvoices/russell.bin 256 kBvoices/sir-bramwell.bin 256 kBvoices/spencer.bin 256 kBvoices/teddy.bin 256 kBvoices/the-snow-queen.bin 256 kBvoices/the-thing-under-the-stairs.bin 256 kBvoices/toby.bin 256 kBvoices/trevor.bin 256 kBvoices/vyrmathrax-the-ancient.bin 256 kBvoices/zoey.bin 256 kBgradium/phonon-31m-en