Skip to content

Commit

Permalink
Update on "[aotinductor] Allow specifying a .so name in the aot_induc…
Browse files Browse the repository at this point in the history
…tor.output_path config"

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler

Differential Revision: [D50902585](https://our.internmc.facebook.com/intern/diff/D50902585)

[ghstack-poisoned]
  • Loading branch information
desertfire committed Nov 2, 2023
1 parent 02ec88f commit 9b189cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 0 additions & 1 deletion torch/_inductor/codecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,6 @@ def compile(
extra=cpp_command,
specified_dir=specified_output_path,
)
print(input_path)

if key not in cls.cache or (
specified_output_path
Expand Down
11 changes: 10 additions & 1 deletion torch/_inductor/compile_fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
)
from torch._dynamo.utils import detect_fake_mode, lazy_format_graph_code
from torch._functorch.aot_autograd import aot_export_module, make_boxed_func
from torch._inductor.codecache import CompiledFxGraph, FxGraphCache
from torch._inductor.codecache import code_hash, CompiledFxGraph, FxGraphCache

from torch._inductor.debug import save_args_for_compile_fx_inner
from torch._ops import OpOverload
Expand Down Expand Up @@ -892,6 +892,15 @@ def compile_fx_aot(
if config_patches is None
else {**config_patches, "cpp_wrapper": True}
)
if (
"aot_inductor.output_path" not in config_patches
and not config.aot_inductor.output_path
):
config_patches = {
**config_patches,
"aot_inductor.output_path": code_hash(model_.code),
}

extern_node_serializer = config_patches.pop("extern_node_serializer", None)
with V.set_aot_compilation(True):
compiled_lib_path = compile_fx(
Expand Down

0 comments on commit 9b189cf

Please sign in to comment.