Skip to content

Add MossFormer2 speech enhancement and super-resolution - #1277

Merged
0xShug0 merged 2 commits into
mainfrom
feature/mossformer2-se-sr
Nov 13, 2026
Merged

0xShug0 merged 2 commits into
mainfrom
feature/mossformer2-se-sr

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Add MossFormer2 SE 48K speech enhancement and SR 48K speech super-resolution to the existing mossformer2 family, alongside SS 16K separation. An explicit registration table selects the variant once at load time. Includes GGUF conversion, package specifications, usage documentation and validation coverage.

Changes stay within the model implementation, build registration and documentation; no framework or GGML changes.

Performance versus Python

RTX 5090, CUDA, Debug build, eight threads, ordinary runtime settings. Results use warmed requests covering six recordings, long chunked audio and long-to-short session reuse. RTF is duration-weighted across ten measured requests and averaged over two blocks; model loading and WAV writing are excluded. Peak VRAM is process GPU memory. Python uses its original F32 checkpoints; audio.cpp uses SE F32 and SR F16 GGUFs.

Variant Python RTF audio.cpp RTF Processing-time reduction Python peak VRAM audio.cpp peak VRAM
SE 48K F32 0.01526 0.00776 49.2% 1,026 MiB 953 MiB
SR 48K F16 0.03444 0.02019 41.4% 2,328 MiB 2,223 MiB

Both run orders outperform Python overall; individual short recordings are not uniformly faster.

Correctness and validation

  • Preserve the last window's trailing samples in SS, SE and SR chunk stitching. SE also pads partial analysis frames before reconstruction, then crops to the requested length.
  • SR checks bandwidth before inference: silence and inputs reaching Nyquist pass through unchanged.
  • CUDA, Vulkan and CPU boundary tests passed. SE retains signal through the final sample for 22-second default chunking and 900 ms explicit chunking. SR silence/full-band outputs exactly match the input; ordinary SR requests repeat exactly after these boundary cases.
  • SS F32/F16 passed 42 requests across CUDA, Vulkan and CPU, covering both output tracks, affected chunk boundaries, repeated requests, single-window, whole-file and zero-overlap execution. CUDA A/B: all 12 unaffected outputs match exactly; unnormalized prefixes preceding repaired tails also match exactly.
  • Corrected tails intentionally differ from the previous output. With SS normalization enabled, restoring the tail can also change whole-recording gain.
  • Checked ordinary SE waveform cosine versus Python is 0.99999966. Ordinary SR cosine versus the saved pre-fix CUDA output is 0.9999999958. The original integration comparison against Python exceeded 0.999993 for SR. No precision or determinism overrides were used; SE retains upstream stochastic frontend dithering.
  • Debug builds and model-spec validation passed. Metal execution was not locally validated.

The performance table was measured before the boundary fixes; those fixes received correctness validation without a new performance/peak-VRAM benchmark.

@0xShug0 0xShug0 added the new model Request for new model support label Nov 13, 2026
@0xShug0
0xShug0 merged commit 40c8c86 into main Nov 13, 2026
7 checks passed
@0xShug0
0xShug0 deleted the feature/mossformer2-se-sr branch November 13, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new model Request for new model support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant