diff --git a/python/examples/pipeline/bert/benchmark.sh b/python/examples/pipeline/bert/benchmark.sh index fa5cc8b702e014af9d27564b845abc46b6c5cc8a..bff0fd8e4eb429efd37f7267d959f5e0f600d8ce 100644 --- a/python/examples/pipeline/bert/benchmark.sh +++ b/python/examples/pipeline/bert/benchmark.sh @@ -6,9 +6,9 @@ ps -ef | grep web_service | awk '{print $2}' | xargs kill -9 sleep 3 python3 benchmark.py yaml local_predictor 1 gpu rm -rf profile_log_$modelname -for thread_num in 1 +for thread_num in 1 8 16 do - for batch_size in 20 + for batch_size in 1 10 100 do echo "----Bert thread num: $thread_num batch size: $batch_size mode:http ----" >>profile_log_$modelname rm -rf PipelineServingLogs @@ -34,9 +34,9 @@ ps -ef | grep web_service | awk '{print $2}' | xargs kill -9 sleep 3 python3 benchmark.py yaml local_predictor 1 gpu -for thread_num in 1 +for thread_num in 1 8 16 do - for batch_size in 20 + for batch_size in 1 10 100 do echo "----Bert thread num: $thread_num batch size: $batch_size mode:rpc ----" >>profile_log_$modelname rm -rf PipelineServingLogs diff --git a/python/examples/pipeline/bert/config.yml b/python/examples/pipeline/bert/config.yml index 29520bf3c91f0c06a8ef0dd6fb9244a375ad0474..6896ef5cb774cfeda4582d4542af9c75d5204651 100644 --- a/python/examples/pipeline/bert/config.yml +++ b/python/examples/pipeline/bert/config.yml @@ -14,4 +14,4 @@ op: - pooled_output model_config: bert_seq128_model/ rpc_port: 9998 -worker_num: 1 +worker_num: 20 diff --git a/python/examples/pipeline/ocr/benchmark.sh b/python/examples/pipeline/ocr/benchmark.sh index 5887b034c102f0f5bae3be034e24243d297fb2f7..d789b94b98d03c87bfcc1ee7520e13336abdca2f 100644 --- a/python/examples/pipeline/ocr/benchmark.sh +++ b/python/examples/pipeline/ocr/benchmark.sh @@ -6,7 +6,7 @@ ps -ef | grep web_service | awk '{print $2}' | xargs kill -9 sleep 3 python3 benchmark.py yaml local_predictor 1 gpu rm -rf profile_log_$modelname -for thread_num in 1 +for thread_num in 1 8 16 do for batch_size in 1 do @@ -34,7 +34,7 @@ ps -ef | grep web_service | awk '{print $2}' | xargs kill -9 sleep 3 python3 benchmark.py yaml local_predictor 1 gpu -for thread_num in 1 +for thread_num in 1 8 16 do for batch_size in 1 do diff --git a/python/examples/pipeline/ocr/config.yml b/python/examples/pipeline/ocr/config.yml index 92149e0d8ac471de104f3d527d709dc384ee3c2c..251c2e2b21bb4fd17506752b6b922941c8be4105 100644 --- a/python/examples/pipeline/ocr/config.yml +++ b/python/examples/pipeline/ocr/config.yml @@ -6,7 +6,7 @@ http_port: 9999 #worker_num, 最大并发数。当build_dag_each_worker=True时, 框架会创建worker_num个进程,每个进程内构建grpcSever和DAG ##当build_dag_each_worker=False时,框架会设置主线程grpc线程池的max_workers=worker_num -worker_num: 1 +worker_num: 5 #build_dag_each_worker, False,框架在进程内创建一条DAG;True,框架会每个进程内创建多个独立的DAG build_dag_each_worker: false @@ -20,6 +20,9 @@ dag: #使用性能分析, True,生成Timeline性能数据,对性能有一定影响;False为不使用 use_profile: false + tracer: + interval_s: 10 + op: det: #并发数,is_thread_op=True时,为线程并发;否则为进程并发 @@ -37,7 +40,7 @@ op: fetch_list: ["concat_1.tmp_0"] #计算硬件ID,当devices为""或不写时为CPU预测;当devices为"0", "0,1,2"时为GPU预测,表示使用的GPU卡 - devices: "0" + devices: "2" rec: #并发数,is_thread_op=True时,为线程并发;否则为进程并发 concurrency: 2 @@ -61,4 +64,4 @@ op: fetch_list: ["ctc_greedy_decoder_0.tmp_0", "softmax_0.tmp_0"] #计算硬件ID,当devices为""或不写时为CPU预测;当devices为"0", "0,1,2"时为GPU预测,表示使用的GPU卡 - devices: "0" + devices: "2" diff --git a/python/examples/pipeline/ocr/web_service.py b/python/examples/pipeline/ocr/web_service.py index e91f0fe58788b3a0307fcd6607713018460357ab..72c25e0163fd266f4df6177c79f1ad492952c588 100644 --- a/python/examples/pipeline/ocr/web_service.py +++ b/python/examples/pipeline/ocr/web_service.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. try: - from paddle_serving_server.web_service import WebService, Op -except ImportError: from paddle_serving_server_gpu.web_service import WebService, Op +except ImportError: + from paddle_serving_server.web_service import WebService, Op import logging import numpy as np import cv2