2

I can't figure out how to specify preemptible GPU Deep Learning VM on GCP

This what I used:

export IMAGE_FAMILY="tf-latest-gpu"
export ZONE="europe-west4-a "
export INSTANCE_NAME="deeplearning"

gcloud compute instances create $INSTANCE_NAME \
  --zone=$ZONE \
  --image-family=$IMAGE_FAMILY \
  --image-project=deeplearning-platform-release \
  --maintenance-policy=TERMINATE \
  --accelerator='type=nvidia-tesla-v100,count=2' \
  --metadata='install-nvidia-driver=True'

Thank you!

Maxim
  • 4,075
  • 1
  • 14
  • 23
Re Dream
  • 91
  • 3
  • 8

1 Answers1

2

You can create a preemptible Compute Engine instance with GPU by adding the --preemptible gcloud command option. As per your example, that would be:

export IMAGE_FAMILY="tf-latest-gpu"
export ZONE="europe-west4-a "
export INSTANCE_NAME="deeplearning"

gcloud compute instances create $INSTANCE_NAME \
  --zone=$ZONE \
  --image-family=$IMAGE_FAMILY \
  --image-project=deeplearning-platform-release \
  --maintenance-policy=TERMINATE \
  --accelerator type=nvidia-tesla-v100,count=2 \
  --metadata='install-nvidia-driver=True'
  --preemptible

See documentation here and here for more details on available options.

LundinCast
  • 9,412
  • 4
  • 36
  • 48
  • I've updated my answer based on the command you provided. Let me know if that's what you're looking for. – LundinCast Oct 18 '18 at 22:06
  • 1
    Would you care to share your experience with the durability of GCP preemptible instances? How often did they get "emptied out"? Is it safe to run training that takes more than 24 hours? – Hank Chan Dec 18 '19 at 12:22
  • 1
    The preemption rate can vary greatly depending on Google's needs but one thing to note is that Compute Engine always terminates preemptible instances after they run for 24h. – LundinCast Dec 18 '19 at 14:00
  • 1
    You may want to have a look here for further details: https://cloud.google.com/compute/docs/instances/preemptible – LundinCast Dec 18 '19 at 14:01