运行 简单的 TensorFlow 代码示例时无法连接到任何 Graphcore IPU 设备
Failed to attach to any of the Graphcore IPU devices when running simple TensorFlow code example
我已经尝试 运行 Graphcore 的一个 GitHub 代码示例,Tensorflow simple replication one 遵循自述文件 --replication-factor 16
,并抛出以下错误:
tensorflow.python.framework.errors_impl.InternalError: Failed to attach to any of the device(s) with matching configs for ordinal 0
我不确定为什么无法连接:我尝试使用 gc-info -l
作为调试工具,它正确显示了机箱上所有可用的 IPU 配置。之前还好好的,看起来还挺有气质的。我试过重新启动,但一段时间后错误再次随机出现。任何帮助将不胜感激。
此故障可能是由于 IPU 正忙于 运行其他进程或由不正确的环境配置引起的。
1。 IPU 正忙
当您执行 Poplar 程序(或使用 IPU 库的框架特定模型)时,您会请求一定数量的 IPU。例如,如果您请求 运行 一个具有 2 个 IPU 的程序,但其他人已经在使用机箱上的所有 IPU,那么您的程序将无法附加并抛出与您看到的类似的错误.对于这种情况,您只需等待所需数量的 IPU 可用。
您可以使用 gc-monitor
命令行工具验证设备是否正忙(参见 IPU Command Line tools guide)。这是一台繁忙的机器的样子:
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------+-----------------+
| Attached processes | IPU | Board |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------+----+----------+--------+--------+--------+
| PID | Command | Time | User | ID | Clock | Temp | Temp | Power |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------+----+----------+--------+--------+--------+
| 32778 | python | 7m34s | User_Name | 0 | 1300MHz | 37.1 C | 41.5 C |104.7 W |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------+----+----------+--------+--------+--------+
这是闲置机器的样子:
+--------------------------------------------------------------------------------------------------+
| No attached processes |
+--------------------------------------------------------------------------------------------------+
2。 gc-driver
未激活
您可以通过运行ning gc-info -l
查看驱动是否已经激活。如果不是,则 gc-info 将输出:
gc-info: command not found
否则,如果您 运行宁例如TensorFlow 应用程序,您可能 运行 出现以下错误(或类似错误):
tensorflow.python.framework.errors_impl.InvalidArgumentError: Target configuration failed: model disabled and no hardware IPU found. (Are you sure you enabled the Poplar driver?)
另一方面,如果驱动程序已激活,gc-info -l
输出通常会列出硬件平台中可用的所有 IPU。
要激活 gc-driver
,您应该确保按如下方式获取 gc-driver
启用脚本:
source <path_to_sdk>/gc_drivers-ubuntu_<ubuntu_version>-<sdk_version> <hash>/enable.sh
在您的情况下,gc-info -l
工作正常,因此您似乎更愿意遇到情况 1。
3。 gc-driver
未安装
要检查 gc-driver 是否安装正确,你可以 运行:
$ modinfo ipu_driver
这应该会输出类似于您的控制台的内容:
filename: /lib/modules/4.15.0-58-generic/updates/dkms/ipu_driver.ko
version: 1.0.41
我已经尝试 运行 Graphcore 的一个 GitHub 代码示例,Tensorflow simple replication one 遵循自述文件 --replication-factor 16
,并抛出以下错误:
tensorflow.python.framework.errors_impl.InternalError: Failed to attach to any of the device(s) with matching configs for ordinal 0
我不确定为什么无法连接:我尝试使用 gc-info -l
作为调试工具,它正确显示了机箱上所有可用的 IPU 配置。之前还好好的,看起来还挺有气质的。我试过重新启动,但一段时间后错误再次随机出现。任何帮助将不胜感激。
此故障可能是由于 IPU 正忙于 运行其他进程或由不正确的环境配置引起的。
1。 IPU 正忙
当您执行 Poplar 程序(或使用 IPU 库的框架特定模型)时,您会请求一定数量的 IPU。例如,如果您请求 运行 一个具有 2 个 IPU 的程序,但其他人已经在使用机箱上的所有 IPU,那么您的程序将无法附加并抛出与您看到的类似的错误.对于这种情况,您只需等待所需数量的 IPU 可用。
您可以使用 gc-monitor
命令行工具验证设备是否正忙(参见 IPU Command Line tools guide)。这是一台繁忙的机器的样子:
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------+-----------------+
| Attached processes | IPU | Board |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------+----+----------+--------+--------+--------+
| PID | Command | Time | User | ID | Clock | Temp | Temp | Power |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------+----+----------+--------+--------+--------+
| 32778 | python | 7m34s | User_Name | 0 | 1300MHz | 37.1 C | 41.5 C |104.7 W |
+--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+------------+----+----------+--------+--------+--------+
这是闲置机器的样子:
+--------------------------------------------------------------------------------------------------+
| No attached processes |
+--------------------------------------------------------------------------------------------------+
2。 gc-driver
未激活
您可以通过运行ning gc-info -l
查看驱动是否已经激活。如果不是,则 gc-info 将输出:
gc-info: command not found
否则,如果您 运行宁例如TensorFlow 应用程序,您可能 运行 出现以下错误(或类似错误):
tensorflow.python.framework.errors_impl.InvalidArgumentError: Target configuration failed: model disabled and no hardware IPU found. (Are you sure you enabled the Poplar driver?)
另一方面,如果驱动程序已激活,gc-info -l
输出通常会列出硬件平台中可用的所有 IPU。
要激活 gc-driver
,您应该确保按如下方式获取 gc-driver
启用脚本:
source <path_to_sdk>/gc_drivers-ubuntu_<ubuntu_version>-<sdk_version> <hash>/enable.sh
在您的情况下,gc-info -l
工作正常,因此您似乎更愿意遇到情况 1。
3。 gc-driver
未安装
要检查 gc-driver 是否安装正确,你可以 运行:
$ modinfo ipu_driver
这应该会输出类似于您的控制台的内容:
filename: /lib/modules/4.15.0-58-generic/updates/dkms/ipu_driver.ko
version: 1.0.41