Skip to content

Add opt-in BF16 activation rounding for Qwen3 TTS - #1248

Merged
0xShug0 merged 1 commit into
mainfrom
fix/qwen3-tts-bf16-activations
Nov 9, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
fix/qwen3-tts-bf16-activations

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

BF16 GGUF weight storage alone does not reproduce the original model’s BF16 activation arithmetic. On the Russian VoiceDesign fixture in #1244, the default path produces a female-sounding voice despite the requested male description.

Add qwen3_tts.activation_type=f32|bf16, defaulting to f32. The opt-in BF16 path uses existing framework rounding and decoder policies for text projection, talker and code-predictor activations. No shared framework or kernel changes. Weight storage and perf_mode remain independent.

To enable:

--session-option qwen3_tts.activation_type=bf16 \
--session-option qwen3_tts.attention=flash

Validation

  • Used the issue’s exact pinned BF16 GGUF, Russian text and Russian voice description, seed 42 and sampling parameters on RTX 5090.
  • The BF16-activation output was confirmed male-sounding by listening. Its estimated median F0 was approximately 111 Hz. The official Python BF16/eager control was approximately 115 Hz; promoting the same BF16 weight values to F32 yielded approximately 222 Hz. F0 is supporting evidence, not a gender classifier.
  • With the new option omitted, the tested CUDA output is byte-identical to main. Single-request default-path RTF was 0.1125 before versus 0.1118 after, within run variation.
  • Two identical requests in one BF16-activation session produced byte-identical WAVs, also matching the standalone request.
  • Debug C++17 build, loader/spec catalog self-tests and synchronization checks, and git diff --check passed.

Performance cost

Both rows use flash attention and the same request. These are single-request measurements, not a controlled warmed benchmark; the generated audio lengths differ.

Activation rounding Generation time Audio duration RTF
F32 1.85 s 17.68 s 0.105
BF16 3.77 s 20.96 s 0.180

BF16 rounding increased RTF by approximately 72% in this comparison. It is a compatibility option, not a performance preset. It does not guarantee identical tokens or waveforms across PyTorch attention implementations or hardware.

Closes #1244.

@0xShug0
0xShug0 force-pushed the fix/qwen3-tts-bf16-activations branch from 0a750b6 to 3750467 Compare November 9, 2026 14:49
@0xShug0
0xShug0 merged commit 2ba64b7 into main Nov 9, 2026
7 checks passed
@0xShug0
0xShug0 deleted the fix/qwen3-tts-bf16-activations branch November 9, 2026 15:44
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.

Qwen3-TTS VoiceDesign BF16: male voice prompt produces female-sounding speech compared to PyTorch (v0.9.2, CUDA)

1 participant