Skip to content

Commit 8da26a9

Browse files
angelayisvekars
andauthored
[export] Remove interactive aoti compilation (#2835)
* [export] Remove interactive aoti compilation --------- Co-authored-by: Svetlana Karslioglu <[email protected]>
1 parent f00c86d commit 8da26a9

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

intermediate_source/torch_export_tutorial.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ def forward(self, x):
513513
# the ~2000 operators.
514514
#
515515
# .. code-block:: python
516+
#
516517
# def run_decompositions(
517518
# self: ExportedProgram,
518519
# decomposition_table: Optional[Dict[torch._ops.OperatorBase, Callable]]
@@ -646,18 +647,21 @@ def forward(self, x):
646647
res = torch.compile(ep.module(), backend="inductor")(inp)
647648
print(res)
648649

649-
import torch._export
650-
import torch._inductor
651-
652-
# Note: these APIs are subject to change
653-
# Compile the exported program to a .so using AOTInductor
654-
with torch.no_grad():
655-
so_path = torch._inductor.aot_compile(ep.module(), [inp])
656-
# Load and run the .so file in Python.
657-
# To load and run it in a C++ environment, see:
658-
# https://pytorch.org/docs/main/torch.compiler_aot_inductor.html
659-
res = torch._export.aot_load(so_path, device="cuda")(inp)
660-
print(res)
650+
######################################################################
651+
# .. code-block:: python
652+
#
653+
# import torch._export
654+
# import torch._inductor
655+
#
656+
# # Note: these APIs are subject to change
657+
# # Compile the exported program to a .so using ``AOTInductor``
658+
# with torch.no_grad():
659+
# so_path = torch._inductor.aot_compile(ep.module(), [inp])
660+
#
661+
# # Load and run the .so file in Python.
662+
# # To load and run it in a C++ environment, see:
663+
# # https://pytorch.org/docs/main/torch.compiler_aot_inductor.html
664+
# res = torch._export.aot_load(so_path, device="cuda")(inp)
661665

662666
######################################################################
663667
# Conclusion

0 commit comments

Comments
 (0)