[Perf] Move gc.freeze logic from EngineCoreProc to EngineCore for better coverage (#27896)

Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
This commit is contained in:
Jialin Ouyang
2025-11-10 15:34:18 -08:00
committed by GitHub
parent d17ecc6b19
commit b30372cbd0
5 changed files with 30 additions and 14 deletions
+2 -3
View File
@@ -19,7 +19,6 @@ On the client side, run:
import argparse
import asyncio
import contextlib
import gc
import importlib.util
import json
import os
@@ -49,6 +48,7 @@ from vllm.benchmarks.lib.endpoint_request_func import (
from vllm.benchmarks.lib.ready_checker import wait_for_endpoint
from vllm.benchmarks.lib.utils import convert_to_pytorch_benchmark_format, write_to_json
from vllm.transformers_utils.tokenizer import get_tokenizer
from vllm.utils.gc_utils import freeze_gc_heap
MILLISECONDS_TO_SECONDS_CONVERSION = 1000
@@ -1414,8 +1414,7 @@ async def main_async(args: argparse.Namespace) -> dict[str, Any]:
percentile_metrics: str = args.percentile_metrics or default_percentile_metrics
# Avoid GC processing "static" data - reduce pause times.
gc.collect()
gc.freeze()
freeze_gc_heap()
benchmark_result = await benchmark(
task_type=task_type,