tvm
Classes | Functions
tvm::tir::usmp::algo Namespace Reference

Classes

class  GreedyBase
 This is the base class for Greedy Algorithms where the sorting is specialized in the extended classes based on the greedy criteria. More...
 

Functions

Map< BufferInfo, PoolAllocationGreedyBySize (const Array< BufferInfo > &buffer_info_arr, const Integer &memory_pressure)
 The Greedy-by-Size algorithm to plan memory. More...
 
Map< BufferInfo, PoolAllocationGreedyByConflicts (const Array< BufferInfo > &buffer_info_arr, const Integer &memory_pressure)
 The Greedy-by-Conflicts algorithm to plan memory. More...
 
Map< BufferInfo, PoolAllocationHillClimb (const Array< BufferInfo > &buffer_info_arr, const Integer &memory_pressure)
 The Hill-Climb algoritm to plan memory. More...
 

Function Documentation

◆ GreedyByConflicts()

Map<BufferInfo, PoolAllocation> tvm::tir::usmp::algo::GreedyByConflicts ( const Array< BufferInfo > &  buffer_info_arr,
const Integer memory_pressure 
)

The Greedy-by-Conflicts algorithm to plan memory.

This will perform a greedy algorithm in deciding the offsets within provided Pools, using the number of liveness conflicts of the buffer.

Returns
A Map of BufferInfo objects and their associated PoolAllocation

◆ GreedyBySize()

Map<BufferInfo, PoolAllocation> tvm::tir::usmp::algo::GreedyBySize ( const Array< BufferInfo > &  buffer_info_arr,
const Integer memory_pressure 
)

The Greedy-by-Size algorithm to plan memory.

This will perform a greedy algorithm in deciding the offsets within provided Pools, using the size of the buffer.

Returns
A Map of BufferInfo objects and their associated PoolAllocation

◆ HillClimb()

Map< BufferInfo, PoolAllocation > tvm::tir::usmp::algo::HillClimb ( const Array< BufferInfo > &  buffer_info_arr,
const Integer memory_pressure 
)

The Hill-Climb algoritm to plan memory.

The Hill-Climb algorithm to plan memory.

This will perform an attempt to utilize probabalistic approach to memory allocation. Typically better than greedy family, but quite slow due to large number of iterations.

Returns
A Map of BufferInfo objects and their associated PoolAllocation

This will perform a hill climbing algorithm in deciding the offsets within provided Pools.

Returns
A Map of BufferInfo objects and their associated PoolAllocation