Skip to content

Add M5-TTS voice cloning, preset synthesis and streaming - #1298

Merged
0xShug0 merged 1 commit into
mainfrom
feature/m5-tts
Nov 15, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
feature/m5-tts

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Adds M5-TTS 50M VoiceClone and CustomVoice for offline and streaming synthesis, including reference-audio cloning, built-in voices, language selection, model documentation and WebUI catalog entries. Four F16/Q8 GGUF packages are published and their spec URLs return HTTP 200.

The implementation reuses the framework causal-decoder runtimes, streaming base, text chunker and Qwen3 speech codec. Graphs, reference conditioning and codec state are session-owned and reused. No framework or GGML changes.

Performance

RTX 5090, Ryzen 9 7900X, eight threads, warmed requests. End-to-end measurements include reference encoding, AR generation and audio decoding; peak VRAM is measured for the process.

Path ONNX reference audio.cpp Peak VRAM, ONNX → audio.cpp
CUDA offline RTF 0.1423 / 0.1397 0.0566 / 0.0564 3.90 → 2.85 GiB
CUDA streaming RTF 0.1644 / 0.1606 0.0615 / 0.0612 2.78 → 2.05 GiB
CUDA streaming TTFA 68.1 / 71.2 ms 50.7 / 46.0 ms —
CPU offline RTF 0.6050 / 0.6105 0.5007 / 0.4694 —

The ONNX reference uses FP32 LM/codec weights; audio.cpp uses production F16 LM and FP32 codec weights. This is a deployment comparison, not a precision-matched kernel benchmark. Outputs differ in length because tokens are sampled independently. Streaming reference-context policies also differ. CPU peak RSS increases from 2.32 to 2.75 GiB for offline inference.

Validation

  • Teacher-forced temporal/local decoder checks align prompt tokens, reference codes and AR inputs with Python. Minimum logit cosine is 0.9999958 across both checkpoints and CPU/CUDA; offline waveform cosine exceeds 0.9999988.
  • CUDA streaming waveform cosine is 0.9999793 against offline Python decoding of the same codes. This documented numerical drift was accepted; the shared codec is unchanged.
  • Normal sampled outputs pass the checked English/Chinese ASR cases: 0% WER/CER, including CUDA, Vulkan and CPU coverage and F16/Q8 packages.
  • Repeated streams, long→short→long reuse, changed/restored seeds and recovery after invalid requests pass, with stable allocated memory and reproducible original-seed PCM.

Known limitation: CUDA reference encoding does not reproduce Python's discrete codes exactly (81.25% agreement in the checked fixture). CPU codes match exactly. Teacher-forced AR tests use Python reference codes and therefore do not establish exact CUDA reference-encoder parity; the optional strict encoder test continues to reject this mismatch.

@0xShug0
0xShug0 merged commit 83b1354 into main Nov 15, 2026
7 checks passed
@0xShug0
0xShug0 deleted the feature/m5-tts branch November 15, 2026 17:32
@0xShug0 0xShug0 mentioned this pull request Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant