Unverified Commit 537cc635 authored by Jialin Ouyang's avatar Jialin Ouyang Committed by GitHub
Browse files

[GC Debugger] Simply and improve GC Debugger Utils (#29029)


Signed-off-by: default avatarJialin Ouyang <Jialin.Ouyang@gmail.com>
parent 5031cd5d
...@@ -68,9 +68,10 @@ class GCDebugger: ...@@ -68,9 +68,10 @@ class GCDebugger:
# Before GC started, record GC start time # Before GC started, record GC start time
# and top collected objects # and top collected objects
self.start_time_ns = time.monotonic_ns() self.start_time_ns = time.monotonic_ns()
self.gc_top_collected_objects = _compute_top_gc_collected_objects( if (top_objects := self.config.top_objects) > 0:
gc.get_objects(generation), self.config.top_objects self.gc_top_collected_objects = _compute_top_gc_collected_objects(
) gc.get_objects(generation), top_objects
)
elif phase == "stop": elif phase == "stop":
# After GC finished, Record GC elapsed time and # After GC finished, Record GC elapsed time and
# optionally top collected objects # optionally top collected objects
......
...@@ -206,6 +206,8 @@ class EngineCore: ...@@ -206,6 +206,8 @@ class EngineCore:
# Mark the startup heap as static so that it's ignored by GC. # Mark the startup heap as static so that it's ignored by GC.
# Reduces pause times of oldest generation collections. # Reduces pause times of oldest generation collections.
freeze_gc_heap() freeze_gc_heap()
# If enable, attach GC debugger after static variable freeze.
maybe_attach_gc_debug_callback()
def _initialize_kv_caches( def _initialize_kv_caches(
self, vllm_config: VllmConfig self, vllm_config: VllmConfig
...@@ -645,9 +647,6 @@ class EngineCoreProc(EngineCore): ...@@ -645,9 +647,6 @@ class EngineCoreProc(EngineCore):
assert addresses.coordinator_input is not None assert addresses.coordinator_input is not None
logger.info("Waiting for READY message from DP Coordinator...") logger.info("Waiting for READY message from DP Coordinator...")
# If enable, attach GC debugger after static variable freeze.
maybe_attach_gc_debug_callback()
# Enable environment variable cache (e.g. assume no more # Enable environment variable cache (e.g. assume no more
# environment variable overrides after this point) # environment variable overrides after this point)
enable_envs_cache() enable_envs_cache()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment