SIGN IN SIGN UP

Get export APIs ready for PTC (#566)

Summary:
X-link: https://github.com/pytorch/pytorch/pull/110410

Pull Request resolved: https://github.com/pytorch/executorch/pull/566

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: larryliu0820, guangy10

Differential Revision: D49742989

fbshipit-source-id: e2d2d872b55b227857261886bb8216794ee81489
A
Angela Yi committed
a4a86df82d512db7c3784b0e1e183f953ce640ee
Parent: c73fea8
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 10/11/2023, 6:03:00 AM