Skip to content

Commit 94b80cd

Browse files
committed
Move metrics enable check to initialize()
1 parent 96cece2 commit 94b80cd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/model.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ def initialize(self, args):
172172
)
173173
self._is_healthy = True
174174

175+
# Check if metrics are enabled. The ZMQ process cannot be used when metrics are
176+
# enabled.
177+
self._enable_metrics = (
178+
self._get_bool_config_param("REPORT_CUSTOM_METRICS")
179+
and not self._aync_engine_args.disable_log_stats
180+
)
181+
175182
# Starting the vLLM engine and its event thread running the AsyncIO event loop.
176183
self._init_engine()
177184

@@ -238,16 +245,10 @@ async def _run_llm_engine(self):
238245
# Counter to keep track of ongoing request counts.
239246
self._ongoing_request_count = 0
240247

241-
# Check if metrics are enabled. The ZMQ process cannot be used when metrics are
242-
# enabled.
243-
self._enable_metrics = (
244-
self._get_bool_config_param("REPORT_CUSTOM_METRICS")
245-
and not self._aync_engine_args.disable_log_stats
246-
)
247-
248248
try:
249249
# Start the vLLM engine. The engine lives for the scope of this with
250250
# statement.
251+
# TODO: Metrics should work with ZMQ enabled.
251252
async with build_async_engine_client_from_engine_args(
252253
engine_args=self._aync_engine_args,
253254
disable_frontend_multiprocessing=self._enable_metrics,

0 commit comments

Comments
 (0)