Discuss Core AI, Apple's new framework for deploying AI models on-device. Explore Python libraries for converting and optimizing models, the Swift API for plug-and-play inference, deep Xcode integration, and ahead-of-time model compilation.

Core AI Documentation

Posts under Core AI subtopic

Post

Replies

Boosts

Views

Activity

Core AI on iOS/macOS 27: seven issues found while porting an SDXL pipeline
We ported a complete Stable Diffusion XL (Lightning) pipeline to Core AI which we previously had on Core ML. The pipeline comprises text encoders, a ViT-H image encoder, ControlNet, the UNet and the VAE decoder. It works very well: on iPhone 17 Pro and M1 iPad Pro it generates 1.4–1.6x faster than our Core ML pipeline at the same image quality. However, along the way, we hit seven issues. Each one is filed with a small self-contained repro. We're posting them here together for visibility, with our workarounds, in case others run into the same problems. Ahead-of-time compilation (coreai-build compile) Each of these gives wrong results on the Neural Engine with no error. The same .aimodel specialized on the device is correct. FB25067476: A 3×3 fp16 conv with a large output returns a wrong bottom half (16.7 dB vs 60.7 dB for the top half). This depends on the chip: 256×512×512 fails on M3 Pro and A19 Pro, while 256×384×384 fails only on M1. Our workaround: split such convs by output channels so that no single output exceeds about 128×384×384. FB25067497: A nearest 2× upsample followed by a 3×3 fp16 conv returns output unrelated to the correct result (correlation 0.02) on all three chips. The upsample alone and the conv alone are correct. Our workaround:* write the upsample as repeat_interleave(4) + pixel_shuffle(2). FB25067530: A 3×3 stride-2 conv with 8-bit palettized weights is wrong (16 dB) on all three chips. The same conv with fp16 weights, or palettized with stride 1, is correct. Our workaround:* a 2×2 pixel unshuffle followed by a 2×2 conv. Caching and loading FB25066222: The cache for ahead-of-time compiled .aimodelc files is keyed by the outer program only (main.hash), not the weights, so a weights-only model update silently runs the old weights. On iOS, the Neural Engine program cache is also keyed by function name per app, and survives AIModelCache.deleteAll() and deleting the app. Our workaround: append a hash of the model's content to every function name. FB25066664: On macOS, ahead-of-time builds of transformer models load 3–4× slower than on-device specialization, and parallel loads finish one at a time. Precompiling therefore made our Mac first launch slower (1152 s vs about 650 s), not faster. Neural Engine runtime (Mac) FB25067019: The built-in GroupNorm returns wrong results on the Mac's Neural Engine for large inputs (GroupNorm(32, 256) on 1×256×256×256: 21.7 dB), while the GPU and CPU are correct (84 dB). Our workaround: compute the means and variance explicitly. FB25064649: A ViT-H vision tower with an 8-bit palettized 14×14/stride-14 patch conv aborts the process on the Mac's Neural Engine (MPSGraph ANE error -19). Our workaround: keep the patch conv in fp16, or use a pixel unshuffle followed by a 1×1 conv. Environment macOS 27.0.1 (26A434), iOS/iPadOS 27.0.1 (24A446) Xcode 27.0, Metal Toolchain 27.1.266.1 (coreai-build 3600.83.1), coreai-torch 0.4.3 Tested on M3 Pro, iPhone 17 Pro and M1 iPad Pro We're happy to provide more data. We'd also like to hear whether others see the ahead-of-time issues on other chips.
0
3
184
2w
On Siri & Apple Intelligence
Regarding the 'weight list' of Siri: can you all provide technical specifics on how a model qualifies for this list, and can a developer-supplied model/adapter ever handle requests that originate from the system-wide Siri interface?
2
0
987
Sep ’26
Does Core AI / MLX already cover custom orchestration (queuing, batching, memory management, failover) or is that left to the developer?
I’m evaluating a third-party Swift-based “orchestration layer” for enterprise AI workloads on Apple Silicon — it claims to handle job queuing, scheduling, batching, memory management, monitoring, auditing, and failover on top of on-device inference. Given the Core AI framework’s device-specialization step and InferenceFunction pipeline (and MLX’s unified-memory model), how much of this kind of orchestration is already handled natively versus something a developer would still need to build themselves? Specifically: 1. Does Core AI’s inference pipeline provide any built-in job queuing/batching across multiple concurrent requests, or is that entirely app-side? 2. Is there native failover/monitoring tooling for on-device inference, or would a developer need to build that themselves (e.g., via os_log, MetricKit, custom retry logic)? 3. For memory management across CPU/GPU/ANE, does unified memory in MLX/Core AI eliminate most of the manual management a custom orchestration layer would otherwise need to solve? Trying to understand what’s genuinely differentiated in a third-party layer versus what Apple’s stack already provides out of the box. Appreciate any insight from folks who’ve built with Core AI/MLX in production.
0
0
384
Aug ’26
Tengo a la versión Beta de Siri.
Está indexando en segundo, plano, pero no me aparece el 100, para Inhabilitar el software que se quede atrás, para evitar el cidrado extremo, no tengo la membresia debido a que estoy dado de alta como como Desarrolador, y Siri es la que encripta mis datos en la nube, con Intelligence, como mi teléfono está intervenido, es imposible que se libere el Xcode, sin embargo necesito el rotor del segundo plano, ya que la programación funcionó, y El sistema está trabajando al cien, solo necesito acceder al rotor del segundo plano
0
0
447
Aug ’26
Xcode treats a `.llmasset` bundle as individual `.aimodel` files to compile, instead of copying it as-is
I have a Core AI model export — a bundle folder (.llmasset, containing multiple .aimodel subfolders plus metadata/tokenizer resources) — added to my app target as a folder reference. Rather than treating the bundle as one opaque resource and copying it into the app bundle as-is (the way .xcassets, .bundle, or any other folder reference behaves), Xcode reaches into it, finds the individual .aimodel subfolders, and adds each one to Compile Sources. When it compiles them there, it's for my build machine's specific chip only — I can't find any setting (Build Settings, scheme, target picker) to compile for multiple architectures/platforms, the way a universal binary would work. Question: Is there a way to make Xcode treat a .llmasset bundle as an atomic resource — copied wholesale, not decomposed into individual .aimodel compile targets? Or is reaching into the bundle and AOT-compiling its components for the active build architecture the intended behavior here, and if so, what's the recommended way to make sure the result works across the actual range of devices the app ships to?
1
0
447
Aug ’26
Core AI vs LiteRT
I am trying to decide what technology to adopt for local AI inference on mobile devices. I tried the EdgeGallery demo app and was genuinely impressed. For an app using local Gemma 4, LiteRT-LM gives me a shared, OS-managed model on Android via AICore, up-to-date Gemma 4 support, and a working ANE/Core ML delegate on iOS today. What does building on Core AI’s .aimodel pipeline get me that LiteRT-LM doesn’t? Core AI has no cross-app shared memory, and every app has to bring its own model resources regardless. Also, the current model catalog seems to trail LiteRT’s. What am I missing?
0
0
568
Jul ’26
Core AI Debugger Beta Questions
Hi guys, I am a new core developer. Recently I am trying the newly released core ai debugger tool and meet some issues. I am not sure whether the related functions of debugger is ready in beta package. Reference Run: aimodel on device versus intermediate dump I used the intermediate exporting api to export the intermediate dump data of MobileNet2.0 and converted the same MobileNet Model to .aimodel. But the compare button is not usable. the suffix of intermediate file suffix is OK(can be selected). The debugger is a GUI so I cannot figure out whether I exported the intermediate data incorrectly. (1st attached png ) on device model run compare I just simply tried the different computing unit and different input for a simple 'add/sub/mul/div' toy model. Especially set the input different but the comparison results seems to be empty I am not sure whether I modify the debugger tool incorrectly. Hope someone sharing experience. My Gratitude.
0
0
550
Jun ’26
No such module 'CoreAI'
Hi everyone, Recently I downloaded the last XCode (Version 27.0 beta) and I'm trying to start to play with CoreAI but it's not possible so far to import the CoreAI framework. I'm using the last version of the iPhone simulator. What am I missing?
1
0
911
Jun ’26
Compute unit specification for function runs
When we specialize with preferredComputeUnitKind: .neuralEngine, the resolved options' allowedComputeUnitKinds return all three units, and sometimes a function we intend for ANE ends up on the GPU. We can't find any API that reports where a function actually ran, but system resource utilization shows a GPU spike. Is there a supported way to confirm the actual compute unit at runtime? And how does your prioritization work if we prefer running on the ANE rather than the GPU? Or, can we disallow certain compute units? How does this compute unit selection map with someone coming from CoreML where the desired compute units were honored?
1
0
633
Jun ’26
Ahead-of-time (AOT) compilation for older devices
Will ahead of time compilation stay limited to A17 Pro and M1 class hardware? Docs indicate that AOT compilation is only supported for A17 Pro/M1 and newer. iOS 27 supports iPhone 11 (A13) and newer. AOT can't be used on A13-A16 which is a substantial fraction of active user devices in 2026 Is there a path to AOT on older Apple Silicon chips (A14 and newer) down the line? If not, I am afraid, the impact of AOT will be delayed by 3-4 years until it can be broadly leveraged.
1
7
703
Jun ’26
Ahead-of-time (AOT) compilation for older devices
Will ahead of time compilation stay limited to A17 Pro and M1 class hardware? Docs indicate that AOT compilation is only supported for A17 Pro/M1 and newer. iOS 27 supports iPhone 11 (A13) and newer. AOT can't be used on A13-A16 which is a substantial fraction of active user devices in 2026 Is there a path to AOT on older Apple Silicon chips (A14 and newer) down the line? If not, I am afraid, the impact of AOT will be delayed by 3-4 years until it can be broadly leveraged.
3
1
752
Jun ’26
On Model Control & Metadata
While response.usage provides token counts and reasoning signals, are there plans to expose per-token logprobs or confidence scores to help developers build more robust 'evaluators' for non-deterministic outputs?
1
0
618
Jun ’26
Mixing Core AI and Core ML in one pipeline
We built a setup where a model split into an encoder and a decoder can run each part on a different backend, using our own component protocols. Is mixing Core AI and Core ML within a single inference pass something you would recommend, and what is the realistic cost at the boundary where we convert between MLMultiArray / MLTensor and NDArray? Is there a way to keep the encoder output resident on the GPU or ANE so it does not need a host round trip into the other backend?
2
1
766
Jun ’26
Core AI on iOS/macOS 27: seven issues found while porting an SDXL pipeline
We ported a complete Stable Diffusion XL (Lightning) pipeline to Core AI which we previously had on Core ML. The pipeline comprises text encoders, a ViT-H image encoder, ControlNet, the UNet and the VAE decoder. It works very well: on iPhone 17 Pro and M1 iPad Pro it generates 1.4–1.6x faster than our Core ML pipeline at the same image quality. However, along the way, we hit seven issues. Each one is filed with a small self-contained repro. We're posting them here together for visibility, with our workarounds, in case others run into the same problems. Ahead-of-time compilation (coreai-build compile) Each of these gives wrong results on the Neural Engine with no error. The same .aimodel specialized on the device is correct. FB25067476: A 3×3 fp16 conv with a large output returns a wrong bottom half (16.7 dB vs 60.7 dB for the top half). This depends on the chip: 256×512×512 fails on M3 Pro and A19 Pro, while 256×384×384 fails only on M1. Our workaround: split such convs by output channels so that no single output exceeds about 128×384×384. FB25067497: A nearest 2× upsample followed by a 3×3 fp16 conv returns output unrelated to the correct result (correlation 0.02) on all three chips. The upsample alone and the conv alone are correct. Our workaround:* write the upsample as repeat_interleave(4) + pixel_shuffle(2). FB25067530: A 3×3 stride-2 conv with 8-bit palettized weights is wrong (16 dB) on all three chips. The same conv with fp16 weights, or palettized with stride 1, is correct. Our workaround:* a 2×2 pixel unshuffle followed by a 2×2 conv. Caching and loading FB25066222: The cache for ahead-of-time compiled .aimodelc files is keyed by the outer program only (main.hash), not the weights, so a weights-only model update silently runs the old weights. On iOS, the Neural Engine program cache is also keyed by function name per app, and survives AIModelCache.deleteAll() and deleting the app. Our workaround: append a hash of the model's content to every function name. FB25066664: On macOS, ahead-of-time builds of transformer models load 3–4× slower than on-device specialization, and parallel loads finish one at a time. Precompiling therefore made our Mac first launch slower (1152 s vs about 650 s), not faster. Neural Engine runtime (Mac) FB25067019: The built-in GroupNorm returns wrong results on the Mac's Neural Engine for large inputs (GroupNorm(32, 256) on 1×256×256×256: 21.7 dB), while the GPU and CPU are correct (84 dB). Our workaround: compute the means and variance explicitly. FB25064649: A ViT-H vision tower with an 8-bit palettized 14×14/stride-14 patch conv aborts the process on the Mac's Neural Engine (MPSGraph ANE error -19). Our workaround: keep the patch conv in fp16, or use a pixel unshuffle followed by a 1×1 conv. Environment macOS 27.0.1 (26A434), iOS/iPadOS 27.0.1 (24A446) Xcode 27.0, Metal Toolchain 27.1.266.1 (coreai-build 3600.83.1), coreai-torch 0.4.3 Tested on M3 Pro, iPhone 17 Pro and M1 iPad Pro We're happy to provide more data. We'd also like to hear whether others see the ahead-of-time issues on other chips.
Replies
0
Boosts
3
Views
184
Activity
2w
On Siri & Apple Intelligence
Regarding the 'weight list' of Siri: can you all provide technical specifics on how a model qualifies for this list, and can a developer-supplied model/adapter ever handle requests that originate from the system-wide Siri interface?
Replies
2
Boosts
0
Views
987
Activity
Sep ’26
Does Core AI / MLX already cover custom orchestration (queuing, batching, memory management, failover) or is that left to the developer?
I’m evaluating a third-party Swift-based “orchestration layer” for enterprise AI workloads on Apple Silicon — it claims to handle job queuing, scheduling, batching, memory management, monitoring, auditing, and failover on top of on-device inference. Given the Core AI framework’s device-specialization step and InferenceFunction pipeline (and MLX’s unified-memory model), how much of this kind of orchestration is already handled natively versus something a developer would still need to build themselves? Specifically: 1. Does Core AI’s inference pipeline provide any built-in job queuing/batching across multiple concurrent requests, or is that entirely app-side? 2. Is there native failover/monitoring tooling for on-device inference, or would a developer need to build that themselves (e.g., via os_log, MetricKit, custom retry logic)? 3. For memory management across CPU/GPU/ANE, does unified memory in MLX/Core AI eliminate most of the manual management a custom orchestration layer would otherwise need to solve? Trying to understand what’s genuinely differentiated in a third-party layer versus what Apple’s stack already provides out of the box. Appreciate any insight from folks who’ve built with Core AI/MLX in production.
Replies
0
Boosts
0
Views
384
Activity
Aug ’26
Tengo a la versión Beta de Siri.
Está indexando en segundo, plano, pero no me aparece el 100, para Inhabilitar el software que se quede atrás, para evitar el cidrado extremo, no tengo la membresia debido a que estoy dado de alta como como Desarrolador, y Siri es la que encripta mis datos en la nube, con Intelligence, como mi teléfono está intervenido, es imposible que se libere el Xcode, sin embargo necesito el rotor del segundo plano, ya que la programación funcionó, y El sistema está trabajando al cien, solo necesito acceder al rotor del segundo plano
Replies
0
Boosts
0
Views
447
Activity
Aug ’26
Xcode treats a `.llmasset` bundle as individual `.aimodel` files to compile, instead of copying it as-is
I have a Core AI model export — a bundle folder (.llmasset, containing multiple .aimodel subfolders plus metadata/tokenizer resources) — added to my app target as a folder reference. Rather than treating the bundle as one opaque resource and copying it into the app bundle as-is (the way .xcassets, .bundle, or any other folder reference behaves), Xcode reaches into it, finds the individual .aimodel subfolders, and adds each one to Compile Sources. When it compiles them there, it's for my build machine's specific chip only — I can't find any setting (Build Settings, scheme, target picker) to compile for multiple architectures/platforms, the way a universal binary would work. Question: Is there a way to make Xcode treat a .llmasset bundle as an atomic resource — copied wholesale, not decomposed into individual .aimodel compile targets? Or is reaching into the bundle and AOT-compiling its components for the active build architecture the intended behavior here, and if so, what's the recommended way to make sure the result works across the actual range of devices the app ships to?
Replies
1
Boosts
0
Views
447
Activity
Aug ’26
Core AI vs LiteRT
I am trying to decide what technology to adopt for local AI inference on mobile devices. I tried the EdgeGallery demo app and was genuinely impressed. For an app using local Gemma 4, LiteRT-LM gives me a shared, OS-managed model on Android via AICore, up-to-date Gemma 4 support, and a working ANE/Core ML delegate on iOS today. What does building on Core AI’s .aimodel pipeline get me that LiteRT-LM doesn’t? Core AI has no cross-app shared memory, and every app has to bring its own model resources regardless. Also, the current model catalog seems to trail LiteRT’s. What am I missing?
Replies
0
Boosts
0
Views
568
Activity
Jul ’26
Core AI Debugger Beta Questions
Hi guys, I am a new core developer. Recently I am trying the newly released core ai debugger tool and meet some issues. I am not sure whether the related functions of debugger is ready in beta package. Reference Run: aimodel on device versus intermediate dump I used the intermediate exporting api to export the intermediate dump data of MobileNet2.0 and converted the same MobileNet Model to .aimodel. But the compare button is not usable. the suffix of intermediate file suffix is OK(can be selected). The debugger is a GUI so I cannot figure out whether I exported the intermediate data incorrectly. (1st attached png ) on device model run compare I just simply tried the different computing unit and different input for a simple 'add/sub/mul/div' toy model. Especially set the input different but the comparison results seems to be empty I am not sure whether I modify the debugger tool incorrectly. Hope someone sharing experience. My Gratitude.
Replies
0
Boosts
0
Views
550
Activity
Jun ’26
Core AI ComputeStream Init Function question.
Does this API only work for inference running on the GPU? If the inference runs on the ANE, can I still use this API? I noticed that the commandQueue parameter is an MTLCommandqueue? https://developer.apple.com/documentation/coreai/computestream/init(commandqueue:)
Replies
1
Boosts
0
Views
608
Activity
Jun ’26
No such module 'CoreAI'
Hi everyone, Recently I downloaded the last XCode (Version 27.0 beta) and I'm trying to start to play with CoreAI but it's not possible so far to import the CoreAI framework. I'm using the last version of the iPhone simulator. What am I missing?
Replies
1
Boosts
0
Views
911
Activity
Jun ’26
For Model Control & Metadata
Is there a supported way to 'pin' an app to a specific version of an on-device system model to prevent regression in agentic workflows & what is the typical update cadence for these weights?
Replies
1
Boosts
1
Views
655
Activity
Jun ’26
Compute unit specification for function runs
When we specialize with preferredComputeUnitKind: .neuralEngine, the resolved options' allowedComputeUnitKinds return all three units, and sometimes a function we intend for ANE ends up on the GPU. We can't find any API that reports where a function actually ran, but system resource utilization shows a GPU spike. Is there a supported way to confirm the actual compute unit at runtime? And how does your prioritization work if we prefer running on the ANE rather than the GPU? Or, can we disallow certain compute units? How does this compute unit selection map with someone coming from CoreML where the desired compute units were honored?
Replies
1
Boosts
0
Views
633
Activity
Jun ’26
Ahead-of-time (AOT) compilation for older devices
Will ahead of time compilation stay limited to A17 Pro and M1 class hardware? Docs indicate that AOT compilation is only supported for A17 Pro/M1 and newer. iOS 27 supports iPhone 11 (A13) and newer. AOT can't be used on A13-A16 which is a substantial fraction of active user devices in 2026 Is there a path to AOT on older Apple Silicon chips (A14 and newer) down the line? If not, I am afraid, the impact of AOT will be delayed by 3-4 years until it can be broadly leveraged.
Replies
1
Boosts
7
Views
703
Activity
Jun ’26
Ahead-of-time (AOT) compilation for older devices
Will ahead of time compilation stay limited to A17 Pro and M1 class hardware? Docs indicate that AOT compilation is only supported for A17 Pro/M1 and newer. iOS 27 supports iPhone 11 (A13) and newer. AOT can't be used on A13-A16 which is a substantial fraction of active user devices in 2026 Is there a path to AOT on older Apple Silicon chips (A14 and newer) down the line? If not, I am afraid, the impact of AOT will be delayed by 3-4 years until it can be broadly leveraged.
Replies
3
Boosts
1
Views
752
Activity
Jun ’26
On Model Control & Metadata
While response.usage provides token counts and reasoning signals, are there plans to expose per-token logprobs or confidence scores to help developers build more robust 'evaluators' for non-deterministic outputs?
Replies
1
Boosts
0
Views
618
Activity
Jun ’26
Mixing Core AI and Core ML in one pipeline
We built a setup where a model split into an encoder and a decoder can run each part on a different backend, using our own component protocols. Is mixing Core AI and Core ML within a single inference pass something you would recommend, and what is the realistic cost at the boundary where we convert between MLMultiArray / MLTensor and NDArray? Is there a way to keep the encoder output resident on the GPU or ANE so it does not need a host round trip into the other backend?
Replies
2
Boosts
1
Views
766
Activity
Jun ’26