Skip to content

Conversation

pytorchbot
Copy link
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #13791 by @abhinaykukkadapu
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/abhinaykukkadapu/8/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/abhinaykukkadapu/8/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/abhinaykukkadapu/8/orig
@diff-train-skip-merge

Copy link

pytorch-bot bot commented Sep 5, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures, 4 Pending

As of commit 78223ca with merge base fcdcd8e (image):

NEW FAILURES - The following jobs have failed:

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

@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 Sep 5, 2025
Copy link

github-actions bot commented Sep 5, 2025

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.

…dels to a target device

Pull Request resolved: #13791

This diff introduces multi backend/ target based recipes to lower a model with very less code. Target recipes provide pre-configured backend recipes to use them and retarget if needed.

See RFC: #13732

## Usage

```
from executorch.export import export
from executorch.export.target_recipes import get_ios_recipe

# CoreML + XNNPACK (FP32)
recipe = get_ios_recipe() # default = "ios-arm64-coreml-fp16"
session = export(model, recipe, example_inputs)
session.save_pte_file("model.pte")
```

## Advanced usage to combine specific recipes of one or two or backends
one can directly use `ExportRecipe.combine_recipes()` to combine specific backend recipes.
```
recipe1 = ExportRecipe.get_recipe(CoreMLRecipeType.FP32)
recipe2 = ExportRecipe.get_recipe(XNNPackRecipeType.FP32)
combined_recipe = ExportRecipe.combine(
                     [recipe1, recipe2],
                     recipe_name="multi_backend_coreml_xnnpack_fp32"
                  )
session = export(model, combined_recipe, example_inputs)
```
Additional changes:
1. Relaxed kwarg validation in the backend providers to just ignore them instead of erroring out.

Fixes: #13732
ghstack-source-id: 307671542
@exported-using-ghexport

Differential Revision: [D81297451](https://our.internmc.facebook.com/intern/diff/D81297451/)
@abhinaykukkadapu abhinaykukkadapu force-pushed the gh/abhinaykukkadapu/8/orig branch from 523f96f to 78223ca Compare September 5, 2025 01:30
@abhinaykukkadapu abhinaykukkadapu merged commit b02db12 into main Sep 5, 2025
121 of 123 checks passed
@abhinaykukkadapu abhinaykukkadapu deleted the gh/abhinaykukkadapu/8/orig branch September 5, 2025 03:15
@shoumikhin
Copy link
Contributor

@abhinaykukkadapu unittest-nxp-neutron CI check is failing consistently after this change, please take a look if it's related. Thanks!

@abhinaykukkadapu
Copy link
Contributor

@abhinaykukkadapu unittest-nxp-neutron CI check is failing consistently after this change, please take a look if it's related. Thanks!

@shoumikhin These test failures doesn't seem to be related to the changes in this diff, not sure why these are failing starting this diff.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants