From 5735cbb9d211bbbf0f8a082b4f23abd4579c226b Mon Sep 17 00:00:00 2001 From: MRXLT Date: Wed, 1 Jul 2020 11:18:12 +0800 Subject: [PATCH] fix benchmakr --- python/examples/criteo_ctr_with_cube/benchmark.py | 2 +- python/examples/criteo_ctr_with_cube/benchmark.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python/examples/criteo_ctr_with_cube/benchmark.py b/python/examples/criteo_ctr_with_cube/benchmark.py index df5c6b90..a850d244 100755 --- a/python/examples/criteo_ctr_with_cube/benchmark.py +++ b/python/examples/criteo_ctr_with_cube/benchmark.py @@ -46,7 +46,7 @@ def single_func(idx, resource): start = time.time() itr = 1000 for ei in range(itr): - if args.batch_size > 1: + if args.batch_size > 0: feed_batch = [] for bi in range(args.batch_size): data = reader().next() diff --git a/python/examples/criteo_ctr_with_cube/benchmark.sh b/python/examples/criteo_ctr_with_cube/benchmark.sh index a7f927e1..35b19b63 100755 --- a/python/examples/criteo_ctr_with_cube/benchmark.sh +++ b/python/examples/criteo_ctr_with_cube/benchmark.sh @@ -1,9 +1,13 @@ rm profile_log +export FLAGS_profile_client=1 +export FLAGS_profile_server=1 for thread_num in 1 2 4 8 16 do -for batch_size in 1 2 4 8 16 32 64 128 256 512 +for batch_size in 1 4 16 64 256 do $PYTHONROOT/bin/python benchmark.py --thread $thread_num --batch_size $batch_size --model serving_client_conf/serving_client_conf.prototxt --request rpc > profile 2>&1 + echo "batch size : $batch_size" + echo "thread num : $thread_num" echo "========================================" echo "batch size : $batch_size" >> profile_log $PYTHONROOT/bin/python ../util/show_profile.py profile $thread_num >> profile_log -- GitLab