diff --git a/core/cube/cube-api/src/cube_cli.cpp b/core/cube/cube-api/src/cube_cli.cpp index f43f3deacf21db2f777012539fcd83a8fb70002b..4a29ef46392af22deb1b1a633d799f9846e86c59 100644 --- a/core/cube/cube-api/src/cube_cli.cpp +++ b/core/cube/cube-api/src/cube_cli.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include +#include #include #include #include //NOLINT @@ -33,7 +34,7 @@ std::atomic g_concurrency(0); std::vector> time_list; std::vector request_list; -int turns = 1000000 / FLAGS_batch; +int turns = 1000; namespace { inline uint64_t time_diff(const struct timeval& start_time, @@ -94,14 +95,15 @@ int run(int argc, char** argv, int thread_id) { uint64_t file_size = key_list.size(); uint64_t index = 0; uint64_t request = 0; - while (g_concurrency.load() >= FLAGS_thread_num) { } g_concurrency++; time_list[thread_id].resize(turns); - while (index < file_size) { + while (request < turns) { // uint64_t key = strtoul(buffer, NULL, 10); - + if (index >= file_size) { + index = 0; + } keys.push_back(key_list[index]); index += 1; int ret = 0; @@ -160,7 +162,7 @@ int run_m(int argc, char** argv) { uint64_t sum_time = 0; uint64_t max_time = 0; uint64_t min_time = 1000000; - uint64_t request_num = 0; + std::vector all_time_list; for (int i = 0; i < thread_num; i++) { for (int j = 0; j < request_list[i]; j++) { sum_time += time_list[i][j]; @@ -170,20 +172,29 @@ int run_m(int argc, char** argv) { if (time_list[i][j] < min_time) { min_time = time_list[i][j]; } + all_time_list.push_back(time_list[i][j]); } - request_num += request_list[i]; } + std::sort(all_time_list.begin(), all_time_list.end()); uint64_t mean_time = sum_time / (thread_num * turns); uint64_t main_time = time_diff(main_start, main_end); - LOG(INFO) << "\n" - << thread_num << " thread seek cost" - << "\navg = " << std::to_string(mean_time) - << "\nmax = " << std::to_string(max_time) - << "\nmin = " << std::to_string(min_time); - LOG(INFO) << "\ntotal_request = " << std::to_string(request_num) - << "\nspeed = " << std::to_string(request_num * 1000000 / - main_time) // mean_time us - << " query per second"; + uint64_t request_num = turns * thread_num; + LOG(INFO) + << "\n" + << thread_num << " thread seek cost" + << "\navg: " << std::to_string(mean_time) << "\n50 percent: " + << std::to_string(all_time_list[static_cast(0.5 * request_num)]) + << "\n80 percent: " + << std::to_string(all_time_list[static_cast(0.8 * request_num)]) + << "\n90 percent: " + << std::to_string(all_time_list[static_cast(0.9 * request_num)]) + << "\n99 percent: " + << std::to_string(all_time_list[static_cast(0.99 * request_num)]) + << "\n99.9 percent: " + << std::to_string(all_time_list[static_cast(0.999 * request_num)]) + << "\ntotal_request: " << std::to_string(request_num) << "\nspeed: " + << std::to_string(turns * 1000000 / main_time) // mean_time us + << " query per second"; return 0; } diff --git a/doc/CUBE_QUANT.md b/doc/CUBE_QUANT.md index b191695aed247fcadcf10c4bfe3d72343d6d64d0..870b49fcf0e72b9aba0729fdf762b67e2a7004e1 100644 --- a/doc/CUBE_QUANT.md +++ b/doc/CUBE_QUANT.md @@ -42,7 +42,7 @@ cd python/examples/criteo_ctr_with_cube python local_train.py cp ../../../build_server/core/predictor/seq_generator seq_generator cp ../../../build_server/output/bin/cube* ./cube/ -sh cube_prepare_quant.sh & +sh cube_quant_prepare.sh & python test_server_quant.py ctr_serving_model_kv & python test_client.py ctr_client_conf/serving_client_conf.prototxt ./raw_data ``` diff --git a/doc/CUBE_QUANT_CN.md b/doc/CUBE_QUANT_CN.md index 023f4d2fe246341688dd69d8978ee42817c7adfd..d8c66968c633708742c636a020ceec905588d20b 100644 --- a/doc/CUBE_QUANT_CN.md +++ b/doc/CUBE_QUANT_CN.md @@ -42,7 +42,7 @@ cd python/examples/criteo_ctr_with_cube python local_train.py cp ../../../build_server/core/predictor/seq_generator seq_generator cp ../../../build_server/output/bin/cube* ./cube/ -sh cube_prepare_quant.sh & +sh cube_quant_prepare.sh & python test_server_quant.py ctr_serving_model_kv & python test_client.py ctr_client_conf/serving_client_conf.prototxt ./raw_data ``` diff --git a/doc/NEW_WEB_SERVICE.md b/doc/NEW_WEB_SERVICE.md index a36c1b7633076b04801bcbb5ce04ae39acd7bce9..39bca98a3bdfbc1b2cadb5d2c3d60395b4592b34 100644 --- a/doc/NEW_WEB_SERVICE.md +++ b/doc/NEW_WEB_SERVICE.md @@ -2,7 +2,7 @@ ([简体中文](NEW_WEB_SERVICE_CN.md)|English) -This document will take the image classification service based on the Imagenet data set as an example to introduce how to develop a new web service. The complete code can be visited at [here](https://github.com/PaddlePaddle/Serving/blob/develop/python/examples/imagenet/image_classification_service.py). +This document will take the image classification service based on the Imagenet data set as an example to introduce how to develop a new web service. The complete code can be visited at [here](../python/examples/imagenet/resnet50_web_service.py). ## WebService base class diff --git a/doc/NEW_WEB_SERVICE_CN.md b/doc/NEW_WEB_SERVICE_CN.md index c9555f88a62d64b2ce1b2d8dabd2bf88dc706326..43ca7fb61f2c70f13019574a7984e3665bd1b6fa 100644 --- a/doc/NEW_WEB_SERVICE_CN.md +++ b/doc/NEW_WEB_SERVICE_CN.md @@ -2,7 +2,7 @@ (简体中文|[English](NEW_WEB_SERVICE.md)) -本文档将以Imagenet图像分类服务为例,来介绍如何开发一个新的Web Service。您可以在[这里](https://github.com/PaddlePaddle/Serving/blob/develop/python/examples/imagenet/image_classification_service.py)查阅完整的代码。 +本文档将以Imagenet图像分类服务为例,来介绍如何开发一个新的Web Service。您可以在[这里](../python/examples/imagenet/resnet50_web_service.py)查阅完整的代码。 ## WebService基类 diff --git a/doc/PIPELINE_SERVING_CN.md b/doc/PIPELINE_SERVING_CN.md index 366e33cf189480ec5ab164d8b3d62877401d2a72..22e4b33050ac64ae7c53454ab5110ee623b93ce7 100644 --- a/doc/PIPELINE_SERVING_CN.md +++ b/doc/PIPELINE_SERVING_CN.md @@ -1,5 +1,3 @@ - - # Pipeline Serving Paddle Serving 通常用于单模型的一键部署,但端到端的深度学习模型当前还不能解决所有问题,多个深度学习模型配合起来使用还是解决现实问题的常规手段。 @@ -374,4 +372,3 @@ for f in futures: print(res) exit(1) ``` - diff --git a/python/examples/criteo_ctr_with_cube/README.md b/python/examples/criteo_ctr_with_cube/README.md index 02125422af7e7ce53a05a1eff9a43159034a79dc..6dc81f3a6b0f98017e0c5b45234f8f348c5f75ce 100755 --- a/python/examples/criteo_ctr_with_cube/README.md +++ b/python/examples/criteo_ctr_with_cube/README.md @@ -27,7 +27,7 @@ mv cube_app/cube* ./cube/ sh cube_prepare.sh & ``` -Here, the sparse parameter is loaded by cube sparse parameter indexing service Cube,for more details please read [Cube: Sparse Parameter Indexing Service (Local Mode)](../../../doc/CUBE_LOCAL.md) +Here, the sparse parameter is loaded by cube sparse parameter indexing service Cube. ### Start RPC Predictor, the number of serving thread is 4(configurable in test_server.py) diff --git a/python/examples/criteo_ctr_with_cube/README_CN.md b/python/examples/criteo_ctr_with_cube/README_CN.md index 3b6f812ca53bd435e9b11b59e2a459c46ee3f864..97d5629170f3a65dabb104c3764a55ba08051bc5 100644 --- a/python/examples/criteo_ctr_with_cube/README_CN.md +++ b/python/examples/criteo_ctr_with_cube/README_CN.md @@ -25,7 +25,7 @@ mv cube_app/cube* ./cube/ sh cube_prepare.sh & ``` -此处,模型当中的稀疏参数会被存放在稀疏参数索引服务Cube当中,关于稀疏参数索引服务Cube的介绍,请阅读[稀疏参数索引服务Cube单机版使用指南](../../../doc/CUBE_LOCAL_CN.md) +此处,模型当中的稀疏参数会被存放在稀疏参数索引服务Cube当中。 ### 启动RPC预测服务,服务端线程数为4(可在test_server.py配置) diff --git a/python/examples/criteo_ctr_with_cube/benchmark_cube.sh b/python/examples/criteo_ctr_with_cube/benchmark_cube.sh index e4a2cb3681642312f9c7fe8199cc4d7e68f5d9bf..cb89bb1f689c54c773f7bd832567fd52db8a86e4 100755 --- a/python/examples/criteo_ctr_with_cube/benchmark_cube.sh +++ b/python/examples/criteo_ctr_with_cube/benchmark_cube.sh @@ -1,13 +1,13 @@ rm profile_log -wget https://paddle-serving.bj.bcebos.com/unittest/ctr_cube_unittest.tar.gz --no-check-certificate -tar xf ctr_cube_unittest.tar.gz +#wget https://paddle-serving.bj.bcebos.com/unittest/ctr_cube_unittest.tar.gz --no-check-certificate +#tar xf ctr_cube_unittest.tar.gz mv models/ctr_client_conf ./ mv models/ctr_serving_model_kv ./ mv models/data ./cube/ -wget https://paddle-serving.bj.bcebos.com/others/cube_app.tar.gz --no-check-certificate -tar xf cube_app.tar.gz +#wget https://paddle-serving.bj.bcebos.com/others/cube_app.tar.gz --no-check-certificate +#tar xf cube_app.tar.gz mv cube_app/cube* ./cube/ sh cube_prepare.sh & @@ -24,8 +24,7 @@ do echo "========================================" echo "batch size : $batch_size" >> profile_log echo "thread num : $thread_num" >> profile_log - tail -n 7 profile | head -n 4 >> profile_log - tail -n 2 profile >> profile_log + tail -n 8 profile >> profile_log done done diff --git a/python/paddle_serving_app/version.py b/python/paddle_serving_app/version.py index 92ef4bed8a2fa14f0f7e686f0424db23a1e7d227..332cba98dd692c4e33da68d4de7763e83e3729b5 100644 --- a/python/paddle_serving_app/version.py +++ b/python/paddle_serving_app/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. """ Paddle Serving App version string """ -serving_app_version = "0.1.1" +serving_app_version = "0.1.2" diff --git a/python/paddle_serving_client/version.py b/python/paddle_serving_client/version.py index 4e024f00030d1fcf9a5eec7a2d8aec6d7c029251..f7fc14b2a7f0c25b471e8d3bb44e9d6db6839d01 100644 --- a/python/paddle_serving_client/version.py +++ b/python/paddle_serving_client/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. """ Paddle Serving Client version string """ -serving_client_version = "0.3.1" -serving_server_version = "0.3.1" -module_proto_version = "0.3.1" +serving_client_version = "0.3.2" +serving_server_version = "0.3.2" +module_proto_version = "0.3.2" diff --git a/python/paddle_serving_server/version.py b/python/paddle_serving_server/version.py index 4e024f00030d1fcf9a5eec7a2d8aec6d7c029251..f7fc14b2a7f0c25b471e8d3bb44e9d6db6839d01 100644 --- a/python/paddle_serving_server/version.py +++ b/python/paddle_serving_server/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. """ Paddle Serving Client version string """ -serving_client_version = "0.3.1" -serving_server_version = "0.3.1" -module_proto_version = "0.3.1" +serving_client_version = "0.3.2" +serving_server_version = "0.3.2" +module_proto_version = "0.3.2" diff --git a/python/paddle_serving_server/web_service.py b/python/paddle_serving_server/web_service.py index ea43c8cb18731f60d905ccbe4bada605709d9c11..d9b9e3f1b1dcfa9502096d0eab4e3be61d2bbaa6 100755 --- a/python/paddle_serving_server/web_service.py +++ b/python/paddle_serving_server/web_service.py @@ -88,8 +88,8 @@ class WebService(object): result = self.postprocess( feed=request.json["feed"], fetch=fetch, fetch_map=fetch_map) result = {"result": result} - except ValueError: - result = {"result": "Request Value Error"} + except ValueError as err: + result = {"result": err} return result def run_rpc_service(self): diff --git a/python/paddle_serving_server_gpu/version.py b/python/paddle_serving_server_gpu/version.py index 4e024f00030d1fcf9a5eec7a2d8aec6d7c029251..f7fc14b2a7f0c25b471e8d3bb44e9d6db6839d01 100644 --- a/python/paddle_serving_server_gpu/version.py +++ b/python/paddle_serving_server_gpu/version.py @@ -12,6 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. """ Paddle Serving Client version string """ -serving_client_version = "0.3.1" -serving_server_version = "0.3.1" -module_proto_version = "0.3.1" +serving_client_version = "0.3.2" +serving_server_version = "0.3.2" +module_proto_version = "0.3.2" diff --git a/python/paddle_serving_server_gpu/web_service.py b/python/paddle_serving_server_gpu/web_service.py index 0eff9c72df84b30ded7dbc7c2e82a96bbd591162..fecc61ffa1f8637fb214cc748fb14c7ce30731ab 100644 --- a/python/paddle_serving_server_gpu/web_service.py +++ b/python/paddle_serving_server_gpu/web_service.py @@ -133,8 +133,8 @@ class WebService(object): result = self.postprocess( feed=request.json["feed"], fetch=fetch, fetch_map=fetch_map) result = {"result": result} - except ValueError: - result = {"result": "Request Value Error"} + except ValueError as err: + result = {"result": err} return result def run_rpc_service(self): diff --git a/python/setup.py.client.in b/python/setup.py.client.in index 4613d2db7747d06ab706bc96181f612985630811..96773c38dc950c0b8357274dff30d7c952ecdc25 100644 --- a/python/setup.py.client.in +++ b/python/setup.py.client.in @@ -58,7 +58,7 @@ if '${PACK}' == 'ON': REQUIRED_PACKAGES = [ - 'six >= 1.10.0', 'protobuf >= 3.1.0', 'numpy >= 1.12', 'grpcio >= 1.28.1', + 'six >= 1.10.0', 'protobuf >= 3.11.0', 'numpy >= 1.12', 'grpcio >= 1.28.1', 'grpcio-tools >= 1.28.1' ] diff --git a/python/setup.py.server.in b/python/setup.py.server.in index 967b98da42f77ac593d723ce64fe6533abe40bb0..db679edbab8e6ba6929ed631c2bbc5a731146d0d 100644 --- a/python/setup.py.server.in +++ b/python/setup.py.server.in @@ -37,7 +37,7 @@ def python_version(): max_version, mid_version, min_version = python_version() REQUIRED_PACKAGES = [ - 'six >= 1.10.0', 'protobuf >= 3.1.0', 'grpcio >= 1.28.1', 'grpcio-tools >= 1.28.1', + 'six >= 1.10.0', 'protobuf >= 3.11.0', 'grpcio >= 1.28.1', 'grpcio-tools >= 1.28.1', 'paddle_serving_client', 'flask >= 1.1.1', 'paddle_serving_app' ] diff --git a/python/setup.py.server_gpu.in b/python/setup.py.server_gpu.in index 29098b7c8d23a3f53abd084b68871c66512e8b4f..65dec4621fceba3967ff21814b218c0229a5124b 100644 --- a/python/setup.py.server_gpu.in +++ b/python/setup.py.server_gpu.in @@ -37,7 +37,7 @@ def python_version(): max_version, mid_version, min_version = python_version() REQUIRED_PACKAGES = [ - 'six >= 1.10.0', 'protobuf >= 3.1.0', 'grpcio >= 1.28.1', 'grpcio-tools >= 1.28.1', + 'six >= 1.10.0', 'protobuf >= 3.11.0', 'grpcio >= 1.28.1', 'grpcio-tools >= 1.28.1', 'paddle_serving_client', 'flask >= 1.1.1', 'paddle_serving_app' ] diff --git a/tools/Dockerfile.gpu b/tools/Dockerfile.gpu index adb8e73f86a8fa436de3844a60f08ab22df0177e..145cd53eb0b9848349d591fdc078833ec5a89740 100644 --- a/tools/Dockerfile.gpu +++ b/tools/Dockerfile.gpu @@ -3,7 +3,7 @@ FROM nvidia/cuda:9.0-cudnn7-devel-centos7 as builder FROM nvidia/cuda:9.0-cudnn7-runtime-centos7 RUN yum -y install wget && \ yum -y install epel-release && yum -y install patchelf && \ - yum -y install gcc make python-devel && \ + yum -y install gcc gcc-c++ make python-devel && \ yum -y install libSM-1.2.2-2.el7.x86_64 --setopt=protected_multilib=false && \ yum -y install libXrender-0.9.10-1.el7.x86_64 --setopt=protected_multilib=false && \ yum -y install libXext-1.3.3-3.el7.x86_64 --setopt=protected_multilib=false && \ diff --git a/tools/Dockerfile.gpu.devel b/tools/Dockerfile.gpu.devel index 583b0566edf85f56c5fcc6f9f36dce6430ba7941..c101b32118bf735a100bdb07f2e33f7978a8a30c 100644 --- a/tools/Dockerfile.gpu.devel +++ b/tools/Dockerfile.gpu.devel @@ -1,7 +1,10 @@ FROM nvidia/cuda:9.0-cudnn7-devel-centos7 RUN yum -y install wget >/dev/null \ && yum -y install gcc gcc-c++ make glibc-static which \ - && yum -y install git openssl-devel curl-devel bzip2-devel python-devel + && yum -y install git openssl-devel curl-devel bzip2-devel python-devel \ + && yum -y install libSM-1.2.2-2.el7.x86_64 --setopt=protected_multilib=false \ + && yum -y install libXrender-0.9.10-1.el7.x86_64 --setopt=protected_multilib=false \ + && yum -y install libXext-1.3.3-3.el7.x86_64 --setopt=protected_multilib=false RUN wget https://cmake.org/files/v3.2/cmake-3.2.0-Linux-x86_64.tar.gz >/dev/null \ && tar xzf cmake-3.2.0-Linux-x86_64.tar.gz \