You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing extremely long loading times when using the MLModel API to load a converted Core ML model. The loading process hangs indefinitely. When changing compute_units to ct.ComputeUnit.CPU_AND_GPU, the model loading works and is fast.
Stack Trace
If applicable, please paste the complete stack trace.
To Reproduce
I built a simple super-resolution model in PyTorch, traced it using torch.jit.trace and then converted to mlpackage. There is no fancy operations, and all operations are common in deep learning.
The loading works only when setting compute_units=ct.ComputeUnit.CPU_AND_GPU
System environment (please complete the following information):
coremltools version: 7.2
OS: Sonoma 14.5
Any other relevant version information: Pytorch==2.0.1
Additional context
I also tried running a performance report in Xcode. The profiling takes forever if setting Compute Unit to ALL with real physical devices: macOS 14.5 (m1 pro chip), iOS 17.5 (iPhone 13 Pro) and iOS 18.0 (iPhone 16 Pro). Running performance report works only when setting compute unit to either 'CPU only' or 'CPU and GPU'.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue. We noticed for some large models compiling for ANE takes large time which is what might be contributing to long load times here.
Curious, did the loading ever finish or was it stuck forever? Any time quantification here would be useful.
Hi @DawerG, Thanks for your attention to this issue. The model is reasonably small (the size of the .mlpackage is less than 1MB). However, the loading was stuck forever when using ANE. Please let me know if you need any other details.
🐞Describing the bug
I'm experiencing extremely long loading times when using the MLModel API to load a converted Core ML model. The loading process hangs indefinitely. When changing compute_units to ct.ComputeUnit.CPU_AND_GPU, the model loading works and is fast.
Stack Trace
To Reproduce
torch.jit.trace
and then converted tomlpackage
. There is no fancy operations, and all operations are common in deep learning.The loading works only when setting
compute_units=ct.ComputeUnit.CPU_AND_GPU
System environment (please complete the following information):
Pytorch==2.0.1
Additional context
ALL
with real physical devices: macOS 14.5 (m1 pro chip), iOS 17.5 (iPhone 13 Pro) and iOS 18.0 (iPhone 16 Pro). Running performance report works only when setting compute unit to either 'CPU only' or 'CPU and GPU'.The text was updated successfully, but these errors were encountered: