【发布时间】:2017-11-27 13:41:57
【问题描述】:
我观察到 CPU 与 Tensorflow 模型服务器的性能问题。与原始 Tensorflow 模型推理相比,它的推理时间加倍。两者均使用 MKL 构建,仅用于 CPU。
要重现的代码:https://github.com/BogdanRuzh/tf_model_service_benchmark
Tensorflow MKL 构建:
bazel build --config=mkl -c opt --copt=-msse4.1 --copt=-msse4.2 --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-O3 //tensorflow/tools/pip_package:build_pip_package
Tensorflow 服务器 MKL 构建:
bazel build --config=mkl --config=opt --copt=-msse4.1 --copt=-msse4.2 --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-O3 tensorflow_serving/model_servers:tensorflow_model_server
目标模型是用于分割的简单 CNN。
原始 Tensorflow 模型在 0.17 秒内处理一张图像。 TensorFlow 模型服务器在 0.32 秒内处理相同的图像。
如何提高这种性能?这对我的应用非常重要。
【问题讨论】:
标签: python performance tensorflow deep-learning tensorflow-serving