feat: add native MiraTTS community model - #395
Conversation
|
Added native MiraTTS segment-level streaming in The streaming session now:
Validation performed:
This is genuine progressive segment streaming. Each segment still runs the acoustic processor, DAC decoder, and FlashSR as a complete unit; token-level neural-codec streaming remains a possible future optimization. |
ec7f476 to
f5bdacb
Compare
|
Added commit Included
Original MiraTTS versus audio.cpp Q8
* The original cold request paid a one-time ONNX Runtime CUDA fallback cost; warm measurements are the representative steady-state comparison. The three warm short requests average 0.908 s upstream and 1.570 s in native Q8, making the original implementation about 1.73× faster in this measurement. For the 15.36-second long-form case, the original achieved RTF 0.1938 (5.16× real time), while native Q8 achieved RTF 0.3106 (3.22× real time). This is not precision-matched: the original uses BF16 while native uses GGUF Q8. The original also pre-encodes and retains the reference context, whereas native currently processes the reference input on each request. CUDA offline — long-lived session
The three identical requests remain bit-deterministic before and after the changed-prompt and long-form requests. CUDA streaming
Streaming emits multiple independently consumable audio events, and the merged repeat is bit-deterministic. Python/native decoder parity
This exact-token comparison uses identical upstream speech and context tokens, isolating the native processor/decoder path from autoregressive sampling. Resident memory — Q8 CUDA
These are held-resident samples rather than instrumented peaks across model loading. Backend coverage
Validation passed for all saved CUDA offline and streaming cases. |
f5bdacb to
fb2150b
Compare
|
I am working on performance optimization now and seems a shared Qwen runtime bug: the cached graph’s compact-logit index tensor is overwritten by the allocator after its first use, causing an illegal CUDA access on request two uder |
MiraTTS Q8 performance updateCommit
Compared with the previously measured warm original MiraTTS implementation, optimized audio.cpp is now approximately 9–15% faster on the repeated and long-form cases. The original cold measurement includes its one-time ONNX fallback/setup cost, so the warm comparisons are the useful ones. What changed
Validation
The CUDA fast ConvTranspose path changes floating-point operation ordering, so WAV hashes differ from the slower path; the strict frame-count and high waveform/log-mel similarity checks confirm that the resulting audio remains effectively equivalent. |
|
@mirek190 Could you isolate the Qwen3 runtime changes into a separate PR? It would make it easier to track commits that introduce behavioral changes. The only affected model by the change is Music3 and I'm not sure about the perf impact on low end GPUs. Another solution is probably not to disable reuse. It should mark the token-id tensor as input, then re-upload BTW, do you know how to stop people from flooding the repo with draft PRs? Pull request limits do not work. |
Sure
If they do not listen ... ban them ;) It is not worth to giving them attention. |
Summary
Adds MiraTTS as an experimental native community TTS/voice-cloning model.
The port runs the full pipeline in C++:
It also adds a local checkpoint converter, model-spec v1 metadata, documentation, and an upstream-reference parity harness.
Implementation notes
min_p, covered by unit tests.ttsandclonoffline routes through the normal loader/session framework.Validation
Builds:
Focused tests:
Results:
mira_tts: tts (offline), clon (offline)Representative CUDA BF16 run:
Measured on RTX 3090:
Reference parity using identical original speech/context tokens:
Conversion
GGUF for testing
https://huggingface.co/mirek190/audio.cpp/blob/main/Text%20to%20audio%20(TTS)/mira-tts-q8.gguf
Current limitations