Guard nvrx __version__ + degrade async support gracefully for older nvidia-resiliency-ext#5605
Draft
yeyu-nvidia wants to merge 1 commit into
Draft
Guard nvrx __version__ + degrade async support gracefully for older nvidia-resiliency-ext#5605yeyu-nvidia wants to merge 1 commit into
yeyu-nvidia wants to merge 1 commit into
Conversation
…vidia-resiliency-ext has_nvrx_async_support() asserted a minimum nvidia-resiliency-ext version and read nvrx.__version__ unconditionally. Older nvrx builds (e.g. in some NeMo containers) lack __version__, raising AttributeError at import of dist_checkpointing, and the hard assert turns a missing/old nvrx into a crash instead of simply disabling the optional nvrx async-checkpoint path. Use getattr(nvrx, '__version__', '0.0.0') and return False (async unsupported) instead of asserting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Ye Yu <yeyu@nvidia.com>
Contributor
|
This PR has been automatically converted to draft because all PRs must start as drafts. When you are ready for review, click Ready for Review to begin the review process. This will:
See the contribution guide for more details. |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
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
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
has_nvrx_async_support()asserts a minimumnvidia-resiliency-extversion and readsnvrx.__version__unconditionally. Some environments ship an oldernvidia-resiliency-extthat lacks__version__, so importingmegatron.core.dist_checkpointingraisesAttributeError: module 'nvidia_resiliency_ext' has no attribute '__version__', and the hardassertturns a missing/old nvrx into a crash rather than simply disabling the optional nvrx async-checkpoint path.Fix
nvrx_version = str(getattr(nvrx, "__version__", "0.0.0"))instead ofnvrx.__version__.has_nvrx_async_support()returnsFalsewhen the version is below minimum instead of asserting.Backward compatible; behavior is unchanged when a recent nvrx is present.