[compile] Apply stored functorch config while finalizing loaded artifacts. (#36582)
Signed-off-by: zhxchen17 <zhxchen17@fb.com>
This commit is contained in:
@@ -369,8 +369,14 @@ class VllmSerializableFunction(SerializableCallable): # type: ignore[misc]
|
||||
|
||||
from vllm.compilation.backends import VllmBackend
|
||||
|
||||
saved_aot_autograd_config = self.aot_autograd_config
|
||||
if saved_aot_autograd_config is not None:
|
||||
functorch_ctx = torch._functorch.config.patch(saved_aot_autograd_config)
|
||||
else:
|
||||
functorch_ctx = contextlib.nullcontext()
|
||||
|
||||
vllm_backend = VllmBackend(vllm_config, self.prefix, self.is_encoder)
|
||||
with tracing(TracingContext(self._fake_mode)):
|
||||
with tracing(TracingContext(self._fake_mode)), functorch_ctx:
|
||||
result = vllm_backend(self.graph_module, list(self.example_inputs))
|
||||
self.optimized_call = result.optimized_call
|
||||
self.vllm_backend = vllm_backend
|
||||
|
||||
Reference in New Issue
Block a user