Skip to content

Conversation

abhinaykukkadapu
Copy link
Contributor

Summary

Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes #13100

Test plan

python -m unittest backends/apple/coreml/test/test_coreml_recipes.py

Copy link

pytorch-bot bot commented Aug 5, 2025

🔗 Helpful Links

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

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

⏳ No Failures, 78 Pending

As of commit 4c34f87 with merge base 41d05fe (image):
💚 Looks good so far! There are no failures yet. 💚

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

github-actions bot commented Aug 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.

@facebook-github-bot
Copy link
Contributor

@abhinaykukkadapu has imported this pull request. If you are a Meta employee, you can view this in D79654041.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79654041

abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Aug 5, 2025
Summary:
Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes pytorch#13100

Pull Request resolved: pytorch#13121

Test Plan: `python -m unittest backends/apple/coreml/test/test_coreml_recipes.py`

Differential Revision: D79654041

Pulled By: abhinaykukkadapu
CoreMLRecipeProvider,
CoreMLRecipeType,
)
from executorch.backends.apple.coreml.test.test_torch_ops import _TEST_RUNTIME
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: rather than import from the other test, factor _TEST_RUNTIME out into a common test_util and use in both tests.


return ExportRecipe(
name=recipe_type.value,
quantization_recipe=None, # TODO - add quantization recipe
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: I have a PR updating CoreML docs that you might check out for quantization and available partitioner options: #13120

Copy link
Contributor

Choose a reason for hiding this comment

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

@metascroy it might make sense for you to follow up on the recipes for quant

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, @abhinaykukkadapu are the quant recipes coming in a future PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@metascroy If you want to follow up, i can leave it upto you as you have more context on quantization, or i can take it up if you don't have bandwidth.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can add the quantization recipe, I'm happy to review the quantize_ and PT2E recipes you add for CoreML

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@metascroy sure will add in a follow up diff, can we go ahead with these changes?

abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Aug 6, 2025
Summary:
Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes pytorch#13100

Pull Request resolved: pytorch#13121

Test Plan: `python -m unittest backends/apple/coreml/test/test_coreml_recipes.py`

Differential Revision: D79654041

Pulled By: abhinaykukkadapu
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Aug 7, 2025
Summary:
Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes pytorch#13100

Pull Request resolved: pytorch#13121

Test Plan: `python -m unittest backends/apple/coreml/test/test_coreml_recipes.py`

Differential Revision: D79654041

Pulled By: abhinaykukkadapu
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Aug 7, 2025
Summary:
Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes pytorch#13100

Pull Request resolved: pytorch#13121

Test Plan: `python -m unittest backends/apple/coreml/test/test_coreml_recipes.py`

Differential Revision: D79654041

Pulled By: abhinaykukkadapu
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Aug 7, 2025
Summary:
Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes pytorch#13100

Pull Request resolved: pytorch#13121

Test Plan: `python -m unittest backends/apple/coreml/test/test_coreml_recipes.py`

Differential Revision: D79654041

Pulled By: abhinaykukkadapu
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Aug 7, 2025
Summary:
Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes pytorch#13100

Pull Request resolved: pytorch#13121

Test Plan: `python -m unittest backends/apple/coreml/test/test_coreml_recipes.py`

Differential Revision: D79654041

Pulled By: abhinaykukkadapu
abhinaykukkadapu added a commit to abhinaykukkadapu/executorch that referenced this pull request Aug 8, 2025
Summary:
Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes pytorch#13100

Pull Request resolved: pytorch#13121

Test Plan: `python -m unittest backends/apple/coreml/test/test_coreml_recipes.py`

Differential Revision: D79654041

Pulled By: abhinaykukkadapu
@facebook-github-bot
Copy link
Contributor

@abhinaykukkadapu has imported this pull request. If you are a Meta employee, you can view this in D79654041.

Summary:
Adds coreml recipes as discussed similar to xnnpack backend recipes to use them for export flow.

Fixes pytorch#13100

Pull Request resolved: pytorch#13121

Test Plan: `python -m unittest backends/apple/coreml/test/test_coreml_recipes.py`

Reviewed By: metascroy

Differential Revision: D79654041

Pulled By: abhinaykukkadapu
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79654041

@abhinaykukkadapu abhinaykukkadapu merged commit c671b92 into pytorch:main Aug 8, 2025
103 of 109 checks passed
@abhinaykukkadapu abhinaykukkadapu deleted the coreml_backend_recipes branch August 8, 2025 17:09
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

ghstack-source-id: 302827577
Pull Request resolved: #13387
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Pull Request resolved: #13387

Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY
ghstack-source-id: 302842396
@exported-using-ghexport

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Pull Request resolved: #13387

Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY
ghstack-source-id: 302857006
@exported-using-ghexport

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 13, 2025
Pull Request resolved: #13387

Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY
ghstack-source-id: 302870102
@exported-using-ghexport

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)
abhinaykukkadapu added a commit that referenced this pull request Aug 14, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 14, 2025
Pull Request resolved: #13387

Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
TORCHAO_INT4_WEIGHT_ONLY_PER_CHANNEL
TORCHAO_INT4_WEIGHT_ONLY_PER_GROUP
TORCHAO_INT8_WEIGHT_ONLY_PER_CHANNEL
TORCHAO_INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY
ghstack-source-id: 303044428
@exported-using-ghexport

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)
abhinaykukkadapu added a commit that referenced this pull request Aug 14, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 14, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 14, 2025
Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
INT4_WEIGHT_ONLY_PER_CHANNEL
INT4_WEIGHT_ONLY_PER_GROUP
INT8_WEIGHT_ONLY_PER_CHANNEL
INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)

[ghstack-poisoned]
abhinaykukkadapu added a commit that referenced this pull request Aug 14, 2025
Pull Request resolved: #13387

Fixing tests for stack that got reverted: #13265

Adds coreml quant recipes after FP32/16 recipes added in #13121

Recipes added:

PT2E_INT8_STATIC
PT2E_INT8_WEIGHT_ONLY
TORCHAO_INT4_WEIGHT_ONLY_PER_CHANNEL
TORCHAO_INT4_WEIGHT_ONLY_PER_GROUP
TORCHAO_INT8_WEIGHT_ONLY_PER_CHANNEL
TORCHAO_INT8_WEIGHT_ONLY_PER_GROUP
CODEBOOK_WEIGHT_ONLY
ghstack-source-id: 303126085
@exported-using-ghexport

Differential Revision: [D80206542](https://our.internmc.facebook.com/intern/diff/D80206542/)
agrima1304 pushed a commit to agrima1304/executorch that referenced this pull request Aug 26, 2025
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. fb-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CoreML backend recipes

4 participants