Announcing changes to NKI specialization#

Starting with Neuron Release 2.33.0 (NKI 0.7.0), NKI specializes kernels by tracing them with Python. During tracing, each NKI API call records an operation in an intermediate representation (IR), which NKI then compiles. Previous versions specialized kernels with dedicated compiler lowering passes. Compilation and execution are unchanged. For how specialization, compilation, and execution fit together, see the NKI Language Guide.

Kernel developers can now use the full Python language during specialization, including generators and class inheritance. NKI meta-programming follows standard Python semantics.

Kernels that use nl.dynamic_range or while loops with a virtual register must move to nki.language.fori_loop() and nki.language.while_loop(). Kernels that use == on user-defined classes can behave differently. For details, see Migrating from NKI 0.6.0 to NKI 0.7.0.

To keep the previous specialization while migrating a kernel, set NKI_COMPILER_FRONTEND=custom. This setting is deprecated in Neuron 2.33.0 and will be removed along with the dedicated lowering passes in the next Neuron release.