-
Notifications
You must be signed in to change notification settings - Fork 630
Closed
Labels
backend testerThis bug was found by the backend test suite.This bug was found by the backend test suite.module: coremlIssues related to Apple's Core ML delegation and code under backends/apple/coreml/Issues related to Apple's Core ML delegation and code under backends/apple/coreml/
Description
🐛 Describe the bug
Models with PixelUnshuffle fail to lower with default target settings, due to PixelUnshuffle on Core ML requiring iOS16 or later. This should be handled in the partitioner to allow it to fall back to the ET portable implementation.
Repro:
## import torch
from executorch.backends.apple.coreml.partition import CoreMLPartitioner
from executorch.exir import to_edge_transform_and_lower, EdgeCompileConfig, to_edge
from executorch.extension.pybindings.portable_lib import _load_for_executorch_from_buffer
class Model(torch.nn.Module):
def __init__(self):
super().__init__()
self.unshuffle = torch.nn.PixelUnshuffle(2)
def forward(self, x):
return self.unshuffle(x)
model = Model()
inputs = (
torch.randn(1,3,64,64),
)
eager_outputs = model(*inputs)
#print(f"Eager: {eager_outputs.shape} {eager_outputs}")
ep = torch.export.export(model.eval(), inputs)
print(ep)
print(f"EP: {ep.module()(*inputs)}")
lowered = to_edge_transform_and_lower(
ep,
partitioner=[CoreMLPartitioner()],
compile_config=EdgeCompileConfig(_check_ir_validity=False)
).to_executorch()
print(lowered.exported_program())
et_model = _load_for_executorch_from_buffer(lowered.buffer)
et_outputs = et_model([*inputs])[0]
et_outputs - eager_outputs
Output:
ValueError: No available version for pixel_unshuffle in the coremltools.target.iOS15 opset. Please update the minimum_deployment_target to at least coremltools.target.iOS16
Versions
coremltools version 8.3
executorch commit 67b6009 (Jun 14)
Metadata
Metadata
Assignees
Labels
backend testerThis bug was found by the backend test suite.This bug was found by the backend test suite.module: coremlIssues related to Apple's Core ML delegation and code under backends/apple/coreml/Issues related to Apple's Core ML delegation and code under backends/apple/coreml/
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
metascroy commentedon Jul 7, 2025
Closing this issue as low-priority. CoreML does not support this op on this OS target, and this is clear to the user from the error.