Repository navigation
New Community Model: ZONOS3-Mini (Zyphra) - #1271
Conversation
…heir logits (MoeScoring::SelectedSoftmax)
|
@Ryu1845 Thanks for the PR! I tested the PR on CUDA and Vulkan, but both failed to run:
For an initial model port PR, the expectation is simply that it works correctly end to end across backends. There are some optimization opportunities (e.g., using framework modules instead of raw GGML ops can often improve performance), but those can be addressed in follow-up PRs. |
|
Thank you for the review I'll try to get this fixed ASAP |
Use framework sigmoid and SiLU modules and materialize embedding index views before row lookup. Replace the SSL teacher's 31-tap SSM convolution with DepthwiseConv1dModule while retaining BF16 rounding. Pad raw-reference activations with time contiguous to avoid CUDA grid-Y limits. Verified CUDA and Vulkan TTS and five-second raw-reference cloning on RTX 4090, including CFG and condition buckets. CPU reference parity passes; the existing CPU backbone parity discrepancy is unchanged from the pre-fix implementation.
|
OK this should be fixed |
|
@Ryu1845 Thanks for the update! I'll try to review the PR later today. |
|
@Ryu1845 Thanks! PR merged. I'll do some optimizations and cleanup for this model since it's relatively new. |
|
Perhaps make zyphra-textnorm opt-in (AUDIOCPP_ZONOS3_TEXTNORM) globally? That is, for all TTS models. It's a port of https://github.com/NVIDIA/NeMo-text-processing which is something I use for every TTS system (and why all my frontends used to be python before finding out about this port). |
Many models use different normalization libraries in their Python implementations. If multiple models in audio.cpp use the NeMo frontend in their official implementations, it will be promoted to the framework. |
Unfortunately some models don't use any during inference even though some may have been used during training. For example, PocketTTS. It may not even have used it during training which can result in some odd outputs without normalization based on frequencies of certain forms of address. Generally speaking, which text normalization is used matters far less than at least something is used. I don't believe it can make a model worse. Merely having the option to force zyphra-textnorm on text for TTS would be sufficient. |
Summary
Adds
zonos3, a community port of Zyphra's ZONOS3-Mini TTS model. It is ported from the native ggml runtime in Zyphra/ZONOS3 (servers/ggml, MIT) and built on audio.cpp framework modules.backbone.cpp): 11 layers at width 1024. Two layers use global GQA attention and nine use Gated DeltaNet. Every layer is joined by Full AttnRes. Layer 0 has a dense SwiGLU FFN; layers 1-10 use a latent top-2-of-64 MoE. Output is 10 delayed 4096-entry codebooks at 15 Hz, with a softcap of 15.prompt.cpp,sampler.cpp,generator.cpp): the prompt layout, the per-codebook sampler (repetition penalty, temperature, top-k, top-p, min-p) and the delayed-codebook loop with the speaker-CFG twin.codec_decoder.cpp): the KEEP-2 MR-iSTFT decoder with a host iSTFT/resampler tail, producing 44.1 kHz audio. It streams incrementally.speaker_encoder.cpp): MECT-B2, which produces a 192-d embedding. It uses the framework Kaldi fbank and resampler.reference_encoder.cpp): the ZAC encoder with a w2v-BERT teacher, which turns a clip into reference codes..npy, condition buckets, speaker CFG, long-form chunking, and an LRU voice cache.LlamaBpeTokenizer. Text normalization uses zyphra-textnorm and is opt-in (AUDIOCPP_ZONOS3_TEXTNORM).MoE routing and expert compute run through
MoeModule, and the optional expert cache (zonos3.disk_experts) runs throughDiskExpertWeightStore(decode) andStagedMoeRuntime(prefill), as requested in #1231 (reply in thread).Framework change
MoeScoring::SelectedSoftmax(commitframework: MoE routing can weigh selected experts by the softmax of their logits). ZONOS3 ranks experts by raw router logits plus a selection bias, then weighs the selected experts by the softmax of their logits. That is top-k first, then softmax. The existing modes apply softmax or sigmoid before ranking, so they weigh experts differently. The new mode is an additional enum value: existing callers are unchanged.moe_module_testcovers it against the host reference:The branch is rebased on
eeeca9e8(#1270, MoE hybrid CPU/GPU expert execution). On the rebased tree,prepared_graph_test,disk_expert_weight_store_testandmoe_module_testpass, and the zonos3 parity numbers are unchanged. zonos3 does not opt into the new hybrid placement.Build
Run
Models
Zyphra/ZONOS3-Minigguf/)zonos3_mini_ptq(default)backbone-ptq.gguf,zac-keep2.gguf,spk-encoder.ggufzonos3_mini_ptq_raw_referencezac-encoder.gguf,ssl-teacher.ggufParity
These run against outputs of the ZONOS3 native tools (
tests/community_models/zonos3/make_oracle.sh). They are registered as CTest tests whenAUDIOCPP_ZONOS3_MODEL_DIRandAUDIOCPP_ZONOS3_PARITY_DIRare set:zonos3-cli --dump-logits. The pass threshold is cosine ≥ 0.9999 and argmax ≥ 0.99.zonos3_text_testcovers language codes,.npyvoice files, line-break collapse and phoneme-marker rejection.zonos3_tokenizer_testchecks token ids against ZONOS3's tokenizer fixture.Quality
Qwen3-ASR-1.7B on the generated audio: 4 English prompts × seeds {1, 2}, CPU. Text normalization was off. Speaker cosine is measured with the MECT-B2 encoder against the reference clip.
zonos3-clidisk_expertsEvery error is on the prompt containing "7" and "3": the ASR transcribed them as "seven" and "three", which the scorer counts as different words.
text_chunk_size=300produced 6 chunks and 73.9 s of audio, withreached_limit:falseand 0.45% WER.reference_codes_file,cfg_scale=1.5andcondition_buckets=4,10,30all produce the same audio aszonos3-cli: same length, max |diff| 3.05e-5 (1 LSB). Streaming output is bit-identical to offline output.AUDIOCPP_ZONOS3_TEXTNORM=ON, "It costs $42." comes back from ASR as "It costs forty-two dollars."Performance
Apple M3, 8 CPU threads, 27-word sentence. Wall time is the session wall time after load, and clone rows include encoding a 10-second
--voice-refclip.disk_expertsdisk_expertsspk-encoder-clitakes 3.38 s.audiocpp_server, streaming mode): 5POST /v1/audio/speechrequests (3 plain, 2voice_ref, one of them SSE/PCM) all returned 200. The SSE response had 7speech.audio.deltaevents beforespeech.audio.done. The secondvoice_refrequest took 6.6 s instead of 23.4 s because the voice cache skipped the encoder. Peak RSS was 1.29 GiB (/usr/bin/time -l, after Ctrl-C).expert_cache_size=8loggeddisk_experts.expert_loads 1530anddisk_experts.cache_hits 949.Backends tested
disk_expertsall work. WER on the 8 plain takes is 1.54% both resident and withdisk_experts; the performance table is above. Raw-reference encoding has not been run on Metal.Known limitations
steer.gguf,accents.gguf,backbone-ptq-edit.gguf) or Python workers.zac-encoder-cli(1,738 CPU-seconds), and peaks at about 3.4 GiB RSS. It is released after each encode by default. On non-CPU backends its Snake activation falls back to sin/mul ops, and that path is untested.License
The weights are Apache-2.0 according to the model card. The runtime code is ported from Zyphra/ZONOS3 (MIT). zyphra-textnorm (MIT) is linked only with
AUDIOCPP_ZONOS3_TEXTNORM=ON. A row is added todocs/model_licenses.md.