Skip to content

Commit

Permalink
Migrate from capture_pre_autograd_graph to torch.export.export_for_tr…
Browse files Browse the repository at this point in the history
…aining (#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 <matthiascremon@meta.com>
  • Loading branch information
pytorchbot and mcremon-meta authored Oct 10, 2024
1 parent 40358fa commit a9ea8b4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backends/cadence/aot/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
)
from executorch.backends.transforms.remove_clone_ops import RemoveCloneOpsTransform
from executorch.exir import EdgeCompileConfig, EdgeProgramManager, to_edge
from torch._export import capture_pre_autograd_graph
from torch.ao.quantization.pt2e.export_utils import model_is_exported
from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_pt2e

Expand Down Expand Up @@ -58,7 +57,7 @@ def convert_pt2(
"""

# Export with dynamo
model_gm = capture_pre_autograd_graph(model, inputs)
model_gm = torch.export.export_for_training(model, inputs).module()

if model_gm_has_SDPA(model_gm): # pyre-fixme[6]
# Decompose SDPA
Expand Down

0 comments on commit a9ea8b4

Please sign in to comment.