This document is relevant for: Trn2, Trn3

nki#

The nki module provides the top-level entry points for compiling and running NKI kernels. Use the jit() decorator to compile a kernel for NeuronDevices, simulate() / multi_rank_simulate() to run a kernel in the CPU simulator for debugging, or execute() / multi_rank_execute() to run a kernel on Neuron hardware without a machine learning framework.

NKI Decorators#

Compile and run decorated kernels on Neuron hardware.

jit

Just-in-time compile a top-level NKI function to run on NeuronDevices.

NKI Simulator#

Run a kernel on the CPU without Neuron hardware.

simulate

Create a CPU-simulated version of an NKI kernel.

multi_rank_simulate

Run a kernel across multiple ranks in one CPU process.

NKI Standalone#

Run a kernel on Neuron hardware without a machine learning framework.

execute

Specializes a kernel into a NEFF (Neuron Executable File Format) and executes it on hardware.

multi_rank_execute

Specializes a kernel into a NEFF (Neuron Executable File Format) and executes it on hardware across multiple ranks.

This document is relevant for: Trn2, Trn3