A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 2, 14:45 UTC
Log dummy DP step in iteration details (#41406)
Signed-off-by: Vadim Gimpelson <vadim.gimpelson@gmail.com> Signed-off-by: Vadim Gimpelson <156319763+vadiklyutiy@users.noreply.github.com>
Vadim Gimpelson committed
May 28, 2026 at 16:18 UTC
c1c4db8b4b1f2178b2ca1e0638ff4cf39cf11cc5
1 file changed
+16
-4
vllm/v1/engine/core.py
+16
-4
@@ -81,7 +81,7 @@ from vllm.v1.outputs import ModelRunnerOutput
81
from vllm.v1.request import Request, RequestStatus
82
from vllm.v1.serial_utils import MsgpackDecoder, MsgpackEncoder
83
from vllm.v1.structured_output import StructuredOutputManager
84
-from vllm.v1.utils import compute_iteration_details
84
+from vllm.v1.utils import IterationDetails, compute_iteration_details
85
from vllm.version import __version__ as VLLM_VERSION
86
87
logger = init_logger(__name__)
@@ -396,12 +396,22 @@ class EngineCore:
396
raise err
397
398
@contextmanager
399
- def log_iteration_details(self, scheduler_output: SchedulerOutput):
399
+ def log_iteration_details(self, scheduler_output: SchedulerOutput | None):
400
if not self.vllm_config.observability_config.enable_logging_iteration_details:
401
yield
402
return
403
+ # 0-token step: let the dummy_batch wrapper log it (avoids double-log).
404
+ if scheduler_output and scheduler_output.total_num_scheduled_tokens == 0:
405
+ yield
406
+ return
407
self._iteration_index = getattr(self, "_iteration_index", 0)
404
- iteration_details = compute_iteration_details(scheduler_output)
408
+ # scheduler_output=None marks a DP dummy iteration.
409
+ if scheduler_output is None:
410
+ iteration_details = IterationDetails(0, 0, 0, 0)
411
+ is_dummy = True
412
+ else:
413
+ iteration_details = compute_iteration_details(scheduler_output)
414
+ is_dummy = False
415
before = time.monotonic()
416
yield
417
logger.info(
@@ -420,6 +430,7 @@ class EngineCore:
430
" generation tokens, iteration elapsed time: ",
431
format((time.monotonic() - before) * 1000, ".2f"),
432
" ms",
433
+ " (dummy)" if is_dummy else "",
434
]
435
)
436
)
@@ -1855,7 +1866,8 @@ class DPEngineCoreProc(EngineCoreProc):
1866
1867
# We are in a running state and so must execute a dummy pass
1868
# if the model didn't execute any ready requests.
1858
- self.execute_dummy_batch()
1869
+ with self.log_iteration_details(None):
1870
+ self.execute_dummy_batch()
1871
1872
# 3) All-reduce operation to determine global unfinished reqs.
1873
self.engines_running = self._has_global_unfinished_reqs(