Repository navigation
Align CUDA reference-encoder precision for Fish Audio and Drama 3 - #937
Merged
Merged
Conversation
0xShug0
force-pushed
the
fix/fish-codec-cuda-bf16-encoder
branch
from
October 16, 2026 20:51
82d2334 to
5ea78d0
Compare
5uck1ess
added a commit
to 5uck1ess/audio.cpp-fork
that referenced
this pull request
Oct 17, 2026
cunba-ai
pushed a commit
to cunba-ai/audio.cpp
that referenced
this pull request
Oct 28, 2026
…precision + WebUI voice listing + RKNN docs Upstream commits 0fdc572..498d4ae (14): - fix(build): gate family tests on the linked model set (0xShug0#925) - f5_tts CPU passes inside graph pool ceiling; evicted graphs freed (0xShug0#924) - Qwen3-TTS spec description trim; Inflect v2 ONNX prefix strip (0xShug0#933) - CPU Fish DAC reference-encoder tensor layouts (0xShug0#936) - Fish codec CUDA encoder precision aligned with Python (0xShug0#937) - C++17 lambda capture fix in parallel server unload (0xShug0#939) - fix(build): model unit tests compile their own family sources (0xShug0#932) - fix(build): split compiled-in model specs into 16KB literals (0xShug0#934) - webui: list/preview server voices (0xShug0#941,0xShug0#943); RKNN docs + IOVA ceiling (0xShug0#945,0xShug0#949)
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 optional CUDA BF16 reference-encoder arithmetic for Fish Audio and Drama 3:
fish_audio.codec_encoder_bf16_computefish_drama3.codec_encoder_bf16_computeFish Audio defaults to false. Drama 3 defaults to true on its model-local configuration; the mode only applies on CUDA with F16/BF16 codec weights. Set
fish_drama3.codec_encoder_bf16_compute=falseto restore its previous encoder arithmetic. This intentionally changes Drama 3 reference-conditioned generation. The generic framework default remains false. Align encoder convolution, Snake, transformer and RVQ rounding with the Python codec. Decoder behavior is unchanged. Extend existing Conv1d with an opt-in BF16 path and CUDA im2col with BF16 output dispatch; existing F32/F16 paths remain unchanged. Update specs, help and model documentation, including standalone legacy-contract handling.Follow-up to #936 / #935; this does not replace the merged CPU layout fix.
Codec parity
Codec-only roundtrips against the native Python reference, not end-to-end TTS:
Controlled F32 tests using identical GGUF weights achieve 100% code agreement for both codecs. Native BF16 code IDs are not bit-identical to Python. Python cold/warm execution also varies; on the measured same-weight Fish case, common-decoder C++ versus warm-Python waveform drift is comparable to Python cold versus warm drift. This is not a claim of universally identical perceptual quality.
Performance
RTX 5090, Debug build, same approximately six-second reference WAV, sequential measurements. Off/on refers to the new option.
These are codec timings, not end-to-end TTS RTF.
Validation and scope