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
92fea56f
Unverified
Commit
92fea56f
authored
Dec 11, 2025
by
Zhengxu Chen
Committed by
GitHub
Dec 11, 2025
Browse files
[compile] Stop one-off setting enable_aot_compile and use context manager instead. (#30503)
Signed-off-by:
zhxchen17
<
zhxchen17@fb.com
>
parent
e458270a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
vllm/compilation/wrapper.py
vllm/compilation/wrapper.py
+10
-8
No files found.
vllm/compilation/wrapper.py
View file @
92fea56f
...
@@ -171,22 +171,24 @@ class TorchCompileWithNoGuardsWrapper:
...
@@ -171,22 +171,24 @@ class TorchCompileWithNoGuardsWrapper:
compiled_ptr
=
self
.
check_invariants_and_forward
compiled_ptr
=
self
.
check_invariants_and_forward
aot_context
=
nullcontext
()
if
envs
.
VLLM_USE_AOT_COMPILE
:
if
envs
.
VLLM_USE_AOT_COMPILE
:
if
hasattr
(
torch
.
_dynamo
.
config
,
"enable_aot_compile"
):
if
hasattr
(
torch
.
_dynamo
.
config
,
"enable_aot_compile"
):
torch
.
_dynamo
.
config
.
enable_aot_compile
=
True
aot_context
=
torch
.
_dynamo
.
config
.
patch
(
enable_aot_compile
=
True
)
else
:
else
:
msg
=
"torch._dynamo.config.enable_aot_compile is not "
msg
=
"torch._dynamo.config.enable_aot_compile is not "
msg
+=
"available. AOT compile is disabled and please "
msg
+=
"available. AOT compile is disabled and please "
msg
+=
"upgrade PyTorch version to use AOT compile."
msg
+=
"upgrade PyTorch version to use AOT compile."
logger
.
warning
(
msg
)
logger
.
warning
(
msg
)
self
.
_compiled_callable
=
torch
.
compile
(
with
aot_context
:
compiled_ptr
,
self
.
_compiled_callable
=
torch
.
compile
(
fullgraph
=
True
,
compiled_ptr
,
dynamic
=
False
,
fullgraph
=
True
,
backend
=
backend
,
dynamic
=
False
,
options
=
options
,
backend
=
backend
,
)
options
=
options
,
)
if
envs
.
VLLM_USE_BYTECODE_HOOK
and
mode
!=
CompilationMode
.
STOCK_TORCH_COMPILE
:
if
envs
.
VLLM_USE_BYTECODE_HOOK
and
mode
!=
CompilationMode
.
STOCK_TORCH_COMPILE
:
torch
.
_dynamo
.
convert_frame
.
register_bytecode_hook
(
self
.
bytecode_hook
)
torch
.
_dynamo
.
convert_frame
.
register_bytecode_hook
(
self
.
bytecode_hook
)
...
...
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