Repository navigation
Qwen3-TTS: add optimized streaming mode - #1011
Merged
Merged
Conversation
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
Add
qwen3_tts.perf_mode=optimizedas a shortcut for flash attention, FP16 convolution weight storage, and stateful streaming decoding. Individual session options remain available and override the preset. Existingoffandflash_attentionmodes retain their preset meanings. KV alignment now defaults to 256 in every mode.The mode offers a streaming throughput/VRAM tradeoff. Stateful decoding retains convolution and attention history rather than repeatedly decoding overlapping windows; its exact-length graphs are owned and reused by the session.
CUDA streaming: main vs this branch with optimized mode
c677d5e6)optimized26.69% lower RTF, with 1532 MiB higher sampled peak VRAM.
Conditions: RTX 5090, Qwen3-TTS 12Hz 1.7B CustomVoice BF16 GGUF, Aiden, English, seed 42; temperature 0.9, top-k 50, top-p 1.0, repetition penalty 1.05, max tokens 2048. Same 50 CV3 English inputs in the same order; 47 measured after excluding the first three corpus requests, following three preliminary warmups. Streaming chunks grow 1 → 2 → 4 → 8 → 12 frames. Four threads, cached Debug build with
-O3 -g, CUDA graphs and OpenMP enabled. Measurements ran sequentially, with a fresh server for each configuration.TTFA is client-observed arrival of the first nonempty streamed audio. RTF is summed generation time divided by summed generated audio duration. Process VRAM was sampled with
nvidia-smievery 100 ms during loading, warmup, and inference; shorter spikes may be missed. These are single-pass measurements. Generated duration differs between numerical paths: main 290.08 s, optimized 287.84 s.This comparison includes the whole branch, including the unconditional changes below; it does not attribute the full gain solely to selecting the preset.
Enable
The constituent options remain configurable:
Scope and behavior
import_state()callers. No vendored ggml changes or new dependencies.optimized. Stateful decoding uses more graph memory and rejects the unsupported RKNN combination rather than silently falling back.Validation
--version, with source/binary provenance saved locally.session.wall_ms.git diff --checkpassed.The end-to-end performance sweep covers CustomVoice BF16 on this CUDA setup. Base, VoiceDesign, other weight precisions, and other accelerators have not received the same end-to-end sweep.