Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions backends/apple/coreml/compiler/torch_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
NUM_TO_TORCH_DTYPE,
split,
to,
transpose,
unbind,
)
from coremltools.converters.mil.frontend.torch.torch_op_registry import (
register_torch_op,
Expand All @@ -30,18 +28,6 @@
from executorch.exir.dim_order_utils import get_memory_format


# https://github.com/apple/coremltools/pull/2556
@register_torch_op(override=False)
def transpose_copy(context, node):
transpose(context, node)


# https://github.com/apple/coremltools/pull/2557
@register_torch_op(override=False)
def unbind_copy(context, node):
unbind(context, node)


# https://github.com/apple/coremltools/pull/2563
@register_torch_op(override=False)
def split_copy(context, node):
Expand Down Expand Up @@ -117,7 +103,9 @@ def _clone_dim_order(context, node):
# https://github.com/apple/coremltools/pull/2558
@register_torch_op(
torch_alias=["torchao::dequantize_affine", "torchao.dequantize_affine"],
override=False,
# coremltools did not merge the fix into 9.0 (https://github.com/apple/coremltools/pull/2589),
# so we override here
override=True,
)
def dequantize_affine(context, node):
inputs = _get_inputs(context, node, expected=[7, 8])
Expand Down
2 changes: 1 addition & 1 deletion backends/apple/coreml/test/test_coreml_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def forward(self, x):
)
self.check_fully_delegated(session)

self._compare_eager_quantized_model_outputs(session, example_inputs, atol=1e-3)
self._compare_eager_quantized_model_outputs(session, example_inputs, atol=1e-2)
self._compare_eager_unquantized_model_outputs(session, model, example_inputs)

def test_int8_weight_only_pt2e(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ dependencies=[
# See also third-party/TARGETS for buck's typing-extensions version.
"typing-extensions>=4.10.0",
# Keep this version in sync with: ./backends/apple/coreml/scripts/install_requirements.sh
"coremltools==9.0b1; platform_system == 'Darwin' or platform_system == 'Linux'",
"coremltools==9.0; platform_system == 'Darwin' or platform_system == 'Linux'",
# scikit-learn is used to support palettization in the coreml backend
"scikit-learn==1.7.1",
"hydra-core>=1.3.0",
Expand Down
Loading