Xla: Retrieve information about TPU (memory, name, ...)

Created on 8 Jun 2020  ·  7Comments  ·  Source: pytorch/xla

❓ Questions and Help

Is it possible to retrieve information about the TPU in use? For example

  • Memory capacity of device (or is it always 8 GB?)
  • Current memory usage
  • Name of TPU
  • TPU version

All 7 comments

While your job is running you can capture a profile of the job using the capture_tpu_profile (https://cloud.google.com/tpu/docs/cloud-tpu-tools) tool which should also give you an idea of the HBM usage, etc. Also our v2 TPUs have 8GB HBM and our v3 have 16GB HBM per core.

Also, to clarify, you want to know the name and version of the TPU while you're already training on it?

We planned to add an XRT API to extract live memory info, but never got to it.
This might be the week 😄

Thanks a lot for your answers!
Yes, having a XRT API would be super useful!

A feature I think that would be very useful would be something similar to PyTorchs max_memory_reseverd: https://pytorch.org/docs/stable/cuda.html#torch.cuda.max_memory_reserved so that one would know
the required memory for a given model on TPU and that could be called from python code

@jysohn23
Yeah, I guess the there isn't really a name for a TPU (similar to GPU TITAN RTX), so just the version v1, v2, v3 would be great :-)
By name I just meant the version, e.g. v2 TPU

There is an in-flight internal XRT CL. This should be available somewhere next week.

That's awesome!

I just noticed that this morning our nightly build chain failed, so this will be out tomorrow in nightly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

magicknight picture magicknight  ·  3Comments

nosound2 picture nosound2  ·  8Comments

cjolivier01 picture cjolivier01  ·  7Comments

myleott picture myleott  ·  6Comments

dalmia picture dalmia  ·  6Comments