Repository navigation
Conversation
…heir logits (MoeScoring::SelectedSoftmax)
Ryu1845
marked this pull request as ready for review
November 13, 2026 00:21
Owner
|
@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. |
Author
|
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.
Author
|
OK this should be fixed |
Owner
|
@Ryu1845 Thanks for the update! I'll try to review the PR later today. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.