In google colab, is there a way to check what TPU verison is running?

孤街醉人 提交于 2020-12-06 19:22:22

问题


colab offers free TPUs. It's easy to see how many cores are given, but I was wondering if its possible to see how much memory per core?


回答1:


As far as I know we don't have an Tensorflow op or similar for accessing memory info, though in XRT we do. In the meantime, would something like the following snippet work?

import os
from tensorflow.python.profiler import profiler_client

tpu_profile_service_address = os.environ['COLAB_TPU_ADDR'].replace('8470', '8466')
print(profiler_client.monitor(tpu_profile_service_address, 100, 2))

Output looks like:

  Timestamp: 22:23:03
  TPU type: TPU v2
  Utilization of TPU Matrix Units (higher is better): 0.000%

TPUv2 has 8GB per-core and TPUv3 has 16GB HBM per-core (https://cloud.google.com/tpu).



来源:https://stackoverflow.com/questions/63009227/in-google-colab-is-there-a-way-to-check-what-tpu-verison-is-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!