This document is relevant for: Trn2, Trn3

NKI Guides#

Explore kernel tutorials, architecture references, and guides for developing and integrating NKI kernels.

Tutorials#

NKI Tutorials

Follow the five tutorials on tiled programming in order, or explore individual tutorials on kernel operations and optimization.

Architecture Guides#

Neuron recommends new NKI developers start with Trainium/Inferentia2 Architecture Guide before exploring newer NeuronDevice architecture.

Trainium/Inferentia2 Architecture Guide

Foundational architecture guide for understanding NeuronDevice basics.

Trainium2 Architecture Guide

Architecture enhancements and improvements in the Trainium2 generation.

Trainium3 Architecture Guide

Latest architecture features and capabilities in Trainium3 devices.

How-To Guides#

How to use the NKI CPU Simulator

Develop and debug NKI kernels on your CPU with no hardware required.

How to Insert NKI Kernels into Models

How to insert a NKI kernel as a custom operator into a PyTorch or JAX model using simple code examples.

How to Use the NKI Scheduling APIs

Control instruction execution order using dependency edges and no-reorder blocks for kernel performance optimization.

How to tune a NKI kernel with CompileConfig

Select CompileConfig options for a kernel by profiling NKI allocation and each optimization against a baseline.

Profiling a NKI Kernel with Neuron Explorer

Profile NKI kernels using Neuron Explorer to analyze hardware-level performance.

This document is relevant for: Trn2, Trn3