AOT Compilation for torch.compile (Bundled) (#24274)

Signed-off-by: zhxchen17 <zhxchen17@fb.com>
This commit is contained in:
Zhengxu Chen
2025-10-10 19:02:11 -04:00
committed by GitHub
parent e317414ce1
commit eef921f45e
9 changed files with 484 additions and 41 deletions

View File

@@ -199,6 +199,7 @@ class InductorStandaloneAdaptor(CompilerInterface):
if compiler_config is not None:
current_config.update(compiler_config)
set_inductor_config(current_config, runtime_shape)
set_functorch_config()
if isinstance(runtime_shape, int):
dynamic_shapes = "from_example_inputs"
@@ -307,6 +308,7 @@ class InductorAdaptor(CompilerInterface):
current_config["fx_graph_remote_cache"] = False
set_inductor_config(current_config, runtime_shape)
set_functorch_config()
# inductor can inplace modify the graph, so we need to copy it
# see https://github.com/pytorch/pytorch/issues/138980
@@ -596,6 +598,10 @@ def set_inductor_config(config, runtime_shape):
)
def set_functorch_config():
torch._functorch.config.bundled_autograd_cache = False
class EagerAdaptor(CompilerInterface):
name = "eager"