Skip to content

CoreML - Writing CoreML Model on every inference session creation #21761

@henryruhs

Description

@henryruhs

Describe the issue

I set onnxruntime to verbose to understand why the CoreML provider is that slow. Then I figured out it does convert the ONNX to mlmodel every time without a cache.

2024-08-15 23:01:33.924908 [I:onnxruntime:, model_builder.cc:926 SaveModel] Writing CoreML Model to /var/folders/nz/t7blntb55gv6k4hzbd91kl5h0000gn/T/onnxruntime-72B02264-8413-46DF-8067-45E9808043DF-16638-000199F2EF486AAE.model.mlmodel

To reproduce

Just use set_default_logger_severity(0)

I use a ONNX with opset 17 - but the issue is not related to a single model

Urgency

No response

Platform

Mac

OS Version

14.5

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.18.0

ONNX Runtime API

Python

Architecture

ARM64

Execution Provider

CoreML

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributions welcomeexternal contributions welcomeep:CoreMLissues related to CoreML execution provider

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions