.. meta::
    :description: Guides for AWS Neuron Kernel Interface (NKI), including architectures, tutorials for implementing and optimizing kernels, and how to use kernels with common frameworks.
    :keywords: NKI, AWS Neuron, Guides, Tutorials, how-to
    :date-modified: 2026-10-09

.. _nki-guides:

NKI Guides
===========

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

Tutorials
---------

.. grid:: 1
   :gutter: 3

   .. grid-item-card:: NKI Tutorials
      :link: nki-tutorials
      :link-type: ref
      :class-body: sphinx-design-class-title-small

      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 :doc:`Trainium/Inferentia2 Architecture Guide </nki/guides/architecture/trainium_inferentia2_arch>` before exploring newer NeuronDevice architecture.

.. grid:: 1
   :gutter: 3

   .. grid-item-card:: Trainium/Inferentia2 Architecture Guide
      :link: trainium_inferentia2_arch
      :link-type: ref
      :class-body: sphinx-design-class-title-small

      Foundational architecture guide for understanding NeuronDevice basics.

.. grid:: 1 1 2 2
   :gutter: 3

   .. grid-item-card:: Trainium2 Architecture Guide
      :link: trainium2_arch
      :link-type: ref
      :class-body: sphinx-design-class-title-small

      Architecture enhancements and improvements in the Trainium2 generation.

   .. grid-item-card:: Trainium3 Architecture Guide
      :link: trainium3_arch
      :link-type: ref
      :class-body: sphinx-design-class-title-small

      Latest architecture features and capabilities in Trainium3 devices.

How-To Guides
-------------

.. grid:: 1 1 2 2
   :gutter: 3

   .. grid-item-card:: How to use the NKI CPU Simulator
      :link: nki-simulator
      :link-type: ref
      :class-body: sphinx-design-class-title-small

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

   .. grid-item-card:: How to Insert NKI Kernels into Models
      :link: nki_framework_custom_op
      :link-type: ref
      :class-body: sphinx-design-class-title-small

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

   .. grid-item-card:: How to Use the NKI Scheduling APIs
      :link: how-to-scheduling-apis
      :link-type: doc
      :class-body: sphinx-design-class-title-small

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

   .. grid-item-card:: How to tune a NKI kernel with CompileConfig
      :link: nki-compile-config-tuning-how-to
      :link-type: ref
      :class-body: sphinx-design-class-title-small

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

   .. grid-item-card:: Profiling a NKI Kernel with Neuron Explorer
      :link: /nki/guides/use-neuron-profile
      :link-type: doc
      :class-body: sphinx-design-class-title-small

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

.. toctree::
   :maxdepth: 1
   :hidden:

   Tutorials </nki/guides/tutorials/index>
   Architecture </nki/guides/architecture/index>
   NKI CPU Simulator </nki/guides/nki_simulator>
   Insert NKI Kernels into Models </nki/guides/framework_custom_op>
   Use NKI Scheduling APIs </nki/guides/how-to-scheduling-apis>
   Tune a kernel with CompileConfig </nki/guides/how-to-tune-compile-config>
   Profile a NKI Kernel </nki/guides/use-neuron-profile>
