Skip to content

Improve Metal SSM performance - #1179

Merged
0xShug0 merged 1 commit into
mainfrom
perf/metal-ssm-gap
Nov 3, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
perf/metal-ssm-gap

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Changes

  • Add opt-in causal convolution/SiLU and compact Mamba scan ops, with internal DT-rank specialization and CPU fallbacks.
  • Add Conv2dConfig.implicit_gemm (default off) for Metal F32 convolution; reuse the existing row-normalization option.
  • Enable these paths only in RE-USE's Metal graph. Existing callers and other backend paths retain their behavior.
  • Replace the superseded tiled SSM-convolution lowering rather than keeping another switch.

Validation

M4 Pro, F32 weights, 60-second audio; one warmup and three measured runs.

Before RTF After RTF Processing-time reduction
0.2910 0.1265 56.5%
  • Maximum waveform difference from the original implementation: 9.54e-6; English/Japanese ASR transcripts match. Cleanup outputs are byte-identical to pre-cleanup outputs.
  • Seven extended Metal tests pass. Both new-op tests also pass Metal API/shader validation, using legacy Metal readbacks and independent double-precision references.
  • Graph workspace increases from 807 MB to 924 MB; these are allocator workspace sizes, not peak VRAM measurements.

@0xShug0 0xShug0 added the ggml label Nov 3, 2026
@0xShug0
0xShug0 merged commit b30d84e into main Nov 3, 2026
7 checks passed
@0xShug0
0xShug0 deleted the perf/metal-ssm-gap branch November 3, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant