Skip to content

Conversation

Abenez3r
Copy link

@Abenez3r Abenez3r commented Sep 19, 2025

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Fixes NumPy 2.0 compatibility issue in ASR preprocessing by replacing deprecated np.sctypes usage with np.issubdtype.

Collection: ASR

Changelog

  • Replace np.sctypes['int'] with np.issubdtype(dtype, np.integer) in _convert_samples_to_float32()
  • Replace np.sctypes['float'] with np.issubdtype(dtype, np.floating) in _convert_samples_to_float32()
  • Maintains backward compatibility with NumPy 1.x versions

Testing

  • Tested with NumPy 2.3.3
  • AudioSegment creation works with all data types (int16, int32, float32, float64)
  • No np.sctypes AttributeError occurs

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:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

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

@github-actions github-actions bot added the ASR label Sep 19, 2025
- Replace deprecated np.sctypes['int'] with np.issubdtype(dtype, np.integer)
- Replace deprecated np.sctypes['float'] with np.issubdtype(dtype, np.floating)
- Maintains backward compatibility with NumPy 1.x
- Fixes AttributeError in ASR transcription with NumPy 2.0

Resolves NVIDIA-NeMo#14745

Signed-off-by: Abenezer <[email protected]>
@Abenez3r Abenez3r force-pushed the fix-numpy-2-compatibility branch from 1e884f8 to 75bcd10 Compare September 19, 2025 20:04
@Abenez3r
Copy link
Author

@titu1994 @redoctopus Could you review this NumPy 2.0 compatibility fix for ASR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nemo ASR: AttributeError: np.sctypes was removed in the NumPy 2.0 release. Access dtypes explicitly instead.
1 participant