Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
301024aa
Unverified
Commit
301024aa
authored
Apr 20, 2026
by
Wentao Ye
Committed by
GitHub
Apr 21, 2026
Browse files
[Deprecation] Deprecate cprofile and cprofile_context (#39100)
Signed-off-by:
yewentao256
<
zhyanwentao@126.com
>
parent
8256833f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
docs/contributing/profiling.md
docs/contributing/profiling.md
+2
-2
vllm/utils/profiling.py
vllm/utils/profiling.py
+10
-0
No files found.
docs/contributing/profiling.md
View file @
301024aa
...
...
@@ -206,8 +206,8 @@ Both the `vllm.utils.profiling.cprofile` and `vllm.utils.profiling.cprofile_cont
used to profile a section of code.
!!! note
The
legacy import paths
`vllm.utils.
c
profil
e`
and
`vllm.utils.cprofile_context`
are deprecated.
Please use
`vllm.utils.profiling.cprofile`
and
`vllm.utils.profiling.cprofile_context`
instead.
The
`vllm.utils.profil
ing`
helpers are deprecated and will be removed in
`v0.21`
.
Please use
Python's
`cProfile`
module directly
instead.
### Example usage - decorator
...
...
vllm/utils/profiling.py
View file @
301024aa
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment