Skip to content
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

Turn off hpc checkpoint saving in SLURM environment if trainer.fit(..., ckpt_path="last") #19782

Open
rustamzh opened this issue Apr 16, 2024 · 4 comments
Labels
feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers

Comments

@rustamzh
Copy link

rustamzh commented Apr 16, 2024

Description & Motivation

Hi all,
trainer.fit(ckpt_path="last") works perfectly now (in SLURM environment with autorequeue=True), especially if you set up end-of-epoch checkpoint callback. However, the trainer still saves middle-of-the-epoch checkpoints that remain unused because of trainer.fit(ckpt_path="last"). It would be great to not save hpc_ckpt if trainer.fit(ckpt_path="last").

This feature will close #13773

Pitch

No response

Alternatives

No response

Additional context

No response

cc @Borda

@rustamzh rustamzh added feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers labels Apr 16, 2024
@murnanedaniel
Copy link

@rustamzh This is a very good idea, and should be implemented.
However, I want to understand exactly your setup, as I'm trying to implement this myself. You specify a ModelCheckpoint with dirpath equal to some artifact_directory, I assume? And then you also set the Trainer's default_root_dir to that same artifact_directory?

My issue here is that if I am training two models, using the same artifact_directory, won't the auto-resume get them mixed up when it uses ckpt_path="last"?

@rustamzh
Copy link
Author

Hi. My dirpath is empty in the ModelCheckpoint callback, this way checkpoints are created in their own version-X (where X is SLURM jobID) subfolder and do not mix, since the autorequeued job retains its jobID.

@murnanedaniel
Copy link

Hi. My dirpath is empty in the ModelCheckpoint callback, this way checkpoints are created in their own version-X (where X is SLURM jobID) subfolder and do not mix, since the autorequeued job retains its jobID.

This makes a lot of sense, although I'm missing the way that your default root dir is configured. Would it be possible to share the code snippet that is most relevant to this configuration? It would be much appreciated!

@rustamzh
Copy link
Author

default root dir is just non empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants