Repository navigation
Expose Qwen3 TTS optimization controls and extend cuda_perf preset - #1055
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.
Expose Qwen3-TTS attention, packed projections, KV-cache write mode and KV dtype controls. The
cuda_perfpreset enables the optimized combination; explicit session options override the preset.Default attention
Keep
attention=mixedas the default: manual prefill plus flash cached decoding with contiguous K/V, matching main's original attention policy. These operations stay on the selected backend.The initial PR default selected flash with strided K/V on Metal. Testing found approximately 10% slower short requests, despite a 2.7% warm RTF improvement on a 1,102-character request. The small code-predictor cache became slower while the long-context talker became faster. This tradeoff should be opt-in rather than silently changing the default.
After restoring mixed attention, Metal warm RTF is within 1.2% of main for both short and long requests.
cuda_perfremains opt-in; it is not a general performance recommendation for Metal.CUDA measurements
Measured against main HEAD
12cd5bb1, using main'sqwen3_tts.perf_mode=perf_firstand this PR's equivalentqwen3_tts.perf_mode=cuda_perf. These measurements were collected before the PR preset was renamed fromperf_firsttocuda_perf.CUDA RTX 5090, Debug build, 1.7B Q8 GGUFs, 8 host threads. The same 50 published CV3-Eval inputs cover English, Chinese, Japanese, French, and German: 25 CustomVoice and 25 VoiceDesign requests. Each model runs in one session after one excluded warmup.
Warm RTF is total
session.wall_ms, converted to seconds, divided by total generated audio duration. Peak VRAM is sampled per process every 20 ms, including loading and warmup. Identical inputs and sampling settings are used; F16 KV storage can change generated samples and durations.Vulkan long-form measurements
Main
12cd5bb1versus PRf2287955, RTX 5090, matching Vulkan-only Debug builds, 12 host threads, 1.7B Q8 GGUFs. Three distinct inputs of 1,240-1,386 characters per mode, in one session after one excluded warmup. Identical inputs, seeds, and sampling settings; both default runs leave session options unset. Only the third configuration setsqwen3_tts.perf_mode=cuda_perf.cuda_perfcuda_perfNo measured default RTF regression in these cases.
cuda_perfalso benefits Vulkan here: approximately 1.31x faster than main, with 31% less peak VRAM. Outputs differ, so RTF uses each output's actual duration; ASR was not rerun for this performance comparison.