Tensorflow 如何练习XLA编译器?

Tensorflow 如何练习XLA编译器?,tensorflow,Tensorflow,我们试图将我们自己的后端实现到TysFraceXLA编译器,但是我们遇到了一个让人尴尬的情况:我们似乎无法让现有的CPU编译器做任何事情。使用TysFraceXLA示例发现这里: 我们从源代码构建TensorFlow,在配置步骤中使用TF\u ENABLE\u XLA=1,并在上调试信息。然后,我们在LLDB中运行softmax示例,并尝试在调用CpuCompiler::Compile()时中断。如下图所示,程序在Compile()函数或任何预期调用它的函数处运行到完成,而不会中断 ~/tfl

我们试图将我们自己的后端实现到TysFraceXLA编译器,但是我们遇到了一个让人尴尬的情况:我们似乎无法让现有的CPU编译器做任何事情。使用TysFraceXLA示例发现这里:

我们从源代码构建TensorFlow,在配置步骤中使用
TF\u ENABLE\u XLA=1
,并在上调试信息。然后,我们在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) 
~/tflow$lldb--python3 mnist\u softmax\u xla.py
(lldb)目标创建“python3”
当前可执行文件设置为“python3”(x86_64)。
(lldb)设置--target.run-args“mnist_softmax_xla.py”
(lldb)b CpuCompiler::Compile
断点1:没有位置(挂起)。
警告:无法将断点解析到任何实际位置。
(lldb)r
启动进程10331:“/usr/bin/python3”(x86_64)
将2个位置添加到断点1
进程10331已停止并重新启动:线程1收到信号:SIGCHLD
提取/tmp/tensorflow/mnist/input_data/train-images-idx3-ubyte.gz
提取/tmp/tensorflow/mnist/input_数据/train-labels-idx1-ubyte.gz
提取/tmp/tensorflow/mnist/input_data/t10k-images-idx3-ubyte.gz
提取/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]平台主机上有8个可见设备
2017~04-13 15:35: 52.616628:I TysFult/Cyp/XLA/Service / Service .CC:183)XLA服务0x2B38 780在平台主机上执行计算。设备:
2017-04-13 15:35:52.616642:I tensorflow/compiler/xla/service/service.cc:191]流执行器设备(0):,
0.9195
进程10331已退出,状态为0(0x00000000)
在GitHub上回答:

CPU JIT尚未在TensorFlow开发提示中启用。它应该适用于GPU