Repository navigation
fix: keep the last subsampled frame for unified mels of 8k+1 frames - #111
Merged
localai-org-maint-bot merged 1 commit intoOct 30, 2026
Merged
localai-org-maint-bot merged 1 commit into
localai-org-maint-bot merged 1 commit into
Conversation
The unified frontend trims the mel to NeMo's valid length, so every mel frame is valid. The offline subsampling still assumed the untrimmed convention (valid length = T - 1, one trailing pad frame from center padding). The three stride-2 convolutions map a length n to ceil(n / 2), so T and T - 1 give different valid output lengths when T = 8k + 1, for example 625 frames (a clip of 100000 to 100159 samples). There the last output frame was masked to zero: 78 valid frames instead of 79. The encoder output differed from NeMo by 0.115 and the transcript lost its last tokens. Take the entry valid length as T when the checkpoint trims the mel (parakeet.unified.valid_length), in the single, batched and tiled offline paths. Other models keep T - 1 and are unchanged. Add a checkpoint-free test of the valid output length with the gate on and off. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code]
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.
What
Fix a numerical mismatch with NeMo for the Nemotron unified ASR checkpoint on clips whose trimmed mel has
8k + 1frames (for example 625 frames, a clip of 100000 to 100159 samples).Cause
The unified frontend trims the mel to NeMo's valid length, so every mel frame is valid. The offline subsampling still assumed the untrimmed convention (valid length =
T - 1, one trailing pad frame from center padding). The three stride-2 convolutions map a lengthntoceil(n / 2), soTandT - 1give different valid output lengths whenT = 8k + 1. There the last output frame was masked to zero (78 valid frames instead of 79), which changed the encoder output and dropped the last tokens.Change
Subsampling::offline_entry_valid(T)returnsTwhen the checkpoint trims the mel (parakeet.unified.valid_length) andT - 1otherwise. The single, batched and tiled offline paths andvalid_out_lenuse it. Other models keepT - 1and are unchanged. Streaming paths pass explicit lengths and are not affected.Verification
Unified f32 GGUF, English, against NeMo (encoder max abs difference, tokens):
test_unified_synthetic).ctest -LE model: all pass on a CPU build.This also explains the two failing runs of
test_unified_streamseen with a window of exactly 625 frames.🤖 Generated with Claude Code