Get export APIs ready for PTC (reland) (#835)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/835 https://docs.google.com/document/d/1QJJEGnj2nHGPODlw38BEG3KLLCOTfdOVjPrNQbz_LM8/edit#bookmark=id.lp80wfshq130 Changes: * `torch.export` will return a functional ATen graph but not lowered to core aten decompositions (CompositeImplicitAutograd decomps still run) * `exported_program.run_decompositions(decomposition_table)` will optionally take a decomposition table, and run decompositions on the exported program, returning a new exported program. By default we will run the Core ATen decomposition table. Calling convention for Executorch stays the same: ``` pre_autograd_graph = capture_pre_autograd_graph(f, args, ...) aten_graph_no_decomps = torch.export.export(pre_autograd_graph, args, ...) # Within to_edge we decompose to core aten and then convert to edge edge_graph = exir.to_edge(aten_graph_no_decomps) ``` bypass-github-export-checks Reviewed By: ydwu4 Differential Revision: D50172210 fbshipit-source-id: 753819e28f5e350bb0d5fa89d4ac2d8ccbf88f21
A
Angela Yi committed
9833feb357e7a74c3988401d86c73f8d0d4333cf
Parent: bc17c52
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 10/11/2023, 8:41:15 PM