nki.language#
Creation operations#
Create a new tensor of given shape and dtype on the specified buffer. |
|
Create a new tensor of given shape and dtype on the specified buffer, filled with zeros. |
Tensor manipulation operations#
Construct a dynamic slice for simple tensor indexing. |
Iterators#
Create a sequence of numbers for use as loop iterators in NKI, resulting in a fully unrolled loop. |
|
Create a sequence of numbers for use as parallel loop iterators in NKI. |
|
Create a sequence of numbers for use as sequential loop iterators in NKI. |
Memory Hierarchy#
PSUM - Only visible to each individual kernel instance in the SPMD grid |
|
State Buffer - Only visible to each individual kernel instance in the SPMD grid |
|
HBM - Alias of private_hbm |
|
HBM - Only visible to each individual kernel instance in the SPMD grid |
|
Shared HBM - Visible to all kernel instances in the SPMD grid |
Others#
Index of the current SPMD program along the given axis in the launch grid. |
|
Number of SPMD programs along the given axes in the launch grid. |
|
Number of dimensions in the SPMD launch grid. |
Data Types#
Boolean (True or False) stored as a byte |
|
8-bit unsigned integer number |
|
16-bit unsigned integer number |
|
32-bit unsigned integer number |
|
8-bit signed integer number |
|
16-bit signed integer number |
|
32-bit signed integer number |
|
4x packed float4_e2m1fn elements, custom data type for nki.isa.nc_matmul_mx on NeuronCore-v4 |
|
8-bit floating-point number (1S,4E,3M) |
|
4x packed float8_e4m3fn elements, custom data type for nki.isa.nc_matmul_mx on NeuronCore-v4 |
|
8-bit floating-point number (1S,5E,2M) |
|
4x packed float8_e5m2 elements, custom data type for nki.isa.nc_matmul_mx on NeuronCore-v4 |
|
16-bit floating-point number |
|
16-bit floating-point number (1S,8E,7M) |
|
32-bit floating-point number |
|
32-bit floating-point number (1S,8E,10M) |
Constants#
Tile size constants. |