This repository was archived by the owner on Sep 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
+ from typing import Callable , Optional , Union
2
3
3
4
import vllm .envs as envs
4
5
@@ -29,3 +30,15 @@ def load_general_plugins():
29
30
except Exception :
30
31
logger .exception ("Failed to load general plugin: %s" ,
31
32
plugin .name )
33
+
34
+
35
+ _torch_compile_backend : Optional [Union [Callable , str ]] = None
36
+
37
+
38
+ def set_torch_compile_backend (backend : Union [Callable , str ]):
39
+ global _torch_compile_backend
40
+ _torch_compile_backend = backend
41
+
42
+
43
+ def get_torch_compile_backend () -> Optional [Union [Callable , str ]]:
44
+ return _torch_compile_backend
Original file line number Diff line number Diff line change @@ -1064,10 +1064,12 @@ def load_model(self) -> None:
1064
1064
"This may lead to less accurate results!" )
1065
1065
1066
1066
if envs .VLLM_TEST_DYNAMO_GRAPH_CAPTURE and supports_dynamo ():
1067
+ from vllm .plugins import get_torch_compile_backend
1068
+ backend = get_torch_compile_backend () or "eager"
1067
1069
self .model = torch .compile (
1068
1070
self .model ,
1069
1071
fullgraph = envs .VLLM_TEST_DYNAMO_FULLGRAPH_CAPTURE ,
1070
- backend = "eager" )
1072
+ backend = backend )
1071
1073
1072
1074
def save_sharded_state (
1073
1075
self ,
You can’t perform that action at this time.
0 commit comments