gpt4 book ai didi

tensorflow - 如何找到更多关于您正在运行程序的 Cloud TPU 设备的信息?

转载 作者:行者123 更新时间:2023-12-04 17:43:30 26 4
gpt4 key购买 nike

无论我们是使用 Google Colab 还是直接访问 Cloud TPU,以下程序仅提供有关底层 TPU 的有限信息:

import os
import tensorflow as tf

tpu_address = 'grpc://' + os.environ['COLAB_TPU_ADDR']
print ('TPU address is', tpu_address)

def printTPUDevices():
with tf.Session(tpu_address) as session:
devices = session.list_devices()

print ('TPU devices:')
return devices

printTPUDevices()

是否有任何以编程方式或通过 bash 命令显示更多信息的文档,例如,请参阅此要点https://gist.github.com/neomatrix369/256913dcf77cdbb5855dd2d7f5d81b84 .

最佳答案

Cloud TPU 系统架构与 GPU 略有不同,因此无法获得这一级别的信息。

因为客户端与远程 TensorFlow 对话 server并使用 XLA ,客户端代码不需要根据 TPU 上的可用功能进行更改,远程服务器将根据 TPU 的功能编译机器指令。

然而 Cloud TPU Profiler确实给出了 TPU 的较低级别 View 以进行性能优化。您可以查看跟踪级别 View ,了解哪些操作耗尽了内存和计算时间。

关于tensorflow - 如何找到更多关于您正在运行程序的 Cloud TPU 设备的信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53287556/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com