CoreML Crashed in iOS18 Beta

Here is an App using CoreML API with ML package format, it works fine in iOS17, while it is crashed when calling [MLModel modelWithContentsOfURL ] to load model running in iOS18. It seems an exception is raised "Failed to set compute_device_types_mask E5RT: Cannot provide zero compute device types. (1)". Is it a bug of iOS18 beta version , and it will be fixed in the future?

The stack is as below:

Exception Codes: #0 at 0x1e9280254
Crashed Thread:  49
Application Specific Information:
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'Failed to set compute_device_types_mask E5RT: Cannot provide zero compute device types. (1)'
Last Exception Backtrace:
0   CoreFoundation                      0x0000000199466418 __exceptionPreprocess + 164
1   libobjc.A.dylib                     0x00000001967cde88 objc_exception_throw + 76
2   CoreFoundation                      0x0000000199560794 -[NSException initWithCoder:]
3   CoreML                              0x00000001b4fcfa8c -[MLE5ProgramLibraryOnDeviceAOTCompilationImpl createProgramLibraryHandleWithRespecialization:error:] + 1584
4   CoreML                              0x00000001b4fcf3cc -[MLE5ProgramLibrary _programLibraryHandleWithForceRespecialization:error:] + 96
5   CoreML                              0x00000001b4fc23d8 __44-[MLE5ProgramLibrary prepareAndReturnError:]_block_invoke + 60
6   libdispatch.dylib                   0x00000001a12e1160 _dispatch_client_callout + 20
7   libdispatch.dylib                   0x00000001a12f07b8 _dispatch_lane_barrier_sync_invoke_and_complete + 56
8   CoreML                              0x00000001b4fc3e98 -[MLE5ProgramLibrary prepareAndReturnError:] + 220
9   CoreML                              0x00000001b4fc3bc0 -[MLE5Engine initWithContainer:configuration:error:] + 220
10  CoreML                              0x00000001b4fc3888 +[MLE5Engine loadModelFromCompiledArchive:modelVersionInfo:compilerVersionInfo:configuration:error:] + 344
11  CoreML                              0x00000001b4faf53c +[MLLoader _loadModelWithClass:fromArchive:modelVersionInfo:compilerVersionInfo:configuration:error:] + 364
12  CoreML                              0x00000001b4faedd4 +[MLLoader _loadModelFromArchive:configuration:modelVersion:compilerVersion:loaderEvent:useUpdatableModelLoaders:loadingClasses:error:] + 540
13  CoreML                              0x00000001b4f9b900 +[MLLoader _loadWithModelLoaderFromArchive:configuration:loaderEvent:useUpdatableModelLoaders:error:] + 424
14  CoreML                              0x00000001b4faaeac +[MLLoader _loadModelFromArchive:configuration:loaderEvent:useUpdatableModelLoaders:error:] + 460
15  CoreML                              0x00000001b4fb0428 +[MLLoader _loadModelFromAssetAtURL:configuration:loaderEvent:error:] + 240
16  CoreML                              0x00000001b4fb00c4 +[MLLoader loadModelFromAssetAtURL:configuration:error:] + 104
17  CoreML                              0x00000001b5314118 -[MLModelAssetResourceFactoryOnDiskImpl modelWithConfiguration:error:] + 116
18  CoreML                              0x00000001b5418cc0 __60-[MLModelAssetResourceFactory modelWithConfiguration:error:]_block_invoke + 72
19  libdispatch.dylib                   0x00000001a12e1160 _dispatch_client_callout + 20
20  libdispatch.dylib                   0x00000001a12f07b8 _dispatch_lane_barrier_sync_invoke_and_complete + 56
21  CoreML                              0x00000001b5418b94 -[MLModelAssetResourceFactory modelWithConfiguration:error:] + 276
22  CoreML                              0x00000001b542919c -[MLModelAssetModelVendor modelWithConfiguration:error:] + 152
23  CoreML                              0x00000001b5380ce4 -[MLModelAsset modelWithConfiguration:error:] + 112
24  CoreML                              0x00000001b4fb0b3c +[MLModel modelWithContentsOfURL:configuration:error:] + 168

Our engineering teams need to investigate this issue, as this might indicate an issue with iOS 18 Beta.

We'd greatly appreciate it if you could open a bug report, include crash logs and sample code or models that reproduce the issue, and post the FB number here once you do.

Bug Reporting: How and Why? has tips on creating a successful bug report.

Hello, could you please confirm the following 2 things:

  1. Are you passing MLModelConfiguration while creating MLModel using [MLModel modelWithContentsOfURL... ] method?
  2. Actual code you are using to allocate and initialize MLModelConfiguration object?
CoreML Crashed in iOS18 Beta
 
 
Q