Open
Description
🐛 Describe the bug
Models that contain torch.asinh or torch.acosh will error out with an internal error inside the CoreML lowering code.
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):
return torch.acosh(x)
model = Model()
inputs = (
torch.randn(1,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:
File [~/miniconda3/envs/executorch/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/ops.py:6834](http://localhost:8888/lab/tree/~/miniconda3/envs/executorch/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/ops.py#line=6833), in acosh(context, node)
6831 @register_torch_op
6832 def acosh(context, node):
6833 inputs = _get_inputs(context, node, expected=1)
-> 6834 context.add(mb.acosh(x=inputs[0], name=node.name))
AttributeError: type object 'Builder' has no attribute 'acosh'
Versions
coremltools version 8.3
executorch commit 67b6009 (Jun 14)