Skip to content

Add opt-in CUDA SSM gate fusion and tiled F32 im2col - #600

Merged
0xShug0 merged 2 commits into
mainfrom
perf/cuda-ssm-im2col-lowerings
Sep 18, 2026
Merged

0xShug0 merged 2 commits into
mainfrom
perf/cuda-ssm-im2col-lowerings

Conversation

@0xShug0

@0xShug0 0xShug0 commented Sep 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add an explicit opt-in CUDA fusion for an SSM scan followed by residual scaling and a SiLU gate
  • add an explicit opt-in tiled CUDA lowering for F32 3x3 im2col
  • preserve the existing default paths for every unmarked graph

Both optimizations require callers to select the new API marker. The CUDA dispatcher also validates the expected operation sequence, tensor types, shapes, layouts, use counts, and memory aliases before applying the SSM fusion.

Performance

Measured sequentially on an RTX 5090 with a representative 120-second chunked audio workload using the debug build, 8 CPU threads, 10-second chunks, and 1-second overlap:

Configuration Median network time
Existing CUDA paths 4000.7 ms
Opt-in SSM gate fusion 3453.7 ms
SSM fusion + opt-in tiled im2col 3255.2 ms

The combined path is 1.23x faster than the existing CUDA paths. The tiled im2col lowering adds another 1.06x speedup over the SSM-only path.

Nsight confirmed 120 fused SSM launches and 42 tiled im2col launches. Nine ineligible im2col nodes remained on the existing default kernel. Three repeated outputs with both optimizations were byte-identical to the SSM-only outputs, and graph workspace size was unchanged.

Validation

  • built audiocpp_cli from build/debug
  • ran three sequential end-to-end measurements with --log
  • verified kernel dispatch with Nsight Systems
  • verified repeated output hashes and output equivalence

@0xShug0 0xShug0 added the ggml label Sep 18, 2026
@0xShug0
0xShug0 merged commit 82b4dc3 into main Sep 18, 2026
6 checks passed
@0xShug0
0xShug0 deleted the perf/cuda-ssm-im2col-lowerings branch September 18, 2026 06:13
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