Skip to content

cuda: skip noncontributing transpose-convolution taps - #801

Merged
0xShug0 merged 2 commits into
0xShug0:mainfrom
mirek190:perf/cuda-conv-transpose-taps-20261005
Oct 8, 2026
Merged

0xShug0 merged 2 commits into
0xShug0:mainfrom
mirek190:perf/cuda-conv-transpose-taps-20261005

Conversation

@mirek190

@mirek190 mirek190 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

The CUDA conv_transpose_1d kernel checks, divides and rejects every tap for every input channel, even though stride fixes which taps can contribute to an output. Compute the valid tap range once per output and visit only those taps. Keep the original channel order, ascending tap order and accumulation expression, tensor interfaces, launch configuration and supported operation constraints.

This shared backend optimization was found during ACE-Step profiling, but is independent of #715, server slots and ACE-Step adapters. Other models using this existing F32 CUDA operator can benefit. CPU, Vulkan and model precision/settings are unchanged.

Validation on RTX 3090 / Windows:

  • The new actual ggml CUDA operator regression compares against the original kernel for 99 shapes, with four executions per shape, including reused graphs. All outputs were bit-exact. Coverage includes stride one, empty/gapped contributions, boundaries, non-divisible widths, large channel counts and Inf/NaN/signed-zero inputs.
  • Earlier standalone kernel comparisons passed the same 99-shape set. Five large-shape CUDA-event measurements totaled 40.539 ms before / 2.582 ms after (93.6% less kernel time); this is an operator measurement, not a general model speedup.
  • An integration build with the separate safe ACE-Step adapter matched 138/138 original ordered-history outputs in three fresh runs. A separate family benchmark matched 336/336 responses. Those integrations are supporting combined-build evidence, not changes included here or full-family admission.

The independent operator CTest passes in 0.52 s locally. It is registered with ENGINE_BUILD_EXTENDED_TESTS=ON on CUDA builds and skips with code 77 when no CUDA device is available. Local development testing rebuilds the changed kernel object and the operator test while linking unchanged prebuilt ggml libraries; this is not a full clean CUDA rebuild. CI/full build results remain pending.

That optimized the shared CUDA transpose-convolution kernel preserving its accumulation order increases performance ACE-Step family models from 3.5s to 1.3s on RTX 3090 in my test case.

@0xShug0

0xShug0 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

@mirek190 PR merged! Excellent optimization. The scope is narrower than I initially thought because many models already use a different fast path and don’t hit the modified kernel. All 100+ corresponding WAV pairs were byte-identical in A/B.

Model Session before → after RTF before → after Affected component speedup
ACE-Step 1.5 turbo 2,281.67 → 1,634.68 ms 0.11408 → 0.08173 VAE: 3.66×
Seed-VC, HiFT route 391.75 → 345.29 ms 0.03142 → 0.02769 HiFT: 1.47×
Chatterbox 1,367.16 → 1,358.17 ms 0.12612 → 0.12529 HiFT: 1.22×
Kokoro 293.91 → 292.94 ms 0.02342 → 0.02334 Predictor tail: 1.54×
RVC, best → CUDA 391.21 → 272.43 ms 0.02782 → 0.01938 —
KittenTTS 266.92 → 209.64 ms 0.01798 → 0.01412 Waveform decoder: 1.78×
GLM-TTS 1,536.64 → 1,504.90 ms 0.09738 → 0.09537 HiFT: 1.22×
KittenTTS2 1,012.91 → 990.28 ms 0.08964 → 0.08764 S3/HiFT: 1.11×
Maya1 6,517.01 → 6,396.04 ms 0.58299 → 0.57216 SNAC: 4.79×
Chatterbox Turbo 1,247.30 → 1,229.42 ms 0.11380 → 0.11217 —

@0xShug0
0xShug0 merged commit c7f5743 into 0xShug0:main Oct 8, 2026
6 checks passed
@mirek190

mirek190 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

I know ;)

We should look on more kernels optimizations in the future.

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.

2 participants