This document is relevant for: Trn2, Trn3

nki.compiler.AllocationMode#

class nki.compiler.AllocationMode(value)[source]#

How the new allocation selects an address for each tile (CompileConfig.experimental_allocation_mode).

  • RING: give each tile a fresh address, and reuse freed memory only after the allocation wraps around, so a DMA into a new tile seldom waits for compute that reads an earlier tile. Fragments SBUF the most. In PSUM, rotates through the 8 banks.

  • FAST: stack tiles whose lifetimes nest, and put every other tile in the freed memory that fits it best. Compact, but a tile can take the address of a tile freed shortly before, so a DMA into it waits for the compute that reads the earlier tile.

  • MAX_REUSE: always put a tile in the freed memory that fits it best. Uses the least memory, with the least overlap of loads and compute.

Attributes

RING

FAST

MAX_REUSE

This document is relevant for: Trn2, Trn3