Skip to content

Delete deprecated exir.capture API - #23592

Open
krisnaparahita wants to merge 4 commits into
pytorch:mainfrom
krisnaparahita:delete-exir-capture
Open

krisnaparahita wants to merge 4 commits into
pytorch:mainfrom
krisnaparahita:delete-exir-capture

Conversation

@krisnaparahita

@krisnaparahita krisnaparahita commented Oct 8, 2026 •

Copy link
Copy Markdown

Summary

Fixes #18125.

The issue explicitly requests deletion of the already-deprecated exir.capture API. This intentionally removes that public API, its legacy entry point, CallSpec, and CaptureConfig; external callers that still import them must migrate to torch.export.export and exir.to_edge.

Delete the obsolete capture and unlift implementations while retaining EdgeCompileConfig and ExecutorchBackendConfig. Preserve patch_forward unchanged in _utils, update its callers and Buck target, migrate the two pass-manager tests to torch.export.export plus to_edge, and update documentation examples. The migrated tests retain the original pass transformations, modified/result-type assertions, and invalid call_method rejection assertion.

Test plan

  • Reviewed the complete 14-file diff (+57/-611). Repository-wide tracked-file searches, a hidden/ignored-file search outside .git, and Python AST import inspection found no dangling imports, calls, re-exports, or build references to the deleted APIs/modules. Remaining textual mentions are comments; imports of the retained config classes remain valid.
  • python3 -m py_compile on all nine added/modified Python files: passed.
  • git diff --check upstream/main...HEAD: passed.
  • PATH=/tmp/executorch-review-venv/bin:$PATH lintrunner --data-path /tmp/executorch-review-lint -m upstream/main --skip MYPY: passed, using the repository's Flake8/plugins and UFMT (Black/usort) versions. The changed paths are outside the configured MYPY and Ruff-docstring scopes. An additional unscoped Ruff-docstring run reported legacy docstring findings; it is not a configured check for these paths.
  • PYTHONPATH=src python -m unittest executorch.exir.tests.test_pass_infra: all 23 tests passed, including both migrated tests.
  • A direct patch_forward smoke check verified replacement and restoration of forward, including restoration when the context raises: passed.

Local verification limitation: the development sandbox initially had no torch environment, so the previous assessment could not test-run this locally. For this review, pip install torch --index-url https://download.pytorch.org/whl/cpu succeeded in an isolated temporary environment (PyTorch 2.14.1+cpu), allowing the limited Python tests above. The full ExecuTorch development/native runtime environment was not provisioned. A targeted memory-planning test could not even import because parameterized was missing; no assertion from that test ran. The full memory-planning suite, end-to-end/native runtime tests, Buck build, and documentation build were not run. Please use CI and reviewer testing as the primary verification of broader runtime behavior.

The branch is unchanged from the existing fork commit a95dd46e; no additional code changes were needed. CLA acceptance must be confirmed by the repository's CLA check.

cc @JacobSzwejbka @angelayi @nil-is-all

Copilot AI balanced review requested due to automatic review settings October 8, 2026 10:11
@pytorch-bot

pytorch-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23592

Note: Links to docs will display an error until the docs builds have been completed.

⚠️ 15 Awaiting Approval

As of commit 89ad6e8 with merge base f2575be (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla

meta-cla Bot commented Oct 8, 2026

Copy link
Copy Markdown

Hi @krisnaparahita!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

CLA Not Signed

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@executorch-triage executorch-triage Bot added the community: contribution PRs coming from community (excluding hardware partners) label Oct 8, 2026
@nil-is-all nil-is-all added the module: exir Issues related to Export IR and the code under exir/ label Oct 8, 2026
@nil-is-all

Copy link
Copy Markdown
Contributor

Thanks for putting up the fix, @krisnaparahita! While the CI workflows run, could you sign EasyCLA?

@krisnaparahita

Copy link
Copy Markdown
Author

https://code.facebook.com/cla

Hi,
Yes I have sign the EasyCLA

Copilot AI balanced review requested due to automatic review settings October 9, 2026 14:45
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@JakeStevens

Copy link
Copy Markdown
Contributor

/easycla

@JakeStevens

Copy link
Copy Markdown
Contributor

Can you please make sure that all accounts you have used are certified?

Or, update the commits to use only the certified account?

There are multiple commit authors that seem to be perhaps different profiles you have, if there is more than one, then they are tracked separately. this could be tripping it up

Remove the legacy capture()/_capture_legacy_do_not_use/CallSpec/CaptureConfig
API and the unused _unlift helper. EdgeCompileConfig and ExecutorchBackendConfig
stay in exir.capture._config (widely imported). patch_forward moves to
exir.capture._utils. Migrate the two remaining exir.capture() callers in
test_pass_infra to torch.export + to_edge and update stale docs.

Fixes pytorch#18125
@krisnaparahita

Copy link
Copy Markdown
Author

Can you please make sure that all accounts you have used are certified?

Or, update the commits to use only the certified account?

There are multiple commit authors that seem to be perhaps different profiles you have, if there is more than one, then they are tracked separately. this could be tripping it up

Done tidy up commit history.

thanks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. community: contribution PRs coming from community (excluding hardware partners) module: exir Issues related to Export IR and the code under exir/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete exir.capture

5 participants