Open GregoryComer opened 1 day ago
@cymbalrush can you take a look
Briefly looking here, it looks like CoreML delegate uses compileModelAtURL:completionHandler inside the runtime here: https://github.com/pytorch/executorch/blob/dcacde01d355b5f5082301edcdc9774dd3392f36/backends/apple/coreml/runtime/delegate/ETCoreMLModelCompiler.mm#L31
But this method was introduced for iOS16: https://developer.apple.com/documentation/coreml/mlmodel/compilemodel(at:)-3nea?language=objc
🐛 Describe the bug
The CoreML delegate appears to not function on iOS 15.5. We encountered an issue with model load on a Meta-internal model, but I am also able to reproduce the issue with a simple model. It is able to run successfully on iOS 17 but fails to load on iOS 15.5. It appears to work on iOS 16 and later, but I have not tested each version.
The model fails to execute with the following trace when loading the model method:
PTE repro (though multiple / all(?) models appear to have this issue):
Versions
Collecting environment information... PyTorch version: 2.6.0.dev20241112 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A
OS: macOS 14.6.1 (arm64) GCC version: Could not collect Clang version: 15.0.0 (clang-1500.3.9.4) CMake version: version 3.29.0 Libc version: N/A
Python version: 3.10.13 (main, Sep 11 2023, 08:16:02) [Clang 14.0.6 ] (64-bit runtime) Python platform: macOS-14.6.1-arm64-arm-64bit Is CUDA available: False CUDA runtime version: No CUDA CUDA_MODULE_LOADING set to: N/A GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True
CPU: Apple M1 Pro
Versions of relevant libraries: [pip3] executorch==0.5.0a0+1de96f8 [pip3] executorchcoreml==0.0.1 [pip3] flake8==6.1.0 [pip3] flake8-breakpoint==1.1.0 [pip3] flake8-bugbear==23.9.16 [pip3] flake8-comprehensions==3.14.0 [pip3] flake8-executable==2.1.3 [pip3] flake8-logging-format==0.9.0 [pip3] flake8-plugin-utils==1.3.3 [pip3] flake8-pyi==23.5.0 [pip3] flake8-simplify==0.19.3 [pip3] mypy==1.11.2 [pip3] mypy-extensions==1.0.0 [pip3] numpy==1.26.4 [pip3] optree==0.13.0 [pip3] pytorch-sphinx-theme==0.0.24 [pip3] torch==2.6.0.dev20241112 [pip3] torchao==0.1 [pip3] torchaudio==2.5.0.dev20241112 [pip3] torchsr==1.0.4 [pip3] torchvision==0.20.0.dev20241112 [conda] executorch 0.1.0 pypi_0 pypi [conda] executorchcoreml 0.0.1 pypi_0 pypi [conda] numpy 1.26.4 pypi_0 pypi [conda] optree 0.13.0 pypi_0 pypi [conda] pytorch-sphinx-theme 0.0.24 dev_0
[conda] torch 2.6.0.dev20241112 pypi_0 pypi
[conda] torchao 0.1 pypi_0 pypi
[conda] torchaudio 2.5.0.dev20241112 pypi_0 pypi
[conda] torchfix 0.5.0 pypi_0 pypi
[conda] torchsr 1.0.4 pypi_0 pypi
[conda] torchvision 0.20.0.dev20241112 pypi_0 pypi