我试过运行 Graphcore 的 GitHub 代码示例之一,在 README 之后的Tensorflow简单复制一个--replication-factor 16,并抛出以下错误:
tensorflow.python.framework.errors_impl.InternalError: Failed to attach to any of the device(s) with matching configs for ordinal 0
Run Code Online (Sandbox Code Playgroud)
我不确定为什么它无法连接:我尝试gc-info -l用作调试工具,它正确显示了机箱上可用的所有 IPU 配置。之前还好好的,好像还挺有气质的。我试过重新启动,但过一会儿又随机出现错误。任何帮助将非常感激。
我正在尝试使用 Graphcore 的PopART 框架(Poplar API 的一部分)来实现一个基本的流水线模型,以加速我的模型,该模型被拆分到多个处理器上。
我正在关注他们的示例代码,但我注意到该示例没有使用在pipelineStage()他们的其他一些应用程序(即Bert)中使用的调用,而是使用virtualGraph()定义操作应该运行的处理器。
以下示例的一小段:
# Dense 1
W0 = builder.addInitializedInputTensor(
init_weights(num_features, 512))
b0 = builder.addInitializedInputTensor(init_biases(512))
with builder.virtualGraph(0):
x1 = builder.aiOnnx.gemm([x0, W0, b0], debugPrefix="gemm_x1")
x2 = builder.aiOnnx.relu([x1], debugPrefix="relu_x2")
# Dense 2
W1 = builder.addInitializedInputTensor(init_weights(512, num_classes))
b1 = builder.addInitializedInputTensor(init_biases(num_classes))
with builder.virtualGraph(1):
x3 = builder.aiOnnx.gemm([x2, W1, b1], debugPrefix="gemm_x3")
x4 = builder.aiOnnx.relu([x3], debugPrefix="relu_x4")
Run Code Online (Sandbox Code Playgroud)
相反,Bert 示例似乎创建了一个结合virtualGraph()了pipelineStage()以下内容的上下文:
self.stack.enter_context(self.builder.pipelineStage(self.pipelineStage))
Run Code Online (Sandbox Code Playgroud)
我不确定哪种应该是首选样式。只使用有什么影响virtualGraph()吗?
小码是否可以引用其他文件(如头文件)中的代码?
如果我有一个codelet文件
//FileA.cpp
#include "FileB.h"
class SomeCustomVertex : public Vertex {
public:
bool compute() {
int a = SomeConstantDefinedInFileB;
}
...
}
Run Code Online (Sandbox Code Playgroud)
和其他一些“codelet”文件
//FileB.h
const int SomeConstantDefineInFileB = 42;
Run Code Online (Sandbox Code Playgroud)
并在主机图程序中:
graph.addCodelets({"codelets/FileA.cpp", "codelets/FileB.h"});
Run Code Online (Sandbox Code Playgroud)
我收到一个编译错误popc:
fatal error: 'FileB.h' file not found
#include "FileB.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
terminate called after throwing an instance of 'poplar::graph_program_compilation_error'
what(): Codelet compilation failed (see compiler output for details)
Run Code Online (Sandbox Code Playgroud) 我有一个 TensorFlow 模型,它被编译为 XLA 以与一些 Graphcore IPU 一起使用。出于调试目的,我试图将 XLA 图形转储到 .dot 文件中,以便在浏览器中对其进行可视化。
为此,我使用以下标志:
--xla_dump_to=/mnt/data/perf_prof_5/xla_dump --xla_dump_hlo_as_dot --xla_dump_hlo_pass_re=forward-allocation --xla_hlo_graph_sharding_color
Run Code Online (Sandbox Code Playgroud)
但是,我得到了多个输出文件,但不确定哪一个是正确的。它们的名称和编号也根据我是否编译图形(使用ipu.compile指令)而有所不同。
哪个文件包含图形以及名称的含义是什么?
我正在尝试从 Graphcore 公共示例 ( MNIST )运行一个 TensorFlow2 示例。我使用 IPU 模型而不是 IPU 硬件,因为我的机器无法访问 IPU 硬件,所以我按照文档(在 IPU 模型模拟器上运行)并将以下内容添加到我的模型中:
# Using IPU model instead of IPU hardware
if self.base_dictionary['ipu_model']:
os.environ['TF_POPLAR_FLAGS'] = '--use_ipu_model'
Run Code Online (Sandbox Code Playgroud)
当我运行的模型,它失败:Illegal instruction (core dumped)。我不知道这是从哪里来的,因为我使用了一个现有的例子。这是什么错误,我该如何解决?
为什么我像下面的命令一样指定ipu4并且ipu4_ex都在 docker 中使用 ipu 设备?
docker run --device=/dev/**ipu4**:/dev/ipu4 --device=/dev/**ipu4_ex**:/dev/ipu4_ex -ti graphcore/tools gc-inventory
Run Code Online (Sandbox Code Playgroud) 我想用 graphcore IPU 测试性能,但我不知道如何使用 tensorflow。有人可以帮我做到这一点吗?