[Deprecation] Deprecate cprofile and cprofile_context (#39100)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
@@ -8,7 +8,13 @@ from collections.abc import Callable
|
||||
from functools import wraps
|
||||
from typing import Any
|
||||
|
||||
from typing_extensions import deprecated
|
||||
|
||||
|
||||
@deprecated(
|
||||
"vllm.utils.profiling.cprofile_context() is deprecated and will be removed "
|
||||
"in v0.21. Use Python's cProfile module directly instead."
|
||||
)
|
||||
@contextlib.contextmanager
|
||||
def cprofile_context(save_file: str | None = None):
|
||||
"""Run a cprofile
|
||||
@@ -32,6 +38,10 @@ def cprofile_context(save_file: str | None = None):
|
||||
prof.print_stats(sort="cumtime")
|
||||
|
||||
|
||||
@deprecated(
|
||||
"vllm.utils.profiling.cprofile() is deprecated and will be removed in "
|
||||
"v0.21. Use Python's cProfile module directly instead."
|
||||
)
|
||||
def cprofile(save_file: str | None = None, enabled: bool = True):
|
||||
"""Decorator to profile a Python method using cProfile.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user