Skip to content

audio: remove conv1d and depthwise_conv1d; callers use Graph::conv1d - #122

Merged
ling0322 merged 1 commit into
mainfrom
audio-remove-conv1d-compositions
Oct 14, 2026
Merged

ling0322 merged 1 commit into
mainfrom
audio-remove-conv1d-compositions

Conversation

@ling0322

Copy link
Copy Markdown
Owner

Removes audio::conv1d and audio::depthwise_conv1d. All 27 call sites (s2mel, campplus, emotion, w2v_bert, semantic_codec, features, layers::Conv1d, and stft/resample/downsample1d in audio.rs) now call Graph::conv1d directly, and the three depthwise ones pass groups = channels.

Why

Both were compositions that worked around CUDA's conv2d, which rejects any group count above one. The native conv1d operator now takes groups on CPU, CUDA, Metal and Vulkan, and CUTLASS has its own kernel for the depthwise case. cosyvoice3's FSMN already used it.

API changes

The composition needed dtype/device to build its padding, and without it these functions never fail. So they drop both parameters and return Value instead of Result<Value>:
layers::Conv1d::graph, emotion::encoder (and its private conv_module and encoder_layer), semantic_codec::decode (and its private vocos_backbone and convnext_block), and s2mel::wavenet. w2v_bert's conv_module keeps them because its causal pad1d still needs them.

Tests

  • ./build/unittest and cargo test pass.
  • tests/audio.rs: removed the test of the composition against the naive loop. The test of Graph::conv1d against the same loop stays. Also removed the depthwise-vs-grouped test.
  • tests/audio_cuda.rs: moved the grouped and depthwise cases (including 31 taps) into conv1d_on_the_card_is_conv1d_on_the_host and dropped the separate depthwise test.
  • Not run: the GPU tests (audio_cuda, indextts, indextts_gpt, cosyvoice3). NVML on the dev machine reported a driver/library mismatch.

🤖 Generated with Claude Code

Every backend's conv1d operator takes a group count now (CUTLASS runs the
depthwise case as its own kernel), so the two compositions that stood in for
it are gone. Their 27 call sites call g.conv1d directly. Functions that only
took dtype and device to pass to them drop both and return Value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ling0322
ling0322 merged commit 85da6f8 into main Oct 14, 2026
3 checks passed
@ling0322
ling0322 deleted the audio-remove-conv1d-compositions branch October 24, 2026 06:26
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