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 12, 22:15 UTC
[GC Debugger] Simply and improve GC Debugger Utils (#29029)
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Jialin Ouyang committed
Nov 19, 2025 at 16:10 UTC
537cc635c77ac63f643c5289137debdd8f9591ac
2 files changed
+6
-6
vllm/utils/gc_utils.py
+4
-3
@@ -68,9 +68,10 @@ class GCDebugger:
68
# Before GC started, record GC start time
69
# and top collected objects
70
self.start_time_ns = time.monotonic_ns()
71
- self.gc_top_collected_objects = _compute_top_gc_collected_objects(
72
- gc.get_objects(generation), self.config.top_objects
73
- )
71
+ if (top_objects := self.config.top_objects) > 0:
72
+ self.gc_top_collected_objects = _compute_top_gc_collected_objects(
73
+ gc.get_objects(generation), top_objects
74
+ )
75
elif phase == "stop":
76
# After GC finished, Record GC elapsed time and
77
# optionally top collected objects
vllm/v1/engine/core.py
+2
-3
@@ -206,6 +206,8 @@ class EngineCore:
206
# Mark the startup heap as static so that it's ignored by GC.
207
# Reduces pause times of oldest generation collections.
208
freeze_gc_heap()
209
+ # If enable, attach GC debugger after static variable freeze.
210
+ maybe_attach_gc_debug_callback()
211
212
def _initialize_kv_caches(
213
self, vllm_config: VllmConfig
@@ -645,9 +647,6 @@ class EngineCoreProc(EngineCore):
647
assert addresses.coordinator_input is not None
648
logger.info("Waiting for READY message from DP Coordinator...")
649
648
- # If enable, attach GC debugger after static variable freeze.
649
- maybe_attach_gc_debug_callback()
650
-
650
# Enable environment variable cache (e.g. assume no more
651
# environment variable overrides after this point)
652
enable_envs_cache()