【发布时间】:2020-11-10 12:31:06
【问题描述】:
colab 提供免费的 TPU。很容易看到给定了多少个内核,但我想知道是否可以查看每个内核有多少内存?
【问题讨论】:
标签: tensorflow google-colaboratory tpu
colab 提供免费的 TPU。很容易看到给定了多少个内核,但我想知道是否可以查看每个内核有多少内存?
【问题讨论】:
标签: tensorflow google-colaboratory tpu
据我所知,我们没有用于访问内存信息的 Tensorflow 操作或类似操作,但在 XRT 中我们有。同时,像下面的 sn-p 这样的东西会起作用吗?
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)。
【讨论】:
jax.devices() 来获取 TPU 内核(或设备,更一般地说)的数量。