Skip to content

Fix Voice Isolator offline Metal projection overflow - #1359

Merged
0xShug0 merged 1 commit into
mainfrom
fix/voice-isolator-offline-metal-range
Nov 21, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
fix/voice-isolator-offline-metal-range

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 21, 2026

Copy link
Copy Markdown
Owner

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.cpp and
gated to Metal with the noncausal checkpoint. Realtime streaming, other backends,
framework modules and GGML kernels remain unchanged.

Validation

  • Rebuilt against updated main and ran the existing 14.072-second speech sample
    end to end on M4 Pro / Metal with native F32 and explicit BF16 weights.
  • Both offline outputs are finite and unclipped, replacing the all-NaN output.
  • Repeated offline float outputs match exactly. Against a fresh CPU reference,
    native Metal output has 80.9 dB waveform SNR and 0.999999997 cosine similarity.
  • Realtime streaming PCM matches the unmodified implementation exactly.
  • Independent analytic matmul probe reproduces overflow with inputs 65,536 and
    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.

@0xShug0
0xShug0 merged commit 9fec14f into main Nov 21, 2026
7 checks passed
@0xShug0
0xShug0 deleted the fix/voice-isolator-offline-metal-range branch November 21, 2026 04:19
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.

1 participant