File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -463,7 +463,7 @@ def visualize_per_worker_timeline(
463463 zero_marker = "▁"
464464 # marker = {0: "□", 1: "⧅", 2: "⛝", 3: "■"}
465465
466- max_value = max (max (v ) for v in metric_dict .values ())
466+ max_value = max (( max (v ) if v else 0 ) for v in metric_dict .values ())
467467 bin_width = (max_value + 1 ) / len (marker )
468468
469469 print (f" - { metric_name } :" )
@@ -521,7 +521,8 @@ def visualize_per_worker_timeline(
521521 vllm_metrics_logger_interval ,
522522 )
523523 max_num_pending_samples = max (
524- max (v ) for v in vllm_logger_metrics ["num_pending_samples" ].values ()
524+ (max (v ) if v else 0 )
525+ for v in vllm_logger_metrics ["num_pending_samples" ].values ()
525526 )
526527 # If there is at least one pending sample, visualize the timeline
527528 if max_num_pending_samples > 0 :
Original file line number Diff line number Diff line change @@ -332,6 +332,9 @@ def _patch_vllm_init_workers_ray():
332332 # Optionally start periodic vLLM metrics logging if the flag is set
333333 # NOTE: vLLM metrics logger is only supported with async engine enabled
334334 # Metrics logger only enabled for per-actor, model-owner only
335+ # Thread synchronization for metrics access
336+ self ._vllm_metrics_lock = threading .Lock ()
337+
335338 if self .cfg ["vllm_cfg" ].get ("enable_vllm_metrics_logger" , False ) and self .cfg [
336339 "vllm_cfg"
337340 ].get ("async_engine" , False ):
@@ -366,9 +369,6 @@ def _start_vllm_metrics_logger(self) -> None:
366369 stop_event = threading .Event ()
367370 self ._vllm_metrics_logger_stop_event = stop_event
368371
369- # Thread synchronization for metrics access
370- self ._vllm_metrics_lock = threading .Lock ()
371-
372372 self .inflight_batch_sizes : list [int ] = []
373373 self .num_pending_samples : list [int ] = []
374374
You can’t perform that action at this time.
0 commit comments