tvm
Classes | Namespaces | Enumerations | Functions | Variables
utils.h File Reference

Utilities for Unified Static Memory Planner. More...

#include <tvm/ir/expr.h>
#include <tvm/ir/memory_pools.h>
#include <tvm/ir/module.h>
#include <tvm/runtime/device_api.h>
#include <tvm/target/target.h>
#include <tvm/tir/stmt.h>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tvm::tir::usmp::BufferInfoNode
 Describes an abstract memory buffer that will get allocated inside a pool. The actual memory buffer in represented by PoolAllocationNode after static memory planning. More...
 
class  tvm::tir::usmp::BufferInfo
 
struct  tvm::tir::usmp::BufferInfoAnalysisNode
 This is a composite node that is produced by extract_buffer_info analysis pass that contains useful global information that could be useful for memory planning algorithms. More...
 
class  tvm::tir::usmp::BufferInfoAnalysis
 
struct  tvm::tir::usmp::PoolAllocationNode
 The pool allocation produced after the USMP algorithm. More...
 
class  tvm::tir::usmp::PoolAllocation
 
struct  tvm::tir::usmp::AllocatedPoolInfoNode
 This object contains information post-allocation for PoolInfo objects. More...
 
class  tvm::tir::usmp::AllocatedPoolInfo
 

Namespaces

 tvm
 runtime implementation for LibTorch/TorchScript.
 
 tvm::tir
 
 tvm::tir::usmp
 
 tvm::attr
 Generic attribute names that can be attached to any function.
 

Enumerations

enum class  tvm::tir::usmp::BufferInfoKind { tvm::tir::usmp::kIntermediate = 0 , tvm::tir::usmp::kInput = 1 , tvm::tir::usmp::kOutput = 2 }
 A special kind to distinguish between I/O tensors to the model and intermediate tensors of the model. More...
 

Functions

Array< BufferInfo > tvm::tir::usmp::ConvertToArrayOfBufferInfo (const Map< BufferInfo, Stmt > &buffer_info_map)
 Convert the IR-bound BufferInfo map to an array of BufferInfo. More...
 
Integer tvm::tir::usmp::CalculateModuleWorkspaceSize (const IRModule &mod)
 Calculate workspace required to execute a IRModule with main expressed in TIR. More...
 
Integer tvm::tir::usmp::CalculateExtentsSize (const AllocateNode *op)
 Calculate the size of the extents in bytes. More...
 
Integer tvm::tir::usmp::CalculateExtentsSize (const AllocateConstNode *op)
 Calculate the size of the extents in bytes. More...
 
Map< Stmt, PoolAllocation > tvm::tir::usmp::AssignStmtPoolAllocations (const Map< BufferInfo, Stmt > &buffer_info_to_stmt, const Map< BufferInfo, PoolAllocation > &buffer_info_to_pool_allocation)
 Joins the Stmt nodes with PoolAllocation objects. More...
 
Map< String, PoolAllocation > tvm::tir::usmp::GetIOPoolAllocations (const Map< BufferInfo, PoolAllocation > &buffer_info_to_pool_allocation)
 Obtains I/O tensor names to their PoolAllocation objects. More...
 

Variables

constexpr const char * tvm::kUSMPEnableOption = "tir.usmp.enable"
 PassContext option to enable the USMP. More...
 
constexpr const char * tvm::kUSMPAlgorithmOption = "tir.usmp.algorithm"
 PassContext option to select the memory planning algorithm in USMP. More...
 
constexpr const char * tvm::kUSMPUseWorkspaceIO = "tir.usmp.use_workspace_io"
 PassContext option to enable placing I/O tensors in the workspace. More...
 
constexpr const char * tvm::kUSMPCustomAlgorithmOption = "tir.usmp.custom_algorithm"
 PassContext option to specify a custom memory planning algorithm in USMP. The algorithm should be provided as registered PackedFunc with the name tir.usmp.algorithm.NAME. More...
 

Detailed Description

Utilities for Unified Static Memory Planner.