在Google Colab中,有没有一种方法可以检查正在运行的TPU版本? [英] In google colab, is there a way to check what TPU verison is running?

查看:77
本文介绍了在Google Colab中,有没有一种方法可以检查正在运行的TPU版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

colab提供免费的TPU.可以很容易地看到有多少个内核,但是我想知道是否有可能看到每个内核有多少内存?

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?

推荐答案

据我所知,我们没有Tensorflow op或类似的访问内存信息的方法,尽管在XRT中我们有.同时,下面的代码片段会起作用吗?

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))

输出如下:

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

TPUv2每核具有8GB,TPUv3每核具有16GB HBM( https://cloud.google.com/tpu ).

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

这篇关于在Google Colab中,有没有一种方法可以检查正在运行的TPU版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆