为什么我的使用bazel build copt avx2的TensorFlow服务无助于加快推理速度?

问题描述 投票:0回答:1

我正在使用tensorflow-v1.12.0构建我的tf服务服务。我已经尝试过各种可用于我的CPU的copt。但是结果没有达到我的预期。下图显示了我项目中每个警察的表演。performances for each copt

我想知道为什么警察没有任何积极的作用。参考:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

c++ tensorflow bazel tensorflow-serving
1个回答
0
投票

最后自己找到答案。这是因为我没有在编译中启用mkl。使用CPU指令集优化来编译TF的正确方法是添加“ --config = mkl -c opt --copt = mavx2”

它减少了我项目中预计时间成本的20%。

© www.soinside.com 2019 - 2024. All rights reserved.