CoreML takes forever to load when using neural engine

I am using the depthAnything v2 provided by Apple on the developer website. On my iPhone 15 Pro, if I choose all or cpuAndNeuralEngine, it will stuck in loading models.

  let config = MLModelConfiguration()
        config.computeUnits = .cpuAndGPU//normal when not using neuralEngine.
        let model = try await DepthModel.load(configuration: config)

with following error:

E5RT encountered an STL exception. msg = MILCompilerForANE error: failed to compile ANE model using ANEF. Error=无法与帮助程序通信。.
E5RT: MILCompilerForANE error: failed to compile ANE model using ANEF. Error=无法与帮助程序通信。 (11)

Which OS version did you observe the issue? If it is not the latest iOS 18.2, I would recommend to try that.

We need Feedback Assistance with sysdiagnose for the further analysis.

I can confirm the issue exists using the latest iOS 18.2 release. In my application, I have mlpackages being loaded using .cpuAndNeuralEngine and we only started receiving this error message after updating to 18.2. It doesn't appear to impact usage of the models, but it's weird that it shows up only in 18.2.

CoreML takes forever to load when using neural engine
 
 
Q