Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer. #9347

Merged
merged 4 commits into from
May 30, 2024

Conversation

galv
Copy link
Collaborator

@galv galv commented May 30, 2024

What does this PR do ?

decoder_lengths is allowed to be on CPU even when decoder_output is on GPU. This matches the behavior of GreedyCTCInfer. Even though that behavior is unintentional, there is code depending on that behavior, including our jupyter notebooks.

Testing

I tested in the following way. I ran:

pytest -k test_batched_decoding_ tests/collections/asr/decoding/test_ctc_decoding.py
CUDA_VISIBLE_DEVICES="" pytest -k test_batched_decoding_ tests/collections/asr/decoding/test_ctc_decoding.py

CUDA_VISIBLE_DEVICES="" ensures that the test runs when on CPU-only machines, as well as on machines with GPU. My previous PR related to this failed to test on GPU, which caused the crash we see today when we run with lengths on CPU but logprobs on GPU.

I also manually ran examples/notebooks/asr/ASR_with_Subword_Tokenization.ipynb and examples/notebooks/asr/ASR_with_NeMo.ipynb manually. These run to completion. I had to comment out the part that install NeMo from pypi, which would overwrite my local installation.

Collection: ASR

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to NVBug 4647443 and 4647231

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>
@github-actions github-actions bot added the ASR label May 30, 2024
titu1994
titu1994 previously approved these changes May 30, 2024
Copy link
Collaborator

@titu1994 titu1994 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and the updates tests !

titu1994 and others added 2 commits May 30, 2024 00:23
Copy link
Collaborator

@nithinraok nithinraok left a comment

Choose a reason for hiding this comment

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

Thanks

@nithinraok
Copy link
Collaborator

nithinraok commented May 30, 2024

Fix not going to r2.0.0rc0?

@titu1994 titu1994 merged commit aed9d07 into NVIDIA:main May 30, 2024
128 of 129 checks passed
titu1994 pushed a commit that referenced this pull request May 30, 2024
* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: titu1994 <titu1994@users.noreply.github.com>

---------

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>
Signed-off-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Nithin Rao <nithinrao.koluguri@gmail.com>
(cherry picked from commit aed9d07)
titu1994 added a commit that referenced this pull request May 30, 2024
titu1994 added a commit that referenced this pull request May 30, 2024
ericharper pushed a commit that referenced this pull request Jun 4, 2024
)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer. (#9347)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: titu1994 <titu1994@users.noreply.github.com>

---------

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>
Signed-off-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Nithin Rao <nithinrao.koluguri@gmail.com>
(cherry picked from commit aed9d07)

* Add Packaging to install documentation

Signed-off-by: smajumdar <titu1994@gmail.com>

* Mark confidence tests as please fix me

Signed-off-by: smajumdar <titu1994@gmail.com>

---------

Signed-off-by: smajumdar <titu1994@gmail.com>
Co-authored-by: Daniel Galvez <galv@users.noreply.github.com>
Co-authored-by: Pablo Garay <palenq@gmail.com>
github-actions bot pushed a commit that referenced this pull request Jun 4, 2024
)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer. (#9347)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: titu1994 <titu1994@users.noreply.github.com>

---------

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>
Signed-off-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Nithin Rao <nithinrao.koluguri@gmail.com>
(cherry picked from commit aed9d07)

* Add Packaging to install documentation

Signed-off-by: smajumdar <titu1994@gmail.com>

* Mark confidence tests as please fix me

Signed-off-by: smajumdar <titu1994@gmail.com>

---------

Signed-off-by: smajumdar <titu1994@gmail.com>
Co-authored-by: Daniel Galvez <galv@users.noreply.github.com>
Co-authored-by: Pablo Garay <palenq@gmail.com>
titu1994 added a commit that referenced this pull request Jun 4, 2024
) (#9371)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer. (#9347)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.



* Apply isort and black reformatting



---------






(cherry picked from commit aed9d07)

* Add Packaging to install documentation



* Mark confidence tests as please fix me



---------

Signed-off-by: smajumdar <titu1994@gmail.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: Daniel Galvez <galv@users.noreply.github.com>
Co-authored-by: Pablo Garay <palenq@gmail.com>
BoxiangW pushed a commit to BoxiangW/NeMo that referenced this pull request Jun 5, 2024
* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: titu1994 <titu1994@users.noreply.github.com>

---------

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>
Signed-off-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Nithin Rao <nithinrao.koluguri@gmail.com>
Signed-off-by: Boxiang Wang <boxiangw@nvidia.com>
BoxiangW pushed a commit to BoxiangW/NeMo that referenced this pull request Jun 5, 2024
…IDIA#9347)" (NVIDIA#9351)

This reverts commit aed9d07.

Signed-off-by: Boxiang Wang <boxiangw@nvidia.com>
BoxiangW pushed a commit to BoxiangW/NeMo that referenced this pull request Jun 5, 2024
… (NVIDIA#9350) (NVIDIA#9371)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer. (NVIDIA#9347)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.

* Apply isort and black reformatting

---------

(cherry picked from commit aed9d07)

* Add Packaging to install documentation

* Mark confidence tests as please fix me

---------

Signed-off-by: smajumdar <titu1994@gmail.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: Daniel Galvez <galv@users.noreply.github.com>
Co-authored-by: Pablo Garay <palenq@gmail.com>
Signed-off-by: Boxiang Wang <boxiangw@nvidia.com>
janekl pushed a commit that referenced this pull request Jun 12, 2024
* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: titu1994 <titu1994@users.noreply.github.com>

---------

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>
Signed-off-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Nithin Rao <nithinrao.koluguri@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
janekl pushed a commit that referenced this pull request Jun 12, 2024
)" (#9351)

This reverts commit aed9d07.

Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
janekl pushed a commit that referenced this pull request Jun 12, 2024
) (#9371)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer. (#9347)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.



* Apply isort and black reformatting



---------






(cherry picked from commit aed9d07)

* Add Packaging to install documentation



* Mark confidence tests as please fix me



---------

Signed-off-by: smajumdar <titu1994@gmail.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: Daniel Galvez <galv@users.noreply.github.com>
Co-authored-by: Pablo Garay <palenq@gmail.com>
Signed-off-by: Jan Lasek <janek.lasek@gmail.com>
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>

* Apply isort and black reformatting

Signed-off-by: titu1994 <titu1994@users.noreply.github.com>

---------

Signed-off-by: Daniel Galvez <dgalvez@nvidia.com>
Signed-off-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: titu1994 <titu1994@users.noreply.github.com>
Co-authored-by: Nithin Rao <nithinrao.koluguri@gmail.com>
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
… (NVIDIA#9350) (NVIDIA#9371)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer. (NVIDIA#9347)

* Fix GreedyBatchedCTCInfer regression from GreedyCTCInfer.

decoder_lengths is allowed to be on CPU even when decoder_output is on
GPU. This matches the behavior of GreedyCTCInfer. Even though that
behavior is unintentional, there is code depending on that behavior,
including our jupyter notebooks.



* Apply isort and black reformatting



---------






(cherry picked from commit db26475)

* Add Packaging to install documentation



* Mark confidence tests as please fix me



---------

Signed-off-by: smajumdar <titu1994@gmail.com>
Co-authored-by: Somshubra Majumdar <titu1994@gmail.com>
Co-authored-by: Daniel Galvez <galv@users.noreply.github.com>
Co-authored-by: Pablo Garay <palenq@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants