Skip to content

Expose Qwen3 TTS optimization controls and extend cuda_perf preset - #1055

Merged
0xShug0 merged 3 commits into
mainfrom
expose-qwen3-perf-control
Oct 22, 2026
Merged

0xShug0 merged 3 commits into
mainfrom
expose-qwen3-perf-control

Conversation

@0xShug0

@0xShug0 0xShug0 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Expose Qwen3-TTS attention, packed projections, KV-cache write mode and KV dtype controls. The cuda_perf preset enables the optimized combination; explicit session options override the preset.

Default attention

Keep attention=mixed as 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_perf remains opt-in; it is not a general performance recommendation for Metal.

CUDA measurements

Measured against main HEAD 12cd5bb1, using main's qwen3_tts.perf_mode=perf_first and this PR's equivalent qwen3_tts.perf_mode=cuda_perf. These measurements were collected before the PR preset was renamed from perf_first to cuda_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.

Model Main warm RTF PR warm RTF Speedup Main peak VRAM PR peak VRAM VRAM reduction
Qwen3-TTS CustomVoice 1.7B Q8 0.0934 0.0684 1.36x 3,850 MiB 3,792 MiB 58 MiB
Qwen3-TTS VoiceDesign 1.7B Q8 0.1104 0.0702 1.57x 3,660 MiB 3,598 MiB 62 MiB

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 12cd5bb1 versus PR f2287955, 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 sets qwen3_tts.perf_mode=cuda_perf.

Model Configuration Warm RTF Peak VRAM
CustomVoice Main default 0.13307 6,074 MiB
CustomVoice PR default 0.12024 6,093 MiB
CustomVoice PR cuda_perf 0.10117 4,184 MiB
Voice clone Main default 0.13327 5,973 MiB
Voice clone PR default 0.11845 5,990 MiB
Voice clone PR cuda_perf 0.10178 4,120 MiB

No measured default RTF regression in these cases. cuda_perf also 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.

@0xShug0 0xShug0 changed the title Expose Qwen3 TTS optimization controls and extend perf_first preset Expose Qwen3 TTS optimization controls and extend cuda_perf preset Oct 22, 2026
@0xShug0
0xShug0 merged commit eb5aa7d into main Oct 22, 2026
7 checks passed
@0xShug0
0xShug0 deleted the expose-qwen3-perf-control branch October 22, 2026 22:24
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