-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fixes numpy >2.0 compatibility for asr while replicating existing behavior #11446
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: andylamp <[email protected]>
Signed-off-by: andylamp <[email protected]> Signed-off-by: andylamp <[email protected]>
andylamp
force-pushed
the
fix-numpy-compatibility
branch
from
December 2, 2024 01:15
250555c
to
9738306
Compare
Signed-off-by: andylamp <[email protected]>
Signed-off-by: andylamp <[email protected]> Signed-off-by: andylamp <[email protected]>
Signed-off-by: andylamp <[email protected]>
Signed-off-by: andylamp <[email protected]>
…/NeMo into fix-numpy-compatibility
* ci: Allow dry-run of release Signed-off-by: Oliver Koenig <[email protected]> * fix Signed-off-by: Oliver Koenig <[email protected]> * finalize Signed-off-by: Oliver Koenig <[email protected]> --------- Signed-off-by: Oliver Koenig <[email protected]> Signed-off-by: andylamp <[email protected]>
* fix dtype when init HF model from config Signed-off-by: Alexandros Koumparoulis <[email protected]> * Apply isort and black reformatting Signed-off-by: akoumpa <[email protected]> --------- Signed-off-by: Alexandros Koumparoulis <[email protected]> Signed-off-by: akoumpa <[email protected]> Co-authored-by: akoumpa <[email protected]> Signed-off-by: andylamp <[email protected]>
Signed-off-by: Nune <[email protected]> Signed-off-by: andylamp <[email protected]>
…VIDIA#11435) * Remove try / catch block to propagate import errors Signed-off-by: Jan Lasek <[email protected]> * Small rewrite to handle import errors in export/deploy scripts Signed-off-by: Jan Lasek <[email protected]> * Apply isort and black reformatting Signed-off-by: janekl <[email protected]> --------- Signed-off-by: Jan Lasek <[email protected]> Signed-off-by: janekl <[email protected]> Co-authored-by: janekl <[email protected]> Signed-off-by: andylamp <[email protected]>
Signed-off-by: andylamp <[email protected]>
Signed-off-by: andylamp <[email protected]> Signed-off-by: andylamp <[email protected]>
Signed-off-by: andylamp <[email protected]>
Signed-off-by: andylamp <[email protected]>
…/NeMo into fix-numpy-compatibility
beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base. Your code was analyzed with PyLint. The following annotations have been identified:
Thank you for improving NeMo's documentation! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
The PR attempts to restore functionality with recent
numpy
versions;numpy
2.0 removedsctypes
and this is breakingasr
functionality.edit: closed the PR due to commits not being signed-off properly and rebasing caused issues :)
Collection:
asr
Changelog
numpy
from version 2.0 onwards removedsctypes
functionality, which breaksasr
functionality in various places (e.g. transcribe_speech, example notebooks etc)._convert_samples_to_float32
function residing in both feature_loader.py and segment.py.Usage
The usage is that ASR tasks that call
_convert_samples_to_float32
functions now succeed. As noted above, while this has been attempted to be addressed in the PRs mentioned above, I believe that the functionality is not replicated accurately.More concretely, if you check the output of
sctype
for the types ofint
andfloat
in supported versions ofnumpy
you'd get the following:However, if we use the
issubdtype
to perform this the set will be wider, case on point for floating point:And, also for integers the set mostly covers the output of
sctype
for signed ones. However any subclass fromsignedinteger
orunsignedinteger
will return true. A more concrete example would be,Therefore, in this case not only we consider
int{8,16,32,64}
but alsouint{8,16,32,64}
which is not the expected result when queryingsctype['int']
leading to potentially unexpected behavior. Case on point,GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
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
The fix is backwards compatible with all supported
numpy
1.x versions as well. Therefore, it should pose minimal risk wrt to integration.