This document is relevant for: Inf2, Trn1, Trn2

nki.compiler#

Allocation Control#

sbuf.alloc

Allocate SBUF memory space for each logical block in a tensor using a customized allocation method.

sbuf.mod_alloc

Allocate SBUF memory space for each logical tile in a tensor through modulo allocation.

sbuf.auto_alloc

Returns a maker to indicate the tensor should be automatically allocated by compiler.

psum.alloc

Allocate PSUM memory space for each logical block in a tensor using a customized allocation method.

psum.mod_alloc

Allocate PSUM memory space for each logical block in a tensor through modulo allocation.

psum.auto_alloc

Returns a maker to indicate the tensor should be automatically allocated by compiler.

Kernel Decorators#

skip_middle_end_transformations

Skip all middle end transformations on the kernel

enable_stack_allocator

Use stack allocator to allocate the psum and sbuf tensors in the kernel.

force_auto_alloc

Force automatic allocation to be turned on in the kernel.

This document is relevant for: Inf2, Trn1, Trn2