请以ATC软件包安装用户进行如下操作:
tar -zxvf tensorflow-1.15.0.tar.gz
patch -p1 < xlacompile.patch
bazel build --config=monolithic //tensorflow/compiler/aot:xlacompile
若出现类似如下信息,则说明编译成功,编译大约需要10分钟左右;若编译失败,请参见使用bazel编译工具编译时提示“An error occurred during the fetch of repository 'io_bazel_rules_docker'”,编译失败解决。
Target //tensorflow/compiler/aot:xlacompile up-to-date: bazel-bin/tensorflow/compiler/aot/xlacompile INFO: Elapsed time: 214.550s, Critical Path: 73.38s INFO: 1511 processes: 1511 local. INFO: Build completed successfully, 1513 total actions
编译成功后,会在$HOME/.cache/bazel/_bazel_test/abd37aaac8a380ca5a3f13938322fcb2/external/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/compiler/aot路径生成xlacompile可执行文件(该路径只是样例,请以用户实际编译后的为准)。
xlacompile可执行文件用于将控制流算子的网络模型转成函数类算子的网络模型。
bazel build --config=monolithic -c opt //tensorflow/tools/graph_transforms:summarize_graph
若出现类似如下信息,则说明编译成功:
Target //tensorflow/tools/graph_transforms:summarize_graph up-to-date: bazel-bin/tensorflow/tools/graph_transforms/summarize_graph INFO: Elapsed time: 70.474s, Critical Path: 53.16s INFO: 1028 processes: 1028 local. INFO: Build completed successfully, 1053 total actions
编译成功后,会在$HOME/.cache/bazel/_bazel_test/abd37aaac8a380ca5a3f13938322fcb2/execroot/org_tensorflow/bazel-out/k8-opt/bin/tensorflow/tools/graph_transforms路径生成summarize_graph可执行文件(该路径只是样例,请以用户实际编译后的为准)。
summarize_graph可执行文件用来查看有控制流算子网络模型的输入输出节点,方便用户构造config.pbtxt输入输出配置文件。