提交 5b73d0cd 编写于 作者: W wangguibao

Add cmake option: CLIENT_ONLY - Compile client libraries and demos only

Change-Id: I3029679e261524053c00ea985cfcafb3dfb49bf6
上级 84015878
......@@ -43,8 +43,10 @@ set(THIRD_PARTY_PATH "${CMAKE_BINARY_DIR}/third_party" CACHE STRING
set(THIRD_PARTY_BUILD_TYPE Release)
option(WITH_AVX "Compile PaddlePaddle with AVX intrinsics" ${AVX_FOUND})
option(WITH_MKL "Compile PaddlePaddle with MKL support." ${AVX_FOUND})
option(WITH_AVX "Compile Paddle Serving with AVX intrinsics" ${AVX_FOUND})
option(WITH_MKL "Compile Paddle Serving with MKL support." ${AVX_FOUND})
option(CLIENT_ONLY "Compile client libraries and demos only"
FALSE)
set(WITH_MKLML ${WITH_MKL})
if (NOT DEFINED WITH_MKLDNN)
......@@ -56,19 +58,22 @@ if (NOT DEFINED WITH_MKLDNN)
endif()
endif()
include(external/mklml)
include(external/leveldb)
include(external/zlib)
include(external/boost)
include(external/protobuf)
include(external/brpc)
include(external/gflags)
include(external/glog)
include(external/leveldb)
include(external/protobuf)
include(external/snappy)
include(external/brpc)
include(external/boost)
include(flags)
include(generic)
include(flags)
if (NOT CLIENT_ONLY)
include(external/mklml)
include(paddlepaddle)
include(external/opencv)
endif()
include_directories(${PADDLE_SERVING_SOURCE_DIR})
include_directories(${PADDLE_SERVING_BINARY_DIR})
......@@ -81,6 +86,7 @@ set(EXTERNAL_LIBS
brpc
)
if(WITH_MKLML)
list(APPEND EXTERNAL_LIBS ${MKLML_IOMP_LIB})
endif()
......@@ -90,9 +96,17 @@ if(WITH_MKLDNN)
list(APPEND EXTERNAL_LIBS ${MKLDNN_LIB})
endif()
if (NOT CLIENT_ONLY)
list(APPEND EXTERNAL_LIBS paddlepaddle)
list(APPEND EXTERNAL_LIBS opencv)
endif()
add_subdirectory(configure)
add_subdirectory(pdcodegen)
add_subdirectory(sdk-cpp)
if (NOT CLIENT_ONLY)
add_subdirectory(predictor)
add_subdirectory(inferencer-fluid-cpu)
add_subdirectory(serving)
add_subdirectory(sdk-cpp)
endif()
......@@ -60,7 +60,8 @@ $ make install
因Paddle Serving依托于PaddlePaddle项目进行构建,以下编译选项其实是传递给PaddlePaddle的编译选项:
| 编译选项 | 说明|
|----------|-----|
| 编译选项 | 说明 |
|----------|------|
| WITH_AVX | Compile PaddlePaddle with AVX intrinsics |
| WITH_MKL | Compile PaddlePaddle with MKLML library |
| CLINET_ONLY | Compile client libraries and demos only |
......@@ -17,7 +17,7 @@
#include <unistd.h>
#include <fstream>
#include "predictor/builtin_format.pb.h"
#include "sdk-cpp/builtin_format.pb.h"
#include "sdk-cpp/dense_service.pb.h"
#include "sdk-cpp/include/common.h"
#include "sdk-cpp/include/predictor_sdk.h"
......
......@@ -17,7 +17,7 @@
#include <unistd.h>
#include <fstream>
#include "predictor/builtin_format.pb.h"
#include "sdk-cpp/builtin_format.pb.h"
#include "sdk-cpp/echo_service.pb.h"
#include "sdk-cpp/include/common.h"
#include "sdk-cpp/include/predictor_sdk.h"
......
......@@ -17,7 +17,7 @@
#include <unistd.h>
#include <fstream>
#include "predictor/builtin_format.pb.h"
#include "sdk-cpp/builtin_format.pb.h"
#include "sdk-cpp/include/common.h"
#include "sdk-cpp/include/predictor_sdk.h"
#include "sdk-cpp/int64tensor_service.pb.h"
......
......@@ -17,7 +17,7 @@
#include <unistd.h>
#include <fstream>
#include "predictor/builtin_format.pb.h"
#include "sdk-cpp/builtin_format.pb.h"
#include "sdk-cpp/include/common.h"
#include "sdk-cpp/include/predictor_sdk.h"
#include "sdk-cpp/sparse_service.pb.h"
......
......@@ -17,7 +17,7 @@
#include <unistd.h>
#include <fstream>
#include "predictor/builtin_format.pb.h"
#include "sdk-cpp/builtin_format.pb.h"
#include "sdk-cpp/include/common.h"
#include "sdk-cpp/include/predictor_sdk.h"
#include "sdk-cpp/text_classification.pb.h"
......
......@@ -19,7 +19,7 @@
#include <atomic>
#include <fstream>
#include <thread> // NOLINT
#include "predictor/builtin_format.pb.h"
#include "sdk-cpp/builtin_format.pb.h"
#include "sdk-cpp/include/common.h"
#include "sdk-cpp/include/predictor_sdk.h"
#include "sdk-cpp/text_classification.pb.h"
......@@ -328,18 +328,26 @@ int main(int argc, char **argv) {
LOG(INFO) << "Total requests: " << round_times.size();
LOG(INFO) << "Max concurrency: " << FLAGS_concurrency;
LOG(INFO) << "Elapse ms (wall-time): " << elapse_ms;
double qps = (static_cast<double>(count) / elapse_ms) * 1000;
double qps = 0.0;
if (elapse_ms != 0) {
qps = (static_cast<double>(count) / elapse_ms) * 1000;
}
LOG(INFO) << "QPS: " << qps / FLAGS_batch_size << "/s";
LOG(INFO) << "Accuracy " << static_cast<double>(correct) / count;
LOG(INFO) << "Latency statistics: ";
LOG(INFO) << "Average ms: " << total_ms / round_times.size();
LOG(INFO) << "50 percent ms: " << round_times[percent_pos_50];
LOG(INFO) << "80 percent ms: " << round_times[percent_pos_80];
LOG(INFO) << "90 percent ms: " << round_times[percent_pos_90];
LOG(INFO) << "99 percent ms: " << round_times[percent_pos_99];
LOG(INFO) << "99.9 percent ms: " << round_times[percent_pos_999];
if (round_times.size() != 0) {
LOG(INFO) << "Average ms: " << total_ms / round_times.size();
LOG(INFO) << "50 percent ms: " << round_times[percent_pos_50];
LOG(INFO) << "80 percent ms: " << round_times[percent_pos_80];
LOG(INFO) << "90 percent ms: " << round_times[percent_pos_90];
LOG(INFO) << "99 percent ms: " << round_times[percent_pos_99];
LOG(INFO) << "99.9 percent ms: " << round_times[percent_pos_999];
} else {
LOG(INFO) << "N/A";
}
return 0;
}
......
......@@ -17,7 +17,7 @@
#include <unistd.h>
#include <fstream>
#include "predictor/builtin_format.pb.h"
#include "sdk-cpp/builtin_format.pb.h"
#include "sdk-cpp/image_class.pb.h"
#include "sdk-cpp/include/common.h"
#include "sdk-cpp/include/predictor_sdk.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册