Skip to main content

Module memory

Module memory 

Source
Expand description

Memory planning and buffer allocation pass.

Analyzes tensor lifetimes within IR functions and assigns buffer offsets using a greedy allocator. When lifetimes do not overlap, the allocator reuses buffer regions, reducing peak memory usage.

Structs§

BufferAllocation
A buffer allocation for a single tensor.
LiveInterval
The liveness interval (first-use to last-use) of a tensor.
MemoryPlan
The result of memory planning: buffer assignments and peak usage.
MemoryPlanning
Memory planning analysis pass.
TensorId
A unique identifier for a tensor in the memory plan.

Functions§

plan_memory
Analyze an IR module and produce a memory plan.