Remove CTC CUDA + Move transducer loss in integrations#3028
Remove CTC CUDA + Move transducer loss in integrations#3028Adel-Moumen merged 7 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
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
TorchAudioCTCPrefixBeamSearcherimplementation from the CTC decoder module. - Moved/rewired the Numba Transducer loss integration to
speechbrain/integrations/numba, including a new integration package__init__.pyand 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
TorchAudioCTCPrefixBeamSearcherbreaks in-repo usages:recipes/LibriSpeech/ASR/CTC/train_with_wav2vec.pystill 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.
There was a problem hiding this comment.
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_VERBOSEis hard-coded to0, 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.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
pplantinga
left a comment
There was a problem hiding this comment.
Good change! Just one thing to check.
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
What does this PR do?
This PR aims at:
torchaudiopackage removed the support of CUDA decoding (+ AFAIK we don't know if any of our users used it);integrationsfolder + add lazzy import etc.