我们正在尝试实现自己的CPU编译器的后端,但我们遇到了一个有点尴尬的情况:我们似乎无法让现有的TensorFlow编译器做任何事情。使用这里提供的TensorFlow XLA示例:
我们在配置步骤中使用TF_ENABLE_XLA=1从源代码构建TensorFlow,并在上提供调试信息。然后,我们在LLDB中运行softmax示例,并尝试在调用CpuCompiler::Compile()时中断。如下所示,程序运行到完成时不会中断Compile()函数,显然也不会中断任何预期调用它的函数。
~/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) 发布于 2017-04-15 08:48:46
在GitHub上回答:
https://github.com/tensorflow/tensorflow/issues/9194
TensorFlow开发提示中尚未启用CPU JIT。它应该可以在GPU上工作。
https://stackoverflow.com/questions/43403089
复制相似问题