TvE
TvE

Reputation: 1116

How can I disconnect the google colab runtime from within a cell?

I often start a training run before going to bed and I'd like to release the runtime from within the last cell of my notebook. How can I do this?

My motivation is simply to save the extra 90 minutes of usage before the idle timeout kills the runtime anyway, so I accumulate fewer GPU hours and stay at a higher priority... (Maybe that's a pointless goal...)

Upvotes: 13

Views: 12571

Answers (2)

user1953366
user1953366

Reputation: 1611

kill won't delete the runtime. And you'll still be charged for it. To disconnect and delete use:

from google.colab import runtime
runtime.unassign()

Source (and also checked): https://www.reddit.com/r/GoogleColab/comments/xtj2be/dear_googlecolab_boss_i_want/

Upvotes: 28

Nathan Wailes
Nathan Wailes

Reputation: 12222

To post the answer mentioned in the comments above (taken from here):

Run !kill -9 -1 from within a cell.

Upvotes: 1

Related Questions