Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rearrange metric enablement, so that model metric reporter can procee… #321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions src/tritonserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,25 @@ TRITONSERVER_ServerNew(
tc::Metrics::SetMetricsInterval(loptions->MetricsInterval());
tc::Metrics::SetConfigMap(loptions->MetricsConfigMap());
}

#ifdef TRITON_ENABLE_METRICS_GPU
if (loptions->Metrics() && loptions->GpuMetrics()) {
tc::Metrics::EnableGPUMetrics();
}
#endif // TRITON_ENABLE_METRICS_GPU

#ifdef TRITON_ENABLE_METRICS_CPU
if (loptions->Metrics() && loptions->CpuMetrics()) {
tc::Metrics::EnableCpuMetrics();
}
#endif // TRITON_ENABLE_METRICS_CPU

const bool poll_metrics = (loptions->GpuMetrics() || loptions->CpuMetrics());
if (loptions->Metrics() && poll_metrics) {
// Start thread to poll enabled metrics periodically
tc::Metrics::StartPollingThreadSingleton();
}

#endif // TRITON_ENABLE_METRICS

lserver->SetId(loptions->ServerId());
Expand Down Expand Up @@ -2376,27 +2395,6 @@ TRITONSERVER_ServerNew(
// Initialize server
tc::Status status = lserver->Init();

#ifdef TRITON_ENABLE_METRICS
#ifdef TRITON_ENABLE_METRICS_GPU
if (loptions->Metrics() && loptions->GpuMetrics()) {
tc::Metrics::EnableGPUMetrics();
}
#endif // TRITON_ENABLE_METRICS_GPU

#ifdef TRITON_ENABLE_METRICS_CPU
if (loptions->Metrics() && loptions->CpuMetrics()) {
tc::Metrics::EnableCpuMetrics();
}
#endif // TRITON_ENABLE_METRICS_CPU

const bool poll_metrics = (loptions->GpuMetrics() || loptions->CpuMetrics());
if (loptions->Metrics() && poll_metrics) {
// Start thread to poll enabled metrics periodically
tc::Metrics::StartPollingThreadSingleton();
}
#endif // TRITON_ENABLE_METRICS


// Setup tritonserver options table
std::vector<std::string> options_headers;
options_headers.emplace_back("Option");
Expand Down
Loading