Skip to content

Commit

Permalink
Fix "metrics not supported error" when building with TRITON_ENABLE_ME…
Browse files Browse the repository at this point in the history
…TRICS=OFF flag
  • Loading branch information
yinggeh committed Aug 8, 2024
1 parent 1393d6e commit 6404f14
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/pb_stub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,24 @@ Stub::Initialize(bi::managed_external_buffer::handle_t map_handle)
model_config_params[pair.first.c_str()] = pair.second;
}

// Set metrics_mode value based on the build flag.
#ifdef TRITON_ENABLE_METRICS
#if defined(TRITON_ENABLE_METRICS_CPU) && defined(TRITON_ENABLE_METRICS_GPU)
model_config_params["metrics_mode"] = "all";
#else // defined(TRITON_ENABLE_METRICS_CPU) &&
// defined(TRITON_ENABLE_METRICS_GPU)
#ifdef TRITON_ENABLE_METRICS_CPU
model_config_params["metrics_mode"] = "cpu";
#endif // TRITON_ENABLE_METRICS_CPU
#ifdef TRITON_ENABLE_METRICS_GPU
model_config_params["metrics_mode"] = "gpu";
#endif // TRITON_ENABLE_METRICS_GPU
#endif // defined(TRITON_ENABLE_METRICS_CPU) &&
// defined(TRITON_ENABLE_METRICS_GPU)
#else // TRITON_ENABLE_METRICS
model_config_params["metrics_mode"] = "off";
#endif // TRITON_ENABLE_METRICS

LaunchStubToParentQueueMonitor();
LaunchParentToStubQueueMonitor();

Expand Down

0 comments on commit 6404f14

Please sign in to comment.