Skip to content

Flag to disable moving files to run_<idx> directories on resume#15592

Open
pzelasko wants to merge 1 commit intomainfrom
feat/expmgr-rundir-flag
Open

Flag to disable moving files to run_<idx> directories on resume#15592
pzelasko wants to merge 1 commit intomainfrom
feat/expmgr-rundir-flag

Conversation

@pzelasko
Copy link
Copy Markdown
Collaborator

@pzelasko pzelasko commented Apr 8, 2026

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 ?

Flag to disable moving files to run_<idx> directories on resume.
Set to True by default for backward compatibility.

Collection: all

Changelog

  • Flag to disable moving files to run_<idx> directories on resume.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

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

  • Related to # (issue)

Signed-off-by: Piotr Żelasko <pzelasko@nvidia.com>
# Move old log files into run_0/, run_1/, etc. subdirectories on resume.
# Disable on shared filesystems (e.g. Lustre) where moving files while other ranks
# are starting up can cause FileNotFoundError in Lightning's checkpoint scanner.
move_files_to_run_dirs: Optional[bool] = True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn;t this be handled while exiting the previous run safely?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's not. the "move to run_X/" logic is triggered on start of new job. It has a race condition - every rank creates nemo_rankX_blabla.txt log file -> some ranks are faster, some are slower -> some rank is first listing the files, and then calling os.stat on them -> between the two calls, rank0 moved the file to run_X -> os.stat fails with FileNotFoundError

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's default to False, we can rethink logging at a later date.

@nithinraok
Copy link
Copy Markdown
Member

/claude review

Copy link
Copy Markdown
Member

@nithinraok nithinraok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@claude
Copy link
Copy Markdown

claude bot commented Apr 9, 2026

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants