-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Safely import optional python packages #13936
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
Merged
hemildesai
merged 3 commits into
NVIDIA-NeMo:main
from
roclark:roclark/safe-import-nvidia-resiliency
Jul 10, 2025
Merged
Safely import optional python packages #13936
hemildesai
merged 3 commits into
NVIDIA-NeMo:main
from
roclark:roclark/safe-import-nvidia-resiliency
Jul 10, 2025
Conversation
This file contains hidden or 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
dimapihtar
approved these changes
Jun 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
marcromeyn
approved these changes
Jun 24, 2025
|
This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days. |
|
@dimapihtar , @marcromeyn : what is the next step for this PR ? |
|
This would be huge for us as well, +1! |
This was referenced Jul 10, 2025
The nvidia-resiliency-ext package is not compatible with Windows/MacOS currently and cannot be installed directly on those platforms. Given the number of nested imports in the nemo.collections.llm API, it will try and automatically import the resliency package even if not used. Safely importing the package allows all modules to be imported without blocking on the resiliency package for incompatible platforms. This opens up greater support on more platforms. If the nvidia-resiliency-ext package is needed when these lines are called, it will throw an import error only when directly called. Signed-Off-By: Robert Clark <roclark@nvidia.com>
The default modelopt model transforms rely on the modelopt package being installed which is not available on all platforms. This module gets auto-imported when importing the nemo.collections.llm module and will fail on platforms that don't support modelopt, such as Windows and MacOS, even if the package isn't used. Safely importing the package should allow the toolkit to be runnable on both Windows and MacOS in a minimal state, which increases its functionality, especially while paired with NeMo-Run. Signed-Off-By: Robert Clark <roclark@nvidia.com>
Signed-off-by: roclark <roclark@users.noreply.github.com>
c7026b7 to
cee2726
Compare
chtruong814
pushed a commit
that referenced
this pull request
Jul 11, 2025
This reverts commit e04ee42. Signed-off-by: Charlie Truong <chtruong@nvidia.com>
8 tasks
chtruong814
added a commit
that referenced
this pull request
Jul 11, 2025
chtruong814
added a commit
that referenced
this pull request
Jul 11, 2025
8 tasks
chtruong814
added a commit
that referenced
this pull request
Jul 11, 2025
* Revert "Revert "Safely import optional python packages (#13936)" (#14197)" This reverts commit 808845b. Signed-off-by: Charlie Truong <chtruong@nvidia.com> * Fix LocalCheckpointCallback safe import Signed-off-by: Charlie Truong <chtruong@nvidia.com> --------- Signed-off-by: Charlie Truong <chtruong@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Jul 23, 2025
* Safely import nvidia-resiliency-ext package The nvidia-resiliency-ext package is not compatible with Windows/MacOS currently and cannot be installed directly on those platforms. Given the number of nested imports in the nemo.collections.llm API, it will try and automatically import the resliency package even if not used. Safely importing the package allows all modules to be imported without blocking on the resiliency package for incompatible platforms. This opens up greater support on more platforms. If the nvidia-resiliency-ext package is needed when these lines are called, it will throw an import error only when directly called. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Safely import modelopt algorithms The default modelopt model transforms rely on the modelopt package being installed which is not available on all platforms. This module gets auto-imported when importing the nemo.collections.llm module and will fail on platforms that don't support modelopt, such as Windows and MacOS, even if the package isn't used. Safely importing the package should allow the toolkit to be runnable on both Windows and MacOS in a minimal state, which increases its functionality, especially while paired with NeMo-Run. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Apply isort and black reformatting Signed-off-by: roclark <roclark@users.noreply.github.com> --------- Signed-off-by: Robert Clark <roclark@nvidia.com> Signed-off-by: roclark <roclark@users.noreply.github.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Jul 23, 2025
…VIDIA-NeMo#14197) This reverts commit e04ee42. Signed-off-by: Charlie Truong <chtruong@nvidia.com> Co-authored-by: Robert Clark <roclark@users.noreply.github.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Jul 23, 2025
…DIA-NeMo#14198) * Revert "Revert "Safely import optional python packages (NVIDIA-NeMo#13936)" (NVIDIA-NeMo#14197)" This reverts commit 808845b. Signed-off-by: Charlie Truong <chtruong@nvidia.com> * Fix LocalCheckpointCallback safe import Signed-off-by: Charlie Truong <chtruong@nvidia.com> --------- Signed-off-by: Charlie Truong <chtruong@nvidia.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
monica-sekoyan
pushed a commit
that referenced
this pull request
Aug 4, 2025
* Safely import nvidia-resiliency-ext package The nvidia-resiliency-ext package is not compatible with Windows/MacOS currently and cannot be installed directly on those platforms. Given the number of nested imports in the nemo.collections.llm API, it will try and automatically import the resliency package even if not used. Safely importing the package allows all modules to be imported without blocking on the resiliency package for incompatible platforms. This opens up greater support on more platforms. If the nvidia-resiliency-ext package is needed when these lines are called, it will throw an import error only when directly called. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Safely import modelopt algorithms The default modelopt model transforms rely on the modelopt package being installed which is not available on all platforms. This module gets auto-imported when importing the nemo.collections.llm module and will fail on platforms that don't support modelopt, such as Windows and MacOS, even if the package isn't used. Safely importing the package should allow the toolkit to be runnable on both Windows and MacOS in a minimal state, which increases its functionality, especially while paired with NeMo-Run. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Apply isort and black reformatting Signed-off-by: roclark <roclark@users.noreply.github.com> --------- Signed-off-by: Robert Clark <roclark@nvidia.com> Signed-off-by: roclark <roclark@users.noreply.github.com>
monica-sekoyan
pushed a commit
that referenced
this pull request
Aug 4, 2025
monica-sekoyan
pushed a commit
that referenced
this pull request
Aug 4, 2025
* Revert "Revert "Safely import optional python packages (#13936)" (#14197)" This reverts commit 808845b. Signed-off-by: Charlie Truong <chtruong@nvidia.com> * Fix LocalCheckpointCallback safe import Signed-off-by: Charlie Truong <chtruong@nvidia.com> --------- Signed-off-by: Charlie Truong <chtruong@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Aug 5, 2025
* Safely import nvidia-resiliency-ext package The nvidia-resiliency-ext package is not compatible with Windows/MacOS currently and cannot be installed directly on those platforms. Given the number of nested imports in the nemo.collections.llm API, it will try and automatically import the resliency package even if not used. Safely importing the package allows all modules to be imported without blocking on the resiliency package for incompatible platforms. This opens up greater support on more platforms. If the nvidia-resiliency-ext package is needed when these lines are called, it will throw an import error only when directly called. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Safely import modelopt algorithms The default modelopt model transforms rely on the modelopt package being installed which is not available on all platforms. This module gets auto-imported when importing the nemo.collections.llm module and will fail on platforms that don't support modelopt, such as Windows and MacOS, even if the package isn't used. Safely importing the package should allow the toolkit to be runnable on both Windows and MacOS in a minimal state, which increases its functionality, especially while paired with NeMo-Run. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Apply isort and black reformatting Signed-off-by: roclark <roclark@users.noreply.github.com> --------- Signed-off-by: Robert Clark <roclark@nvidia.com> Signed-off-by: roclark <roclark@users.noreply.github.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Aug 5, 2025
…VIDIA-NeMo#14197) This reverts commit e04ee42. Signed-off-by: Charlie Truong <chtruong@nvidia.com> Co-authored-by: Robert Clark <roclark@users.noreply.github.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Aug 5, 2025
…DIA-NeMo#14198) * Revert "Revert "Safely import optional python packages (NVIDIA-NeMo#13936)" (NVIDIA-NeMo#14197)" This reverts commit 808845b. Signed-off-by: Charlie Truong <chtruong@nvidia.com> * Fix LocalCheckpointCallback safe import Signed-off-by: Charlie Truong <chtruong@nvidia.com> --------- Signed-off-by: Charlie Truong <chtruong@nvidia.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Aug 5, 2025
* Safely import nvidia-resiliency-ext package The nvidia-resiliency-ext package is not compatible with Windows/MacOS currently and cannot be installed directly on those platforms. Given the number of nested imports in the nemo.collections.llm API, it will try and automatically import the resliency package even if not used. Safely importing the package allows all modules to be imported without blocking on the resiliency package for incompatible platforms. This opens up greater support on more platforms. If the nvidia-resiliency-ext package is needed when these lines are called, it will throw an import error only when directly called. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Safely import modelopt algorithms The default modelopt model transforms rely on the modelopt package being installed which is not available on all platforms. This module gets auto-imported when importing the nemo.collections.llm module and will fail on platforms that don't support modelopt, such as Windows and MacOS, even if the package isn't used. Safely importing the package should allow the toolkit to be runnable on both Windows and MacOS in a minimal state, which increases its functionality, especially while paired with NeMo-Run. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Apply isort and black reformatting Signed-off-by: roclark <roclark@users.noreply.github.com> --------- Signed-off-by: Robert Clark <roclark@nvidia.com> Signed-off-by: roclark <roclark@users.noreply.github.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Aug 5, 2025
…VIDIA-NeMo#14197) This reverts commit e04ee42. Signed-off-by: Charlie Truong <chtruong@nvidia.com> Co-authored-by: Robert Clark <roclark@users.noreply.github.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
AmirHussein96
pushed a commit
to AmirHussein96/NeMo
that referenced
this pull request
Aug 5, 2025
…DIA-NeMo#14198) * Revert "Revert "Safely import optional python packages (NVIDIA-NeMo#13936)" (NVIDIA-NeMo#14197)" This reverts commit 808845b. Signed-off-by: Charlie Truong <chtruong@nvidia.com> * Fix LocalCheckpointCallback safe import Signed-off-by: Charlie Truong <chtruong@nvidia.com> --------- Signed-off-by: Charlie Truong <chtruong@nvidia.com> Signed-off-by: Amir Hussein <amhussein@nvidia.com>
nasretdinovr
pushed a commit
to nasretdinovr/NeMo
that referenced
this pull request
Aug 8, 2025
* Safely import nvidia-resiliency-ext package The nvidia-resiliency-ext package is not compatible with Windows/MacOS currently and cannot be installed directly on those platforms. Given the number of nested imports in the nemo.collections.llm API, it will try and automatically import the resliency package even if not used. Safely importing the package allows all modules to be imported without blocking on the resiliency package for incompatible platforms. This opens up greater support on more platforms. If the nvidia-resiliency-ext package is needed when these lines are called, it will throw an import error only when directly called. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Safely import modelopt algorithms The default modelopt model transforms rely on the modelopt package being installed which is not available on all platforms. This module gets auto-imported when importing the nemo.collections.llm module and will fail on platforms that don't support modelopt, such as Windows and MacOS, even if the package isn't used. Safely importing the package should allow the toolkit to be runnable on both Windows and MacOS in a minimal state, which increases its functionality, especially while paired with NeMo-Run. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Apply isort and black reformatting Signed-off-by: roclark <roclark@users.noreply.github.com> --------- Signed-off-by: Robert Clark <roclark@nvidia.com> Signed-off-by: roclark <roclark@users.noreply.github.com>
nasretdinovr
pushed a commit
to nasretdinovr/NeMo
that referenced
this pull request
Aug 8, 2025
…VIDIA-NeMo#14197) This reverts commit e04ee42. Signed-off-by: Charlie Truong <chtruong@nvidia.com> Co-authored-by: Robert Clark <roclark@users.noreply.github.com>
nasretdinovr
pushed a commit
to nasretdinovr/NeMo
that referenced
this pull request
Aug 8, 2025
…DIA-NeMo#14198) * Revert "Revert "Safely import optional python packages (NVIDIA-NeMo#13936)" (NVIDIA-NeMo#14197)" This reverts commit 808845b. Signed-off-by: Charlie Truong <chtruong@nvidia.com> * Fix LocalCheckpointCallback safe import Signed-off-by: Charlie Truong <chtruong@nvidia.com> --------- Signed-off-by: Charlie Truong <chtruong@nvidia.com>
guyueh1
pushed a commit
to guyueh1/NeMo
that referenced
this pull request
Aug 25, 2025
* Safely import nvidia-resiliency-ext package The nvidia-resiliency-ext package is not compatible with Windows/MacOS currently and cannot be installed directly on those platforms. Given the number of nested imports in the nemo.collections.llm API, it will try and automatically import the resliency package even if not used. Safely importing the package allows all modules to be imported without blocking on the resiliency package for incompatible platforms. This opens up greater support on more platforms. If the nvidia-resiliency-ext package is needed when these lines are called, it will throw an import error only when directly called. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Safely import modelopt algorithms The default modelopt model transforms rely on the modelopt package being installed which is not available on all platforms. This module gets auto-imported when importing the nemo.collections.llm module and will fail on platforms that don't support modelopt, such as Windows and MacOS, even if the package isn't used. Safely importing the package should allow the toolkit to be runnable on both Windows and MacOS in a minimal state, which increases its functionality, especially while paired with NeMo-Run. Signed-Off-By: Robert Clark <roclark@nvidia.com> * Apply isort and black reformatting Signed-off-by: roclark <roclark@users.noreply.github.com> --------- Signed-off-by: Robert Clark <roclark@nvidia.com> Signed-off-by: roclark <roclark@users.noreply.github.com> Signed-off-by: Guyue Huang <guyueh@nvidia.com>
guyueh1
pushed a commit
to guyueh1/NeMo
that referenced
this pull request
Aug 25, 2025
…VIDIA-NeMo#14197) This reverts commit e04ee42. Signed-off-by: Charlie Truong <chtruong@nvidia.com> Co-authored-by: Robert Clark <roclark@users.noreply.github.com> Signed-off-by: Guyue Huang <guyueh@nvidia.com>
guyueh1
pushed a commit
to guyueh1/NeMo
that referenced
this pull request
Aug 25, 2025
…DIA-NeMo#14198) * Revert "Revert "Safely import optional python packages (NVIDIA-NeMo#13936)" (NVIDIA-NeMo#14197)" This reverts commit 808845b. Signed-off-by: Charlie Truong <chtruong@nvidia.com> * Fix LocalCheckpointCallback safe import Signed-off-by: Charlie Truong <chtruong@nvidia.com> --------- Signed-off-by: Charlie Truong <chtruong@nvidia.com> Signed-off-by: Guyue Huang <guyueh@nvidia.com>
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 ?
This update safely imports optional Python packages which are incompatible with Windows and MacOS. This allows nemo_toolkit to be installable and usable on Windows and MacOS, especially in conjunction with NeMo-Run.
Before your PR is "Ready for review"
Pre checks:
PR Type: