coreai-build crashes for A-series Neural Engine targets since Xcode 27.2

Since Xcode 27.2, ahead-of-time compiling a Core AI model for an iPhone chip crashes as soon as any part of the model is placed on the Neural Engine:

xcrun coreai-build compile Model.aimodel --platform iOS --min-deployment-version 27.0 \
    --architecture h17p --preferred-compute neural-engine --output out

coreai-build exits with Segmentation fault: 11 (status 139), prints nothing and writes no output. The crash report points into the Neural Engine compiler:

ANEHostCompiler  ZinIrCompilerParameters::PropogateGlobalOptionsToPerProcedureOptions(...)
ANEHostCompiler  ANECompilerOffline::CompileAllTargetProcedures()

What we found:

  • It affects every A-series architecture (h16p, h17p, h18p, h19p). M-series targets (h13g through h17g) compile fine.
  • It doesn't depend on the model. A model with a single convolution crashes too.
  • It happens with Xcode 27.2 and 27.3 beta 1. Xcode 27.1 compiles the same models.
  • Models that 27.2 places entirely on the GPU do compile.
  • The Xcode 27.1 toolchain doesn't run on macOS 27.2. It fails at launch with dyld: Symbol not found: … AIModelAsset.delegatesFolderURL(artifactName:).

So on macOS 27.2, we currently can't compile Core AI models for an iPhone's Neural Engine at all. The only working setup we have is Xcode 27.1 on macOS 27.0.

Reported as FB25501691, with a minimal model and crash reports.

Has anyone else run into this or found a workaround?

Thanks for filing the feedback, we were able to reproduce the issue with 27.3 beta 1 and this issue is being investigated.

Workaround: the Xcode 27.1 toolchain works on macOS 27.2 if you make it load its own bundled frameworks instead of the system's. Call the binary directly, because xcrun drops DYLD_* variables:

B=$(DEVELOPER_DIR=/Applications/Xcode-27.1.app/Contents/Developer xcrun -f coreai-build)
DYLD_FRAMEWORK_PATH="${B%/usr/bin/coreai-build}/System/Library/PrivateFrameworks" \
    "$B" compile Model.aimodel --platform iOS --min-deployment-version 27.0 \
    --architecture h17p --preferred-compute neural-engine --output out

Adjust the Xcode path to your 27.1 install. With this, A-series targets compile onto the Neural Engine again on macOS 27.2. Until Apple fixes the crash, this is the only way we know to build Core AI models for iPhones on macOS 27.2.