Skip to content

Commit

Permalink
Fix perf_status initialization and only add profile measurements for …
Browse files Browse the repository at this point in the history
…stable runs (#285)
  • Loading branch information
debermudez authored Apr 12, 2023
1 parent 19ef9f9 commit adcbc4a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/c++/perf_analyzer/inference_profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ InferenceProfiler::Profile(
bool& is_stable)
{
cb::Error err;
PerfStatus perf_status;
PerfStatus perf_status{};

perf_status.concurrency = concurrent_request_count;

Expand All @@ -535,7 +535,6 @@ InferenceProfiler::Profile(

err = ProfileHelper(perf_status, &is_stable);
if (err.IsOk()) {
perf_statuses.push_back(perf_status);
uint64_t stabilizing_latency_ms =
perf_status.stabilizing_latency_ns / NANOS_PER_MILLIS;
if ((stabilizing_latency_ms >= latency_threshold_ms_) &&
Expand All @@ -557,6 +556,7 @@ InferenceProfiler::Profile(
}
meets_threshold = false;
} else {
perf_statuses.push_back(perf_status);
err = Report(
perf_status, percentile_, protocol_, verbose_, include_lib_stats_,
include_server_stats_, parser_, should_collect_metrics_,
Expand All @@ -579,7 +579,7 @@ InferenceProfiler::Profile(
bool& meets_threshold, bool& is_stable)
{
cb::Error err;
PerfStatus perf_status;
PerfStatus perf_status{};

perf_status.request_rate = request_rate;

Expand All @@ -593,7 +593,6 @@ InferenceProfiler::Profile(

err = ProfileHelper(perf_status, &is_stable);
if (err.IsOk()) {
perf_statuses.push_back(perf_status);
uint64_t stabilizing_latency_ms =
perf_status.stabilizing_latency_ns / NANOS_PER_MILLIS;
if ((stabilizing_latency_ms >= latency_threshold_ms_) &&
Expand All @@ -605,6 +604,7 @@ InferenceProfiler::Profile(
std::cerr << "Failed to obtain stable measurement." << std::endl;
meets_threshold = false;
} else {
perf_statuses.push_back(perf_status);
err = Report(
perf_status, percentile_, protocol_, verbose_, include_lib_stats_,
include_server_stats_, parser_, should_collect_metrics_,
Expand All @@ -627,7 +627,7 @@ InferenceProfiler::Profile(
bool& is_stable)
{
cb::Error err;
PerfStatus perf_status;
PerfStatus perf_status{};

RETURN_IF_ERROR(
dynamic_cast<CustomLoadManager*>(manager_.get())->InitCustomIntervals());
Expand All @@ -639,7 +639,6 @@ InferenceProfiler::Profile(

err = ProfileHelper(perf_status, &is_stable);
if (err.IsOk()) {
perf_statuses.push_back(perf_status);
uint64_t stabilizing_latency_ms =
perf_status.stabilizing_latency_ns / NANOS_PER_MILLIS;
if ((stabilizing_latency_ms >= latency_threshold_ms_) &&
Expand All @@ -651,6 +650,7 @@ InferenceProfiler::Profile(
std::cerr << "Failed to obtain stable measurement." << std::endl;
meets_threshold = false;
} else {
perf_statuses.push_back(perf_status);
err = Report(
perf_status, percentile_, protocol_, verbose_, include_lib_stats_,
include_server_stats_, parser_, should_collect_metrics_,
Expand Down

0 comments on commit adcbc4a

Please sign in to comment.