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

[FR] Add a way to programmatically end the current session #2568

Closed
NightMachinery opened this issue Jan 21, 2022 · 10 comments
Closed

[FR] Add a way to programmatically end the current session #2568

NightMachinery opened this issue Jan 21, 2022 · 10 comments

Comments

@NightMachinery
Copy link

Is your feature request related to a problem? Please describe.
Having an API to end the current session can save resources. There is interest in doing this as well; I found 3 Stackoveflow questions about doing exactly this, one of which had a bounty set on it.

Describe the solution you'd like

from google.colab import terminate_session
terminate_session()

Describe alternatives you've considered
We can just let it run, until the AI overlords stop the sessions, wasting resources.

@qkum
Copy link

qkum commented Jan 22, 2022

Basic 101 feature.

I assumed it existed and I had just not found it yet.

I had too high expectations I see.

Just like I assumed paying customers could use their services without getting treated like a GPU abuser. Nope.

@cperry-goog
Copy link

This is a good feature. I thought we already had it somewhere, but since I can't find it, leaving this open.

@lucids-git-goods
Copy link

please. the current assumption that users are just going to stare at the colab screens until training is complete is unrealistic and would just be unhealthy.

@KaranKhoslaDianthus
Copy link

Hi, I'm just checking if there has been any progress on this requested feature

@BrockFletcher
Copy link

Any solutions? I've seen to run
!kill $(ps aux | awk '{print $2}')
or
!kill -9 -1
but these seem inelegant?

@happycube
Copy link

happycube commented Jun 8, 2022

The !kill commands don't seem to work, at least with pro+ backgrounding. When I run it in an active notebook, it immedately starts a new session.

I also set up a time-delayed !kill -9 -1 and when I reconnected a few minutes later it listed the session as "unknown notebook" and I had to terminate it manually.

@carriemorrison
Copy link

Following...would really like to be able to stop notebook after execution. rather than being punished for it lol

@LordLean
Copy link

Just a friendly comment to help push this request up - it would be great if I could programmatically terminate a long session that's running whilst I nap!

@LuciferSam86
Copy link

Yeah, it would be nice, especially now we're switching to the compute credits.

@peap
Copy link

peap commented Sep 8, 2022

Thanks for your patience here, everyone. Starting next week you'll be able to programmatically end sessions from code cells like so:

from google.colab import runtime
runtime.unassign()

The new unassign() function marks the currently connected runtime for deletion and disconnects any notebook sessions. I expect it to be available for any runtimes started next Monday morning (Sep 12, PDT) or later.

@peap peap closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests