Skip to content

Commit a9ea8b4

Browse files
Migrate from capture_pre_autograd_graph to torch.export.export_for_training (#6103)
Migrate from capture_pre_autograd_graph to torch.export.export_for_training (#5730) Summary: Pull Request resolved: #5730 As titled. The `capture_pre_autograd_graph` API is deprecated. Reviewed By: hsharma35 Differential Revision: D63541800 fbshipit-source-id: 7b830ae55a5dff8bf61be0470f54302c2ab461d8 (cherry picked from commit b4a6148) Co-authored-by: Matthias Cremon <[email protected]>
1 parent 40358fa commit a9ea8b4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

backends/cadence/aot/compiler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
)
3131
from executorch.backends.transforms.remove_clone_ops import RemoveCloneOpsTransform
3232
from executorch.exir import EdgeCompileConfig, EdgeProgramManager, to_edge
33-
from torch._export import capture_pre_autograd_graph
3433
from torch.ao.quantization.pt2e.export_utils import model_is_exported
3534
from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_pt2e
3635

@@ -58,7 +57,7 @@ def convert_pt2(
5857
"""
5958

6059
# Export with dynamo
61-
model_gm = capture_pre_autograd_graph(model, inputs)
60+
model_gm = torch.export.export_for_training(model, inputs).module()
6261

6362
if model_gm_has_SDPA(model_gm): # pyre-fixme[6]
6463
# Decompose SDPA

0 commit comments

Comments
 (0)