Repository navigation
Fix Voice Isolator offline Metal projection overflow - #1359
Merged
Merged
Conversation
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.
Change
Fix NaN output from the offline Voice Isolator checkpoint on Metal.
Long offline Mamba scans produce valid activations above FP16's maximum of
65,504. Tracing found peaks of 120,102 before a Mamba output projection and
68,108 before the bidirectional combining projection. The default Metal F32
matmul narrows its operands internally to FP16, overflowing these inputs.
Select the existing full-F32-input Metal matmul lowering for those projection
nodes before graph expansion. Convert BF16 stored projection weights to F32
when this lowering is selected. Keep using the shared Mamba and Linear modules.
The change is confined to
src/community_models/voice_isolator/network.cppandgated to Metal with the noncausal checkpoint. Realtime streaming, other backends,
framework modules and GGML kernels remain unchanged.
Validation
end to end on M4 Pro / Metal with native F32 and explicit BF16 weights.
native Metal output has 80.9 dB waveform SNR and 0.999999997 cosine similarity.
120,102 on default Metal, while the existing F32-input lowering returns the
exact finite sums. CPU results are unchanged with the precision selection.
Probes and logs stay local; no weights or reports are added to the repository.