55
66import torch .nn as nn
77
8- from vllm .config import get_current_vllm_config
8+ from vllm .config import get_cached_compilation_config
99from vllm .logger import init_logger
1010from vllm .platforms import current_platform
1111
@@ -86,7 +86,7 @@ def forward_oot(self, *args, **kwargs):
8686 def dispatch_forward (self ):
8787 # NOTE(woosuk): Here we assume that vLLM was built for only one
8888 # specific backend. Currently, we do not support dynamic dispatching.
89- compilation_config = get_current_vllm_config (). compilation_config
89+ compilation_config = get_cached_compilation_config ()
9090 enabled = self .enabled ()
9191 if enabled :
9292 compilation_config .enabled_custom_ops .update ([self .__class__ .name ])
@@ -115,7 +115,7 @@ def dispatch_forward(self):
115115 @classmethod
116116 def enabled (cls ) -> bool :
117117 # if no name, then it was not registered
118- compilation_config = get_current_vllm_config (). compilation_config
118+ compilation_config = get_cached_compilation_config ()
119119 custom_ops = compilation_config .custom_ops
120120 if not hasattr (cls , "name" ):
121121 logger .warning_once (
@@ -138,7 +138,7 @@ def default_on() -> bool:
138138 Specifying 'all' or 'none' in custom_op takes precedence.
139139 """
140140 from vllm .config import CompilationLevel
141- compilation_config = get_current_vllm_config (). compilation_config
141+ compilation_config = get_cached_compilation_config ()
142142 default_on = (compilation_config .level < CompilationLevel .PIECEWISE
143143 or not compilation_config .use_inductor )
144144 count_none = compilation_config .custom_ops .count ("none" )
0 commit comments