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
7b98a65a
Unverified
Commit
7b98a65a
authored
Jan 18, 2025
by
youkaichao
Committed by
GitHub
Jan 17, 2025
Browse files
[torch.compile] disable logging when cache is disabled (#12043)
Signed-off-by:
youkaichao
<
youkaichao@gmail.com
>
parent
b5b57e30
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
vllm/compilation/backends.py
vllm/compilation/backends.py
+21
-9
No files found.
vllm/compilation/backends.py
View file @
7b98a65a
...
...
@@ -251,15 +251,27 @@ def wrap_inductor(graph: fx.GraphModule,
def
_get_shape_env
()
->
AlwaysHitShapeEnv
:
return
AlwaysHitShapeEnv
()
with
patch
(
# for hijacking the hash of the compiled graph
"torch._inductor.codecache.compiled_fx_graph_hash"
,
hijack_compiled_fx_graph_hash
),
\
patch
(
# for providing a dummy shape environment
with
ExitStack
()
as
stack
:
if
not
cache_data
.
disabled
:
# compilation cache is enabled, patch several functions
# for hijacking the hash of the compiled graph
stack
.
enter_context
(
patch
(
"torch._inductor.codecache.compiled_fx_graph_hash"
,
hijack_compiled_fx_graph_hash
))
# for providing a dummy shape environment
stack
.
enter_context
(
patch
(
"torch._inductor.codecache.FxGraphCache._get_shape_env"
,
_get_shape_env
),
\
patch
(
# for forcing the graph to be cached
_get_shape_env
))
# for forcing the graph to be cached
stack
.
enter_context
(
patch
(
"torch._inductor.codecache.FxGraphCache._check_can_cache"
,
_check_can_cache
):
_check_can_cache
))
compiled_graph
=
compile_fx
(
graph
,
example_inputs
,
config_patches
=
current_config
)
...
...
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