Inspecting, debugging, and profiling Core AI models
Investigate model behavior, monitor activity, and profile performance using the Core AI tools across Xcode and the Core AI Debugger app.
Overview
Core AI provides three tools to help you investigate model behavior, monitor activity, and profile performance. Use them as needed while authoring a model, after integrating it, or when your app is running.
Core AI Debugger: A standalone macOS app for inspecting model structure, running models, and validating inference against reference data.
Core AI debug gauge: An Xcode feature that monitors model load, specialization, and inference activity in real time during a debug session.
Core AI instrument: An Instruments template that profiles execution timing across the CPU, GPU, and Neural Engine.
The Core AI debug gauge and Core AI instrument focus on a model that’s already running inside your app. Core AI Debugger works directly with the .aimodel file and gives you a closer look when something the gauge or instrument flags needs deeper inspection. The tools share data, so a finding in one often leads to a closer look in another.
[Image]
For project setup, the Xcode model viewer, and how to load a model in your app, see Integrating on-device AI models in your app with Core AI.
Inspect and compare model files in Core AI Debugger
Core AI Debugger is a standalone macOS app that you download from the Core AI Debugger for working directly with .aimodel files. You can inspect a model’s operation graph, step through the source that produced each operation, and run the model against a connected device or your Mac.
The debugger also allows you to compare pairs of a model’s output against a reference run, helping you confirm whether a converted or optimized model still produces the results you expect.
See Inspecting Core AI models with Core AI Debugger for inspection and execution, and Validating inference correctness against a reference run for comparing a model against a reference run.
Perform inference checks with the Core AI debug gauge
Built into Xcode, the Core AI debug gauge tracks each model load, specialization, and inference event in real time. Use it to confirm that your model loads when you expect it to, to spot unusually slow inference, or to find a specific event you want to investigate further. The Core AI debug gauge can hand a captured event off to Core AI Debugger for structural inspection, or to the Core AI instrument for deeper profiling.
For details, see Monitoring model performance with the debug gauge.
Analyze model performance with the Core AI instrument
The Core AI instrument is a template in Instruments that profiles your app’s Core AI activity with detailed timing across the CPU, GPU, and Neural Engine. Use it when you need detailed performance information, such as which compute units run your model, whether specialization happens when you expect, and how often your app reloads a model. The trace correlates Core AI events with hardware activity so you can see the full picture of execution.
For details, see Analyzing model runtime performance with Instruments.
Topics
Runtime monitoring and analysis
Monitoring model performance with the debug gaugeAnalyzing model runtime performance with Instruments