Skip to content

Commit d99c31b

Browse files
authored
Add warning for deprecated to_edge() flow with CoreML
This commit adds a warning message in the CoreML partitioner's partition() method to alert users when they use the older to_edge() flow instead of the recommended to_edge_transform_and_lower() flow. The warning informs users that: - Using the old flow may result in performance regression - The recommended approach is to use to_edge_transform_and_lower() with CoreML partitioner - Provides a link to the CoreML backend documentation for more details Fixes #15960
1 parent d13c789 commit d99c31b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backends/apple/coreml/partition/coreml_partitioner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ def partition(self, exported_program: ExportedProgram) -> PartitionResult:
226226
# Run the CapabilityBasedPartitioner to return the largest possible
227227
# subgraphs containing the nodes with the tags
228228
logger.info("CoreMLPartitioner::partition")
229+
logger.warning("Using the old `to_edge()` flow with CoreML may result in performance regression. "
230+
"The recommended flow is to use `to_edge_transform_and_lower()` with the CoreML partitioner. "
231+
"See the documentation for more details: "
232+
"https://github.com/pytorch/executorch/blob/main/docs/source/backends/coreml/coreml-overview.md#using-the-core-ml-backend"
233+
)
229234
partition_tags = {}
230235

231236
capability_partitioner = CapabilityBasedPartitioner(

0 commit comments

Comments
 (0)