diff --git a/python/examples/criteo_ctr_with_cube/benchmark.py b/python/examples/criteo_ctr_with_cube/benchmark.py index df5c6b90badb36fd7e349555973ccbd7ea0a8b70..a850d244b0a5a1a01e98a6207fa9674b6ea0af1a 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 a7f927e186dd98e6f04de96d37bee7dd7b62359b..35b19b637d9e8dec10fd3b59224c5c17e3ba5f53 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