Skip to content

CoreML missing partitioner constraint for PixelUnshuffle on older targets #11711

@GregoryComer

Description

@GregoryComer
Member

🐛 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)

cc @kimishpatel @YifanShenSZ @cymbalrush @metascroy

Activity

added theissue type on Jun 16, 2025
added
module: coremlIssues related to Apple's Core ML delegation and code under backends/apple/coreml/
backend testerThis bug was found by the backend test suite.
on Jun 16, 2025
metascroy

metascroy commented on Jul 7, 2025

@metascroy
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend testerThis bug was found by the backend test suite.module: coremlIssues related to Apple's Core ML delegation and code under backends/apple/coreml/

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @GregoryComer@metascroy

        Issue actions

          CoreML missing partitioner constraint for PixelUnshuffle on older targets · Issue #11711 · pytorch/executorch