首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用XLA编译器?

如何使用XLA编译器?
EN

Stack Overflow用户
提问于 2017-04-14 07:16:00
回答 1查看 1.4K关注 0票数 2

我们正在尝试实现自己的CPU编译器的后端,但我们遇到了一个有点尴尬的情况:我们似乎无法让现有的TensorFlow编译器做任何事情。使用这里提供的TensorFlow XLA示例:

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_softmax_xla.py

我们在配置步骤中使用TF_ENABLE_XLA=1从源代码构建TensorFlow,并在上提供调试信息。然后,我们在LLDB中运行softmax示例,并尝试在调用CpuCompiler::Compile()时中断。如下所示,程序运行到完成时不会中断Compile()函数,显然也不会中断任何预期调用它的函数。

代码语言:javascript
复制
~/tflow$ lldb -- python3 mnist_softmax_xla.py 
(lldb) target create "python3"
Current executable set to 'python3' (x86_64).
(lldb) settings set -- target.run-args  "mnist_softmax_xla.py"
(lldb) b CpuCompiler::Compile
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) r
Process 10331 launched: '/usr/bin/python3' (x86_64)
2 locations added to breakpoint 1
Process 10331 stopped and restarted: thread 1 received signal: SIGCHLD
Extracting /tmp/tensorflow/mnist/input_data/train-images-idx3-ubyte.gz
Extracting /tmp/tensorflow/mnist/input_data/train-labels-idx1-ubyte.gz
Extracting /tmp/tensorflow/mnist/input_data/t10k-images-idx3-ubyte.gz
Extracting /tmp/tensorflow/mnist/input_data/t10k-labels-idx1-ubyte.gz
2017-04-13 15:35:52.612498: I tensorflow/compiler/xla/service/platform_util.cc:58] platform Host present with 8 visible devices
2017-04-13 15:35:52.616628: I tensorflow/compiler/xla/service/service.cc:183] XLA service 0x2b38780 executing computations on platform Host. Devices:
2017-04-13 15:35:52.616642: I tensorflow/compiler/xla/service/service.cc:191]   StreamExecutor device (0): <undefined>, <undefined>
0.9195
Process 10331 exited with status = 0 (0x00000000) 
EN

回答 1

Stack Overflow用户

发布于 2017-04-15 08:48:46

在GitHub上回答:

https://github.com/tensorflow/tensorflow/issues/9194

TensorFlow开发提示中尚未启用CPU JIT。它应该可以在GPU上工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43403089

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档