fix: remove unexpected side effect in get_srun_flags#408
Merged
hemildesai merged 1 commit intoNVIDIA-NeMo:mainfrom Jan 12, 2026
Merged
fix: remove unexpected side effect in get_srun_flags#408hemildesai merged 1 commit intoNVIDIA-NeMo:mainfrom
hemildesai merged 1 commit intoNVIDIA-NeMo:mainfrom
Conversation
Currently, if `nemo_run_dir` is falsy, this function will append mounts to the object mounts list, resulting in unexpected extension of the list with every call. This function is called by materialize, which it turns out is even called by the `__repr__` and as such one would expect it not to have any side effects. Signed-off-by: Jakub Bliźniuk <opliko@opliko.dev>
Contributor
|
Hi @oplik0 thanks a lot for the contribution. Yeah makes sense to have the PR directly for this fix, will merge once CI passes |
hemildesai
approved these changes
Jan 12, 2026
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.
Currently, if
nemo_run_diris falsy, this function will append mounts to theself.executor.container_mountslist, resulting in unexpected extension of the list with every call.This function is called by materialize, which it turns out is even called by the
__repr__ofSlurmRayRequestand as such one would expect it not to have any side effects (especially since the name of the offending function suggests its a getter).Found while debugging an issue that turned out to not be caused by NeMo Run, but finding increasing number of duplicate mounts as my debugger helpfully displayed the repr of the class when I was looking at it.
Considering how simple the fix is (and that I already tested it locally when trying to debug the issue) I decided not to create an issue before this PR, hopefully that's acceptable here.