-
Notifications
You must be signed in to change notification settings - Fork 668
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
The following model reliably crashes the process on M1 Pro.
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__()
def forward(self, x, y):
return torch.floor_divide(x, y)
model = Model()
inputs = (
torch.randint(-100, 100, (10, 10)),
torch.full((10, 10), 2),
)
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:
[ETCoreMLModelManager.mm:528] Cache Miss: Model with identifier=executorch_76735a7d-45bb-436a-af25-3e8f32949377_all was not found in the models cache.
python(25645,0x1f978df00) malloc: *** error for object 0x16d2a1af0: pointer being freed was not allocated
python(25645,0x1f978df00) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort python -m unittest
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
Status
Done