Repository navigation
Fix CPU Fish DAC reference encoding for voice cloning - #936
Merged
Merged
Conversation
5uck1ess
added a commit
to 5uck1ess/audio.cpp-fork
that referenced
this pull request
Oct 16, 2026
5uck1ess
added a commit
to 5uck1ess/audio.cpp-fork
that referenced
this pull request
Oct 17, 2026
ahmednabilfawzy89-cmyk
added a commit
to ahmednabilfawzy89-cmyk/audio.cpp
that referenced
this pull request
Nov 5, 2026
…tokenizer encoder On the CPU backend, the first ggml_sub in HiggsAudioV2EncoderGraph's RVQ loop reads residual_bct (a ggml_permute view from transpose_btc_to_bct) as if it were contiguous, so every codebook after the first is computed from a wrong residual. The reference voice is encoded wrong and voice cloning on CPU loses the speaker. Same bug class as 0xShug0#936. Co-Authored-By: Claude Opus 5.5 <[email protected]>
0xShug0
pushed a commit
that referenced
this pull request
Nov 5, 2026
…tokenizer encoder (#1212) On the CPU backend, the first ggml_sub in HiggsAudioV2EncoderGraph's RVQ loop reads residual_bct (a ggml_permute view from transpose_btc_to_bct) as if it were contiguous, so every codebook after the first is computed from a wrong residual. The reference voice is encoded wrong and voice cloning on CPU loses the speaker. Same bug class as #936. Co-authored-by: Ahmed Nabil Fawzy <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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
Closes #935.
Fix CPU reference encoding in the shared Fish DAC codec by materializing two transposed inputs before normalization and residual subtraction.
The CPU
ggml_div/ggml_subimplementation reads the first operand as contiguous elements when its shape matches the output. These encoder inputs were non-contiguous transposes, so it read the wrong elements. The patch uses the existing framework layout helper; it adds no kernels or precision overrides.Only CPU encoding changes. CUDA, Vulkan, Metal, decoding, and backbone execution are unchanged. Fish Audio and Echo-TTS use the same shared encoder, but were not separately tested here.
Validation
Reproduced with the original Drama 3 Q4_K_S package using the server's
encode_reference_onlypath. No backbone generation was needed. Debug builds, eight threads, sequential runs.codec.pthindependently encoded both references. Fixed CPU code agreement was 97.44% / 95.53%; CUDA agreement was 95.27% / 94.01%.git diff --checkpassed.