Quickstart Guide#
Welcome to NKIPy! This guide will help you get started quickly.
Installation#
For installation instructions, see the README or the detailed Installation Guide.
Quick install with uv:
git clone https://github.com/aws-neuron/nkipy.git
cd nkipy
uv sync
Basic Usage#
NKIPy kernels can run in three modes:
Pure NumPy (CPU) - Run kernels directly as NumPy code for prototyping
Simulation Mode - Use
@simulate_jitto trace and simulate executionTrainium Hardware - Use
@baremetal_jitto compile and run on Trainium
For complete code examples, see the Basic Usage section in the README.
Learning Path#
1. Start with Tutorials#
The best way to learn NKIPy is through hands-on tutorials:
Simple Tutorial - Learn the basics with a softmax kernel
Define a NKIPy kernel
Run as NumPy, simulation, and on Trainium hardware
Understand tracing and compilation
NKIPy to NKI - Learn how NKIPy lowers to NKI code
MLP Tutorial - Build a multi-layer perceptron
See all tutorials in the Tutorials Index.
2. Explore Examples#
Check out the examples/ directory for more complex use cases:
examples/playground/simple_nkipy_kernel.py- Simple standalone exampleexamples/models/qwen3_embedding/- Full model implementation
3. Dive Deeper#
Once you’re comfortable with the basics:
User Guide - Understand NKIPy’s architecture
API Reference - Detailed API documentation
Developer Guide - Contribute to NKIPy
Key Concepts#
Tracing: NKIPy traces your NumPy-like code to build a computation graph
Compilation: The traced graph is lowered and compiled to binary
Execution: Compiled kernels run on Trainium hardware
Getting Help#
Check Known Issues for common problems
Report bugs via GitHub Issues
See the README FAQ for common questions