Add deprecation warning for to_edge + to_backend workflow in CoreMLPa…#17082
Conversation
…rtitioner Signed-off-by: mohammed-saalim <mohammed.saalim.k@gmail.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17082
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New FailuresAs of commit adfe544 with merge base 62d6dc1 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @mohammed-saalim! Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR adds a deprecation warning in the CoreML partitioner to steer users away from the older to_edge() + to_backend() workflow toward to_edge_transform_and_lower(), matching the pattern already used for XNNPACK and adding tests to validate the behavior.
Changes:
- Added
_check_if_called_from_to_backend()toCoreMLPartitionerto detect whenpartition()is invoked via the deprecatedto_backendpath. - Updated
CoreMLPartitioner.partition()to log a deprecation warning when the deprecated flow is detected, including context on performance implications and a docs link. - Added two unit tests that verify the warning is emitted for
to_edge() + to_backend()and not emitted when usingto_edge_transform_and_lower(), and wired them into the file’s__main__block.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
backends/apple/coreml/partition/coreml_partitioner.py |
Adds stack-based detection of deprecated to_backend usage and emits a CoreML-specific deprecation warning while preserving existing partitioning behavior. |
backends/apple/coreml/test/test_coreml_partitioner.py |
Introduces tests that capture the CoreML partitioner logger output to assert that the deprecation warning appears only for to_edge() + to_backend() and extends the manual test runner to invoke these tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@pytorchbot label "release notes: none" |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
is there any update? @manuelcandales @metascroy |
metascroy
left a comment
There was a problem hiding this comment.
Looks great! Let's see what CI says
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I fixed the linting issue @metascroy |
|
rerunning CI |
|
can u pls re-run it. @metascroy |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @metascroy, The linting issues have been resolved with the latest commits:
The failing Samsung test jobs ( The CoreML-related changes and tests are ready for review. Thanks! |
|
Looks great! Just running some trunk jobs, and then I'll merge. Thanks for the contribution! |
Fixes #15960
This PR adds a deprecation warning in the CoreMLPartitioner to guide users away from the deprecated to_edge() + to_backend() workflow and toward the recommended to_edge_transform_and_lower() flow.
Changes
Pattern
Following the same pattern as #13209 (XNNPACK).
Related
This picks up the abandoned PR #15963.
cc @kimishpatel @YifanShenSZ @cymbalrush @metascroy