---
title: Inspecting Core AI models with Core AI Debugger
framework: coreai
role: article
role_heading: Article
path: coreai/inspecting-core-ai-models-with-core-ai-debugger
---

# Inspecting Core AI models with Core AI Debugger

Verify model correctness by inspecting the operations and comparing tensor outputs.

## Overview

Overview Core AI Debugger is a standalone app for inspecting a Core AI model asset (.aimodel). The debugger follows a three-step workflow: visualize, execute, and validate. You visualize the model first to understand its structure, then execute the model to produce tensor outputs for each operation, and finally compare those outputs against a reference run to validate correctness. To download the app, see the Core AI Debugger page. note: If you have a PyTorch model that needs to be converted to an .aimodel, see the coreai-torch documentation for guidance on how to convert your model. Navigate the workspace The Core AI Debugger workspace includes a Navigator panel on the left, Structure and Source Viewers in the middle, and an Inspector to the right.

Use the Navigator to explore, sort, and filter model operations. The Structure Viewer shows a graphical representation of the model as a series of connected operations, while the Source Viewer shows the model’s original Python source code, alongside a structured module hierarchy. Use the Inspector to see detailed metadata about the selected operation, including its description, inputs, and outputs. The workspace stays synchronized around the selected operation, so you can move fluidly between structure, source, and execution details. Visualize model structure Opening an .aimodel file loads the model’s operations, structure, and source. Operations in the Navigator are organized by their PyTorch module. Selecting a module highlights the corresponding operations in the Structure Viewer, revealing their connectivity, data dependencies, and execution order. Clicking a specific operation highlights its Python source line in the Source Viewer. The Inspector shows additional details about the selected operation, including tensor formats of its inputs and outputs.

The source-level features, including source line and PyTorch module mappings, require debug metadata embedded in the .aimodel at export time. Without this operation-level metadata, you can still view model operations in the Navigator, Structure Viewer, and the Inspector, but the Source Viewer is unavailable. note: See the coreai-torch documentation for details on how to export your model with debug metadata. Execute on specific hardware Configure a specialization scheme before executing your model. The scheme settings let you specify a hardware target, compute unit, and model inputs using predefined tensors (zeros, ones, or random) or values from a NumPy file.

Clicking Run specializes the model for the selected target, optimizing it for that hardware’s capabilities. The Structure Viewer updates to show the specialized model exactly as it executes on the chosen device. After running, click any operation in the Navigator or Structure Viewer to see its output tensor directly in the Inspector.

Validate inference correctness A comparison session lets you identify where your model’s results diverge from a reference result. The debugger supports two comparison configurations: Validate against a reference run. Run your model in PyTorch and export the intermediate tensor values to an aimodelintermediates file using the coreai-torch API. Open that file alongside your .aimodel to compare the results. For a detailed walkthrough, see Validating inference correctness against a reference run.

Validate across configurations. Configure two runs of the same .aimodel to compare execution across different hardware targets, compute units, or inputs. Core AI Debugger compares two inference runs using sync points: operation pairs whose outputs are expected to match. When a comparison session starts, the debugger automatically identifies sync points and computes similarity metrics for each one so you can pinpoint where inference diverges.

## See Also

### Model inspection and validation

- [Validating inference correctness against a reference run](coreai/validating-inference-correctness-against-a-reference-run.md)
