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

Drop to REPL on SIGINT (control-c) #6447

Closed
talolard opened this issue Mar 9, 2021 · 3 comments
Closed

Drop to REPL on SIGINT (control-c) #6447

talolard opened this issue Mar 9, 2021 · 3 comments
Labels
callback design Includes a design discussion feature Is an improvement or enhancement help wanted Open to be worked on won't fix This will not be worked on

Comments

@talolard
Copy link

talolard commented Mar 9, 2021

🚀 Feature

During a training run, if the user sends SIGINT (e.g. control-c) drop to a shell (ipython would be amazing)

Motivation

Sometimes I want to stop training right now and do something, probably save an explicitly named checkpoint. I know it's not "the right way" to work, but it is what I (and others?) do or want to do in practice.

As an example, I want to stop training now to try something else, but I want a snapshot of my model at its current state, that is named so I can find it later easily.

Additional context

This would be gross to implement. I imagine it would involve python threads, where a thread is listening for sigint and sets a flag. Then somewhere around on_training_batch_end, if the flag is set we drop to a shell (don't know how)

@talolard talolard added feature Is an improvement or enhancement help wanted Open to be worked on labels Mar 9, 2021
@carmocca carmocca added design Includes a design discussion callback labels Mar 10, 2021
@carmocca
Copy link
Contributor

This is a cool idea!

If/when #3632 is resurrected, it could be implemented as a callback that registers itself on the ctrl+c signal. But unfortunately, I don't think this will be ready soon

cc: @awaelchli

@stale
Copy link

stale bot commented Apr 10, 2021

This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team!

@stale stale bot added the won't fix This will not be worked on label Apr 10, 2021
@awaelchli awaelchli removed the won't fix This will not be worked on label Apr 10, 2021
@stale
Copy link

stale bot commented May 10, 2021

This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team!

@stale stale bot added the won't fix This will not be worked on label May 10, 2021
@stale stale bot closed this as completed May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callback design Includes a design discussion feature Is an improvement or enhancement help wanted Open to be worked on won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants