tvm
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
tvm::s_tir::meta_schedule::Postproc Class Reference

Managed reference to PostprocNode. More...

#include <postproc.h>

Inheritance diagram for tvm::s_tir::meta_schedule::Postproc:
Collaboration diagram for tvm::s_tir::meta_schedule::Postproc:

Public Types

using FInitializeWithTuneContext = ffi::TypedFunction< void(const TuneContext &)>
 The function type of InitializeWithTuneContext method.
 
using FApply = ffi::TypedFunction< bool(const s_tir::Schedule &)>
 Apply a postprocessor to the given schedule.
 
using FClone = ffi::TypedFunction< Postproc()>
 Clone the postprocessor.
 

Public Member Functions

 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (Postproc, ffi::ObjectRef, PostprocNode)
 

Static Public Member Functions

static Postproc PyPostproc (FInitializeWithTuneContext f_initialize_with_tune_context, FApply f_apply, FClone f_clone)
 Create a postprocessor with customized methods on the python-side.
 
static Postproc DisallowDynamicLoop ()
 Create a postprocessor that checks if all loops are static.
 
static Postproc DisallowAsyncStridedMemCopy ()
 Create a postprocessor that checks if all async mem copies are not strided.
 
static Postproc RewriteCooperativeFetch ()
 Create a postprocessor that rewrites the cooperative fetch annotation to actual vectorized cooperative fetching in loop bindings.
 
static Postproc RewriteParallelVectorizeUnroll ()
 Creates a postprocessor that applies parallelization, vectorization and auto unrolling according to the annotation of each block.
 
static Postproc RewriteReductionBlock ()
 Create a postprocessor that rewrites reduction block by moving the init block out.
 
static Postproc RewriteUnboundBlock (int max_threadblocks)
 Create a postprocessor that adds thread binding to unbound blocks.
 
static Postproc RewriteTensorize (bool vectorize_init_loop=false)
 Create a postprocessor that applies tensorization to annotated blocks.
 
static Postproc VerifyGPUCode ()
 Creates a postprocessor that verifies if the GPU code is correct.
 
static Postproc VerifyVTCMLimit ()
 Verifies that the VTCM usage of a given schedule is within the provided limit.
 
static Postproc RewriteLayout ()
 Creates a postprocessor that rewrites the layout of input tensor.
 
static ffi::Array< Postproc, voidDefaultLLVM ()
 Create default postprocessors for LLVM.
 
static ffi::Array< Postproc, voidDefaultCPUTensorization ()
 Create default postprocessors for x86 (AVX512 and VNNI)
 
static ffi::Array< Postproc, voidDefaultRISCV ()
 Create default postprocessors for RISCV.
 
static ffi::Array< Postproc, voidDefaultCUDA ()
 Create default postprocessors for CUDA.
 
static ffi::Array< Postproc, voidDefaultCUDATensorCore ()
 Create default postprocessors for CUDA with TensorCore.
 
static ffi::Array< Postproc, voidDefaultHexagon ()
 Create default postprocessors for Hexagon.
 

Detailed Description

Managed reference to PostprocNode.

See also
PostprocNode

Member Typedef Documentation

◆ FApply

Apply a postprocessor to the given schedule.

Parameters
schThe schedule to be post processed.
Returns
Whether the postprocessor was successfully applied.

◆ FClone

Clone the postprocessor.

Returns
The cloned postprocessor.

◆ FInitializeWithTuneContext

The function type of InitializeWithTuneContext method.

Parameters
contextThe tuning context for initialization.

Member Function Documentation

◆ DefaultCPUTensorization()

static ffi::Array< Postproc, void > tvm::s_tir::meta_schedule::Postproc::DefaultCPUTensorization ( )
static

Create default postprocessors for x86 (AVX512 and VNNI)

◆ DefaultCUDA()

static ffi::Array< Postproc, void > tvm::s_tir::meta_schedule::Postproc::DefaultCUDA ( )
static

Create default postprocessors for CUDA.

◆ DefaultCUDATensorCore()

static ffi::Array< Postproc, void > tvm::s_tir::meta_schedule::Postproc::DefaultCUDATensorCore ( )
static

Create default postprocessors for CUDA with TensorCore.

◆ DefaultHexagon()

static ffi::Array< Postproc, void > tvm::s_tir::meta_schedule::Postproc::DefaultHexagon ( )
static

Create default postprocessors for Hexagon.

◆ DefaultLLVM()

static ffi::Array< Postproc, void > tvm::s_tir::meta_schedule::Postproc::DefaultLLVM ( )
static

Create default postprocessors for LLVM.

◆ DefaultRISCV()

static ffi::Array< Postproc, void > tvm::s_tir::meta_schedule::Postproc::DefaultRISCV ( )
static

Create default postprocessors for RISCV.

◆ DisallowAsyncStridedMemCopy()

static Postproc tvm::s_tir::meta_schedule::Postproc::DisallowAsyncStridedMemCopy ( )
static

Create a postprocessor that checks if all async mem copies are not strided.

Returns
The postprocessor created

◆ DisallowDynamicLoop()

static Postproc tvm::s_tir::meta_schedule::Postproc::DisallowDynamicLoop ( )
static

Create a postprocessor that checks if all loops are static.

Returns
The postprocessor created

◆ PyPostproc()

static Postproc tvm::s_tir::meta_schedule::Postproc::PyPostproc ( FInitializeWithTuneContext  f_initialize_with_tune_context,
FApply  f_apply,
FClone  f_clone 
)
static

Create a postprocessor with customized methods on the python-side.

Parameters
f_initialize_with_tune_contextThe packed function of InitializeWithTuneContext.
f_applyThe packed function of Apply.
f_cloneThe packed function of Clone.
Returns
The postprocessor created.

◆ RewriteCooperativeFetch()

static Postproc tvm::s_tir::meta_schedule::Postproc::RewriteCooperativeFetch ( )
static

Create a postprocessor that rewrites the cooperative fetch annotation to actual vectorized cooperative fetching in loop bindings.

Returns
The postprocessor created.

◆ RewriteLayout()

static Postproc tvm::s_tir::meta_schedule::Postproc::RewriteLayout ( )
static

Creates a postprocessor that rewrites the layout of input tensor.

Note
Weight layout rewrite is supported so far, activation layout rewrite will be added.
Returns
The postprocessor created

◆ RewriteParallelVectorizeUnroll()

static Postproc tvm::s_tir::meta_schedule::Postproc::RewriteParallelVectorizeUnroll ( )
static

Creates a postprocessor that applies parallelization, vectorization and auto unrolling according to the annotation of each block.

Returns
The postprocessor created

◆ RewriteReductionBlock()

static Postproc tvm::s_tir::meta_schedule::Postproc::RewriteReductionBlock ( )
static

Create a postprocessor that rewrites reduction block by moving the init block out.

Returns
The postprocessor created.

◆ RewriteTensorize()

static Postproc tvm::s_tir::meta_schedule::Postproc::RewriteTensorize ( bool  vectorize_init_loop = false)
static

Create a postprocessor that applies tensorization to annotated blocks.

Parameters
vectorize_init_loopWhether or not vectorize the initialization loop produced by DecomposeReduction
Returns
The postprocessor created.

◆ RewriteUnboundBlock()

static Postproc tvm::s_tir::meta_schedule::Postproc::RewriteUnboundBlock ( int  max_threadblocks)
static

Create a postprocessor that adds thread binding to unbound blocks.

Parameters
max_threadblocksThe max number of threadblocks in the CUDA device.
Returns
The postprocessor created.

◆ TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE()

tvm::s_tir::meta_schedule::Postproc::TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE ( Postproc  ,
ffi::ObjectRef  ,
PostprocNode   
)

◆ VerifyGPUCode()

static Postproc tvm::s_tir::meta_schedule::Postproc::VerifyGPUCode ( )
static

Creates a postprocessor that verifies if the GPU code is correct.

Returns
The postprocessor created

◆ VerifyVTCMLimit()

static Postproc tvm::s_tir::meta_schedule::Postproc::VerifyVTCMLimit ( )
static

Verifies that the VTCM usage of a given schedule is within the provided limit.

Returns
The postprocessor created

The documentation for this class was generated from the following file: