From 2985c2c290305bdb5ffa74b1a650a36e44113483 Mon Sep 17 00:00:00 2001 From: wangguibao Date: Sun, 29 Sep 2019 19:50:13 +0800 Subject: [PATCH] CTR prediction profiling --- demo-client/src/ctr_prediction.cpp | 2 +- demo-serving/op/ctr_prediction_op.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/demo-client/src/ctr_prediction.cpp b/demo-client/src/ctr_prediction.cpp index 73bf029f..92e82a36 100644 --- a/demo-client/src/ctr_prediction.cpp +++ b/demo-client/src/ctr_prediction.cpp @@ -38,7 +38,7 @@ DEFINE_int32(batch_size, 50, "Set the batch size of test file."); DEFINE_int32(concurrency, 1, "Set the max concurrency of requests"); DEFINE_int32(repeat, 1, "Number of data samples iteration count. Default 1"); DEFINE_bool(enable_profiling, - true, + false, "Enable profiling. Will supress a lot normal output"); std::vector cont_min = {0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; diff --git a/demo-serving/op/ctr_prediction_op.cpp b/demo-serving/op/ctr_prediction_op.cpp index 274db260..b2166819 100644 --- a/demo-serving/op/ctr_prediction_op.cpp +++ b/demo-serving/op/ctr_prediction_op.cpp @@ -164,8 +164,12 @@ int CTRPredictionOp::inference() { LOG(INFO) << "Cube request count: " << cube_req_num_; LOG(INFO) << "Cube request key count: " << cube_req_key_num_; LOG(INFO) << "Cube request total time: " << cube_time_us_ << "us"; - LOG(INFO) << "Average " << cube_time_us_ / cube_req_num_ << "us/req"; - LOG(INFO) << "Average " << cube_time_us_ / cube_req_key_num_ << "us/key"; + LOG(INFO) << "Average " + << static_cast(cube_time_us_) / cube_req_num_ + << "us/req"; + LOG(INFO) << "Average " + << static_cast(cube_time_us_) / cube_req_key_num_ + << "us/key"; cube_time_us_ = 0; cube_req_num_ = 0; -- GitLab