Skip to content

Remove CTC CUDA + Move transducer loss in integrations#3028

Merged
Adel-Moumen merged 7 commits intodevelopfrom
remove-ctc-cuda-deprecated
Feb 7, 2026
Merged

Remove CTC CUDA + Move transducer loss in integrations#3028
Adel-Moumen merged 7 commits intodevelopfrom
remove-ctc-cuda-deprecated

Conversation

@Adel-Moumen
Copy link
Copy Markdown
Collaborator

What does this PR do?

This PR aims at:

  1. removing the CTC CUDA beam searcher support within speechbrain as the torchaudio package removed the support of CUDA decoding (+ AFAIK we don't know if any of our users used it);
  2. move the transducer loss numba integration into the integrations folder + add lazzy import etc.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes TorchAudio CUDA CTC decoding support and relocates the Numba CUDA Transducer loss implementation into the speechbrain.integrations area, aligning it with the project’s “extra dependency” integration pattern.

Changes:

  • Removed the TorchAudioCTCPrefixBeamSearcher implementation from the CTC decoder module.
  • Moved/rewired the Numba Transducer loss integration to speechbrain/integrations/numba, including a new integration package __init__.py and documentation.
  • Added a deprecation redirect for the old Transducer loss module path (speechbrain.nnet.loss.transducer_loss) to the new integration location.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
speechbrain/nnet/losses.py Updates the Numba Transducer loss import path and doc reference.
speechbrain/nnet/loss/init.py Updates package docstring now that Transducer loss is no longer in this package.
speechbrain/integrations/numba/transducer_loss.py Adjusts Numba/CUDA import & verbosity handling after moving into integrations.
speechbrain/integrations/numba/init.py Adds integration package that enforces optional dependency presence and lazy exports.
speechbrain/integrations/numba/README.md Adds usage/testing notes for the Numba integration.
speechbrain/decoders/ctc.py Removes the TorchAudio CTC prefix beam searcher wrapper class.
speechbrain/init.py Adds deprecated module redirect for the moved Transducer loss module.
conftest.py Removes the old conditional ignore for the previously-located Transducer loss module.
Comments suppressed due to low confidence (2)

speechbrain/decoders/ctc.py:1906

  • Removing TorchAudioCTCPrefixBeamSearcher breaks in-repo usages: recipes/LibriSpeech/ASR/CTC/train_with_wav2vec.py still documents it as a supported option. Either update that recipe/docs accordingly, or keep a backward-compatible stub/deprecation path so users get a clearer error than an import failure.
                beams = [CTCBeam.from_lm_beam(b) for b in trimmed_beams]

        return beams

speechbrain/integrations/numba/transducer_loss.py:37

  • This statement is unreachable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

speechbrain/integrations/numba/transducer_loss.py:29

  • NUMBA_VERBOSE is hard-coded to 0, but the log message says users can "set NUMBA_VERBOSE to 1". As written, users cannot change this without editing the source, so the message is misleading. Consider reading this from an environment variable (or a module-level config) and documenting the supported values.
    speechbrain/integrations/numba/transducer_loss.py:37
  • This statement is unreachable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@pplantinga pplantinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change! Just one thing to check.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay to call this module "numba"? I had trouble with naming conflicts, e.g. trying to import "numba" inside this folder led to issues where it confused the current module with the external toolkit...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the tests are passing so we can assume it works; I had a look and it seems that we should be safe. Python 3 uses absolute imports by default, so import numba or from numba import cuda inside speechbrain/integrations/numba/transducer_loss.py resolves to the top-level numba package, not to the current speechbrain.integrations.numba package.

Copy link
Copy Markdown
Collaborator

@pplantinga pplantinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Adel-Moumen Adel-Moumen merged commit 1f98c52 into develop Feb 7, 2026
5 checks passed
@Adel-Moumen Adel-Moumen deleted the remove-ctc-cuda-deprecated branch February 7, 2026 21:19
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.

3 participants