3

Is there a way to use a TPU v3 instead of a TPU v2 in Google Colab Pro?

Unfortunately I get an error message Compilation failure: Ran out of memory in memory space hbm. Used 8.29G of 7.48G hbm. Exceeded hbm capacity by 825.60M. with the TPU v2, which I no longer receive with a TPU v3. Because a TPU v3 has more memory.

Does anyone know a possibility / option?

With this I start the TPU

try:
  tpu = tf.distribute.cluster_resolver.TPUClusterResolver()  # TPU detection
  print('Running on TPU ', tpu.cluster_spec().as_dict()['worker'])
except ValueError:
  raise BaseException('ERROR: Not connected to a TPU runtime; please see the previous cell in this notebook for instructions!')


tf.config.experimental_connect_to_cluster(tpu)
tf.tpu.experimental.initialize_tpu_system(tpu)
#tpu_strategy = tf.distribute.experimental.TPUStrategy(tpu)
strategy = tf.distribute.TPUStrategy(tpu)

2 Answers2

3

Short answer would be no. There isn't a way to specify specific TPU version you want. Kaggle though provides v3-8 TPUs I believe (which may be subject to change as well since it's free). Also, as the other answer points out, you can spin up a paid Cloud TPU yourself as well, for which you can specify the specific hardware.

jysohn
  • 871
  • 6
  • 9
  • Do you know how I could use Google Cloud TPU in Google Colab? –  Nov 17 '20 at 15:00
  • You can choose between CPU vs GPU vs TPU runtime by selecting accelerator at: Runtime > Change runtime type > Hardware accelerator (dropdown). – jysohn Nov 17 '20 at 21:43
  • Is it possible to SSH into a Colab notebook on TPU? I know how to ssh into one on GPU, but for the past few hours I just cannot connect myself with a TPU one. – Li-Pin Juan Feb 21 '21 at 20:48
1

As far as I know, the free version of Colab does not provide any way to choose neither GPU nor TPU. As well as the pro version, though.

You can buy specific TPU v3 from CloudTPU for $8.00/hour if really need to.

Quote from Colab FAQ:

There is no way to choose what type of GPU you can connect to in Colab at any given time. Users who are interested in more reliable access to Colab’s fastest GPUs may be interested in Colab Pro.

Maxim Nazaruk
  • 356
  • 4
  • 6
  • Nazaruk thank you for your information! Do you know how to use the Google Cloud TPU in Google Colab then? Do you have any references? –  Nov 08 '20 at 08:56
  • I don't know how to answer this question briefly and clearly. I can only reference you to [Cloud Documentation](https://cloud.google.com/tpu/docs/beginners-guide). Also, they have a [free trial](https://cloud.google.com/free) – Maxim Nazaruk Nov 08 '20 at 09:44