-
Notifications
You must be signed in to change notification settings - Fork 14
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
Babysit command doesn't recover preemptied tpu #3
Comments
There was a change in policy some time ago: if you leave your TPU idle for four hours or so, they'll delete it. Unfortunately, I wrote tpunicorn before that change, so it wasn't designed to handle deletions. The library assumes that you can always "figure out how to recreate the specified TPU." But clearly, if you delete a TPU and run There's a way to solve this, I think. At the top of the babysit function, tpunicorn/tpunicorn/program.py Lines 399 to 410 in 58e51c8
after tpu = tpunicorn.get_tpu(tpu=tpu, zone=zone, project=project)
create = tpunicorn.create_tpu_command(tpu, zone=zone, project=project)
Then, inside the try:
...
except ValueError as e:
if 'No TPUs matched' in str(e):
if 0 != do_step("The TPU was deleted by someone. Recreating...", create):
click.echo("TPU failed to create (is the region out of capacity?)", err=True)
else:
... ( I think that would do the trick. Putting it all together, it might look like: def babysit(ctx, tpu, zone, project, dry_run, interval, command):
"""Checks TPU every INTERVAL seconds. Recreates the TPU if (and only if) the tpu has preempted."""
ctx.forward(recreate, yes=True, preempted=True)
tpu = tpunicorn.get_tpu(tpu=tpu, zone=zone, project=project)
create = tpunicorn.create_tpu_command(tpu, zone=zone, project=project)
while True:
time.sleep(interval)
try:
ctx.forward(recreate, yes=True, preempted=True)
except ValueError as e:
if 'No TPUs matched' in str(e):
if 0 != do_step("The TPU was deleted by someone. Recreating...", create):
click.echo("TPU failed to create (is the region out of capacity?)", err=True)
except:
import traceback
traceback.print_exc() Would you be interested in making these changes and testing it out? If not, no worries. |
I created tpu named 'incremental-scale-width-1-0' and ran 'pu babysit incremental-scale-width-1-0'.
At first, everything seemed okay but some hours passed after without feeding tpu anything,
babysit command stopped displaying status view and threw
Maybe is there any policy change in TPU preemtation? As I remember, even after TPU is preemptied, we could track the preemptied tpu's name but now it seems impossible and I think this is causing the problem.
The text was updated successfully, but these errors were encountered: