Hello,
We are seeing what appears to be a regression in the Core ML multifunction ML Program loading path on macOS 27.0.
A compiled multifunction ML Program is correctly recognized by MLModelAsset and MLModelStructure, but loading either named function through MLModel fails with an error claiming that the model is not an ML Program.
Environment
macOS 27.0
Build: 26A428
Apple silicon Mac
BABANE 1.0.4, build 16
Application built with the macOS 26.5 SDK
Reproduces both inside and outside App Sandbox
Approximately 98 GiB of disk space is available
Public reproduction
BABANE is available from the Mac App Store:
BABANE on the App Store
Apple engineers can reproduce the issue without receiving a separate model archive:
Install BABANE from the App Store on macOS 27.0.
Download either available translation model in the app.
The model is delivered using Apple-Hosted Background Assets.
Trigger model loading by starting a translation.
Core ML fails while loading the first named function.
The downloadable models are approximately 1.9 GB, so the App Store build is the most practical complete reproduction environment.
Model structure
The model is a specification-version-9 ML Program containing two functions:
infer
prefill
Core ML correctly recognizes both functions:
let asset = try MLModelAsset(url: compiledModelURL)
let functionNames = try await asset.functionNames
print(functionNames)
Output:
["infer", "prefill"]
MLModelStructure also returns a .program structure containing both functions.
Loading code
import CoreML
func loadModel(
at url: URL,
functionName: String?
) throws -> MLModel {
let configuration = MLModelConfiguration()
configuration.computeUnits = .cpuAndNeuralEngine
configuration.functionName = functionName
return try MLModel(
contentsOf: url,
configuration: configuration
)
}
Loading either function:
try loadModel(at: compiledModelURL, functionName: "infer")
or:
try loadModel(at: compiledModelURL, functionName: "prefill")
fails with:
`MLModelConfiguration`'s `.functionName` property must be `nil`
unless the model type is ML Program.
This contradicts the results returned by MLModelAsset and MLModelStructure.
Setting functionName to nil is not a workaround. It fails with:
This MLModel doesn't support the multi-function description syntax.
Unified logging
Immediately before the public Core ML error, unified logging reports:
E5RT encountered an STL exception.
E5RT: <private> (11)
Core ML then returns the misleading functionName error.
Tests performed
We tested:
functionName = "infer"
functionName = "prefill"
functionName = nil
.cpuOnly
.cpuAndGPU
.cpuAndNeuralEngine
.all
App Sandbox application
Non-sandboxed command-line executable
Existing .mlmodelc
A newly compiled .mlmodelc produced on macOS 27
All named-function combinations fail in the same way. The failure is independent of compute-unit selection and App Sandbox.
The source package recompiles successfully on macOS 27, but the newly compiled model still fails to load.
As an additional control:
A system-provided multifunction ML Program exhibits the same loading failure on this installation.
A single-function Core ML model loads successfully.
This appears specific to the multifunction model loading path.
Documentation
The current Core ML documentation still describes MLModelAsset.functionNames as the way to discover functions and MLModelConfiguration.functionName as the way to select one:
MLModelConfiguration.functionName
MLModelAsset.functionNames
We could not find any macOS 27 documentation or release-note entry stating that this behavior changed, that named functions now require a different loading API, or that a new entitlement is required.
We found some potentially related reports:
Core ML loading crash on macOS 27.0 build 26A428
Historical multifunction model loading crash
Core ML/E5RT AOT loading regression with an Apple DTS response
None of these reports documents the exact functionName failure described here.
Expected behavior
A model recognized as a multifunction ML Program should load when MLModelConfiguration.functionName is set to one of the names returned by MLModelAsset.functionNames.
Actual behavior
MLModel rejects the named function and incorrectly reports that the model is not an ML Program.
Questions
Is this a known macOS 27.0 regression in the Core ML multifunction loading path?
Does MLModelConfiguration.functionName still accept names returned by MLModelAsset.functionNames on macOS 27?
Is there a new required loading API, deployment target, SDK, entitlement, or model-packaging rule?
Is there a supported workaround other than exporting each function as a separate model?
Which diagnostics should we attach to a Feedback Assistant report besides the reproducer, unified logs, sysdiagnose, and exact OS/Xcode builds?
Thank you.
0
0
16