Core AI model zoo

Core AI error index — every exact error string this project has hit, verbatim, with the verified cause

An agent that hits an error searches the exact string. This page exists so that search lands somewhere: every H2 below, apart from the two closing sections, is one error string, verbatim as the log printed it, from Core AI’s runtime, coreai-torch, coreai-build, or the Swift engines in apple/coreai-models. Under each: when it appears, the cause this project verified, the fix, the evidence, and the OS / toolchain it was seen on.

Three rules, so the page stays true:

The string in the heading is the search key; the block under it is the fuller signature to match against. Lines and line numbers inside Apple’s frameworks (GPUMemrefOps.mm:687 / :700 / :707, NDArrayDescriptor.swift:139 / :136) move between builds — match on the message, not the number.

The entries are grouped by the stage at which the string appears: conversion, coreai-build, load / specialization, execution, the Swift engines, and the tools around the runtime.


Conversion time (coreai-torch, coreai-opt, torch.export)

Unsupported ATen op: sym_max

The converter has no lowering for the op; add_exported_program rejects the program at validate time, before anything runs.

dimension to be shrunk must have size 1, got N

The converter aborts on a squeeze(dim) that is a no-op in PyTorch.

Operation creation failed

The same no-op-squeeze abort as above, as V-JEPA 2 printed it. See dimension to be shrunk must have size 1, got N.

bad_optional_access

A C++ exception out of the converter, with no Python error, on torch.arange with float arguments.

ValueError: axis 1 is out of bounds

coreai-opt’s stock macOS 4bit preset dies on a gated RMSNorm.

RuntimeError: macOS quantization preset provided, but platform is iOS

coreai.llm.export refuses a macOS quantization preset on an iOS export.

torch.fx.experimental.symbolic_shapes.ConstraintViolationError: Constraints violated (d_73)!

torch.export inside the coreai-models export pipeline refuses a dynamic dim because a guard in the traced graph contradicts the Dim range the pipeline declared.

torch.fx.experimental.symbolic_shapes.ConstraintViolationError: Constraints violated (d_128)! For more information, run with TORCH_LOGS="+dynamic".
  - Not all values of d_128 = L['key'].size()[2] in the specified range satisfy the generated guard 64 <= L['key'].size()[2] and L['key'].size()[2] <= IntInfinity()

IndexError: shape[3]

replace_avg_pool2d throws on an unbatched 1-D pool.

SIGSEGV in coreai-pre-compilation-rewrite

program.optimize(), the Python runtime’s AIModel.load, and xcrun coreai-build compile all segfault on the same graph: the pass is shared by every compile path.

faulthandler: coreai/_compiler/_transforms/passes.py:261 apply_passes_sync  <- coreai/authoring/asset.py:230 optimize
xcrun coreai-build compile <x>.aimodel --platform macOS --preferred-compute gpu   ->  SIGSEGV (139)

–compression-config: file not found: conversion/minicpm5_int8sym_b32.yaml

coreai.llm.export cannot open a quantization YAML given by a path relative to the caller.


xcrun coreai-build compile

error: Core AI requires the Metal Toolchain

aimodelc answers this even though xcrun metal works in the same shell.

GPU::anePreCompileBinary

coreai-build compile runs ~5 min at 100 % CPU, then dies with SIGSEGV (exit 139), no diagnostic, no .aimodelc.

Exception:  EXC_BAD_ACCESS (SIGSEGV) — KERN_INVALID_ADDRESS
Crashing thread: MPSGraphExecutable_queue
  0  libobjc.A.dylib                    objc_release
  1  MetalPerformanceShadersGraph_host  GPU::anePreCompileBinary(MPSGraphExecutable*, llvm::SmallVectorImpl<mlir::…>)
  2  MetalPerformanceShadersGraph_host  BaseModuleRef::compileAndLoadANE()

ANECCompileOffline() failed: OSStatus=0, aneCompileStatus=1

coreai-build prints an Error: block, exits 0, and writes a GPU-only .aimodelc.

Error:

 ANECCompileOffline() failed: OSStatus=0, aneCompileStatus=1, statusdict={
    CompiledInputSourceFileName = ".../extend_1024_16_..._ANE_region_1_0.bc.mlir";
    ErrorList =     (
    );
    NetworkStatusList =     (
    );
}

Load and specialization (AIModel.load, AOT .aimodelc, the on-device specializer)

LLVM ERROR: cannot unwrap empty odiec_module_t

Every .aimodel converted with coreai-torch 0.4.0 stops loading on OS 27 beta 2 and later. The abort — at AIModel.load and at coreai-build compile alike — is preceded by the two lines that name the real problem:

loc(fused<{call_stack = ["_empty_nn_module_stack_from_metadata_hook$1"], identifiers = ["sym_size_int_28"]}>[...]): error: expected AICode versioned location, got: loc(fused<...>)
error: Failed to convert to versioned IR
LLVM ERROR: cannot unwrap empty `odiec_module_t`

NSPOSIXErrorDomain Code=2 “No such file or directory”

ENOENT at engine creation or AIModel.load, on a file that is right there. Six verified causes, none of them a missing model file.

ERROR Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"
App terminated due to signal 15.

failedToSpecialize

CoreAIDelegates.AIModelError code 1 at load. It reads like a bad compile; every time it was isolated here, the compile was fine.

invalidCompiledModel

The LanguageBundle / llm-runner face of an AOT bundle the runtime will not accept; the raw AIModel.load face is CoreAIDelegates.AIModelError error 3.

LLVM ERROR: Failed to allocate mmap’d buffer:

The on-device specializer dies on a graph carrying ~2 GB of constants.

creating engine (first run pays cold GPU specialization)...
LLVM ERROR: Failed to allocate mmap'd buffer: 
App terminated due to signal 6.

RuntimeError: MPSGraph Unresolved symbol (prepare/initialize)

The Python runtime’s AIModel.load(path, None) on the GPU path.

Error occurred when loading ANE module

An FP16 asset aborts the process on ANE load instead of returning an error; AIModel.load never returns, so nothing the caller writes can catch it.

Error = Error Domain=com.apple.appleneuralengine Code=53
  "createProgramInstanceForModel:...: Program load failed — no memory (transient; retry under lower
   memory pressure) (underlying=0x1)" UserInfo={_ANEErrorUnderlyingStatus=1, _ANEErrorLoadStage=4}

MPSGraphExecutable.mm:3543: failed assertion `Error occurred when loading ANE module:
  Error Domain=MPSGraph Code=-1 "MPSGraphExecutable_Project.h:510:: could not load module from
  MPSGraphPackage"'

_ANECompiler : ANECCompile() FAILED

Usually noise. MPSGraph probes the ANE, fails, and falls back to the GPU; the run completes. The full line, with its usual companion:

Error Domain=com.apple.appleneuralengine.compiler Code=1 "_ANECompiler : ANECCompile() FAILED"
... MLIR MPS to ANEC conversion failed

connection to service named com.apple.ANECompilerService

A 4B-class ANE bundle static-loads, then its first inference dies.

2026-06-27 03:30:01.851 AppleBenchRunner[5279:1373185] Error = Error Domain=com.apple.appleneuralengine Code=16 "compileAsNeededAndLoadCachedModel:...: file not found" ...
engine loaded in 518.421s
warmup trial...
2026-06-27 03:35:18.635 AppleBenchRunner[5279:1377845] Error = Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.ANECompilerService" ...
2026-06-27 03:35:18.635 AppleBenchRunner[5279:1377845] ANE compile failed!
LLVM ERROR: IO failure on output stream: No space left on device

Unable to use cached specializations and original module not available

An MPSGraph assertion (signal 6) at load, on a model that loaded yesterday.

MPSGraphAICodeCompilerDelegate getInitializedAICodeBytecodeWithPayloadPrefix:

A segfault inside the MPSGraph AICode compiler at AIModel(contentsOf:options:), with no error string and no partial output.

EXC_BAD_ACCESS (SIGSEGV) … MPSGraphAICodeCompilerDelegate getInitializedAICodeBytecodeWithPayloadPrefix:
  → Compiler_coreAI.compile(moduleBytecode:to:with:) → libODIECompiler … CompileForDelegates

libc++abi: terminating due to uncaught exception of type std::bad_alloc: std::bad_alloc

A C++ allocation failure the runtime does not turn into an error. Two verified sources.

creating engine (first run pays cold GPU specialization)...
libc++abi: terminating due to uncaught exception of type std::bad_alloc: std::bad_alloc
App terminated due to signal 6.

‘mps_spi.copy_discarding_constraints’ op input must have tensor constraints

MPSGraph refuses to lower a custom Metal kernel’s reshape at engine compile.

error: 'mps_spi.copy_discarding_constraints' op input must have tensor constraints   (op_id ~48, early)

error: ‘mps_spi.sdpa’ op failed: query and value must have matching inner dimension but have 192 and 128

MPSGraph’s fused SDPA takes one head_dim. The first engine run of the converted bundle dies at lowering, followed by the assertion in the next entry.

error: 'mps_spi.sdpa' op failed: query and value must have matching inner dimension but have 192 and 128
.../MPSGraphExecutable.mm:2300: failed assertion `Error: AICode -> MPS lowering failed'

Error: AICode -> MPS lowering failed

MPSGraphExecutable.mm:2300: failed assertion at GPU load. The line under it, or above it, names the op; two triggers verified here.


Execution (MPSGraph runtime assertions, Metal)

Failed to acquire the source buffer for the ViewOp

MPSGraph plans a fixed per-encode scratch heap; one allocation past it aborts the encode. The two lines always come together, and the numbers in the first one are the diagnosis:

allocateMTLBufferFromMTLHeap: offset 198400 + size 16384 exceeds heap total 212992
.../MPSRuntime/Operations/GPUMemrefOps.mm:687: failed assertion `Failed to acquire the source buffer for the ViewOp'
App terminated due to signal 6.

(GPUMemrefOps.mm:687 on the June builds, :700 in July, :707 on 24A5418b.)

GPUMemrefOps.mm:159: Failed to resolve dynamic dimensions for memref.alloc

The chunk → seq face of alternating entrypoints on iOS (see (f) above).

MPSNDArray.mm:893: failed assertion [MPSNDArray, initWithBufferImpl:…] Error: buffer is not large enough.

Three verified causes here, one third-party report; the byte count after Must be tells them apart.

MPSNDArray.mm:893: failed assertion `[MPSNDArray, initWithBufferImpl:...] Error: buffer is not large enough.
Must be 128 bytes'

Pass failed: MPSCommonRuntimeCanonicalization

A zero-length split section, never used, aborts the process at load on GPU and ANE; CPU runs it.

MPSGraphExecutable.mm:4419: failed assertion `Error: Optimize Original Module MLIR pass manager failed
Pass failed: MPSCommonRuntimeCanonicalization
Pass failed: mlir::detail::OpToOpPassAdaptor'

EXC_BREAKPOINT (SIGTRAP, code 5)

The fixed-shape / ANE decode recipe — a KV column written in-graph with slice_update at a runtime in_step index — converts fine and dies at the first execute on the WWDC26 betas.

The operation couldn’t be completed. (MTL4CommandQueueErrorDomain error 1.)

A Metal 4 command buffer dies; the run either wedges or degenerates. Seen on the Mac and on the iPhone.

	Error: 
	(null)
	The operation couldn’t be completed. (MTL4CommandQueueErrorDomain error 1.)
	<MTL3On4CommandBuffer: 0x7707400000>
Error: command buffer exited with error status.

Failed to import MPS module

The second-distinct-shape fault of (b) above, as Unlimited-OCR saw it: the first shape compiles and runs, the second recompile crashes. The fix is the fully static decode graph in unlimited-ocr-rswa-static-decode.md; an earlier reading of this string as “the custom MoE kernel is broken” was wrong — the kernel runs fine once shapes are static.

Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)

The Mac GPU runs out of memory on a JIT-loaded .aimodel.

CoreAIError 3

The call-time contract of an InferenceFunction: an NDArray whose dtype does not match the graph. Also printed as CoreAIRuntime error 3.

CoreAICompiler error 2

The CPU delegate cannot compile the graph (cpu_only); CoreAICompiler error 3 is the same class on other graphs. GPU compiles them.

‘scf.while’ region type mismatch

The MPSGraph GPU delegate rejects a torch.ops.higher_order.while_loop.


The Swift engines (apple/coreai-models: llm-runner, pipelined, sequential)

Shape at dimension 1 of 256 is not a valid substitution for source shape 1

A Swift trap while preparing the asset, before any token is bound. The 256 is a constant, not your prompt length — that is the fingerprint.

⏳ Preparing AI asset from source...CoreAIRuntime/NDArrayDescriptor.swift:139: Fatal error: Shape at dimension 1 of 256 is not a valid substitution for source shape 1

(NDArrayDescriptor.swift:136 on current main.)

invalidOutputType(“Expected 2 states (KV cache), got 4: [keyCache, valueCache, convState, recState]”)

Engine creation fails for every hybrid bundle on the stock engines.

CoreAI pipelined engine does not support logits (GPU-side sampling)

llm-runner --print-logits / --save-logits refused on a dynamic bundle (the default engine).

Token count (9) does not match logits count (8)

The sequential engine’s free-running --print-logits / --save-logits abort after generation with one fewer logits row than tokens (the numbers scale with --max-tokens: 7 vs 6 at 6).

–continuation requires text prompt (–prompt or –prompt-file), not –raw-tokens

Usage constraint of the teacher-forced path, as printed. Give the context as text and verify the Context tokens: count, as in CoreAI pipelined engine does not support logits.


Around the runtime (disk, devicectl, swift-transformers, FoundationModels)

LLVM ERROR: IO failure on output stream: No space left on device

Core AI’s compile paths write multi-GB scratch and cache; when the volume fills, the failure surfaces here — or as something that looks like a bug. Four verified sources.

LLVM ERROR: IO failure on output stream: No space left on device

unsupportedTokenizer

swift-transformers rejects an unregistered tokenizer_class.

GenerationError.decodingFailure

FoundationModels rejects what the model generated (“failed to parse generated content”).

CoreDeviceError 4016

devicectl cannot install or launch: the device screen is locked. Set Auto-Lock to Never for a device session. (… powerAssertionTaken in the same domain means the device was already going down.) Record: bitvla-1.58bit-vla.md, ~/code/coreai/SPEC35_HYBRID_S_WINDOW_STATE.md.


Unable to resolve module dependency: ‘CoreAI’

.../coreai-models/swift/Sources/CoreAIShared/Runtime/ModelStructure.swift:6:8: error: Unable to resolve module dependency: 'CoreAI' (in target 'CoreAIShared' from project 'coreai-models')
    note: A dependency of main module 'CoreAIShared'

When there is no string

Some aborts print nothing useful. What was learned about each:

Maintaining this page

Add an entry when a run prints a string that is not here, in the section for the stage that printed it; the H2 is the string verbatim, backticks dropped. Fill the cause only with what was isolated; write “Not isolated” otherwise. Name the log file or the issue. When Apple fixes one, keep the entry and add the build the fix was measured on — a release note is not a measurement. cli/coreai_doctor.py links its rules here by anchor, and cli/selftest.py fails if an anchor it links to disappears, so rename a heading only together with the doctor.