【问题标题】:In google colab, is there a way to check what TPU verison is running?在 google colab 中,有没有办法检查您的版本正在运行?
【发布时间】:2020-11-10 12:31:06
【问题描述】:

colab 提供免费的 TPU。很容易看到给定了多少个内核,但我想知道是否可以查看每个内核有多少内存?

【问题讨论】:

    标签: tensorflow google-colaboratory tpu


    【解决方案1】:

    据我所知,我们没有用于访问内存信息的 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)。

    【讨论】:

    • 如何查看可用 TPU 内核的数量?
    • 如果您使用的是 JAX,那么您可以使用 jax.devices() 来获取 TPU 内核(或设备,更一般地说)的数量。
    猜你喜欢
    • 1970-01-01
    • 2020-11-15
    • 1970-01-01
    • 2016-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-04
    • 1970-01-01
    相关资源
    最近更新 更多