This document is relevant for: Inf2, Trn1, Trn1n

nki.language.static_range#

nki.language.static_range(*args)[source]#

Create a sequence of numbers for use as loop iterators in NKI, resulting in a fully unrolled loop. Unlike affine_range or sequential_range, Neuron compiler will fully unroll the loop during NKI kernel tracing.

Notes:

  • Due to loop unrolling, compilation time may go up significantly compared to affine_range or sequential_range.

  • On-chip memory (SBUF) usage may also go up significantly compared to affine_range or sequential_range.

  • No loop-level optimizations will be performed in the compiler.

  • static_range should only be used as a fall-back option for debugging purposes when affine_range or sequential_range is giving functionally incorrect results or undesirable performance characteristics.

This document is relevant for: Inf2, Trn1, Trn1n