tvm
Loading...
Searching...
No Matches
transform.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
24#ifndef TVM_S_TIR_TRANSFORM_H_
25#define TVM_S_TIR_TRANSFORM_H_
26
27#include <tvm/base.h>
28#include <tvm/ir/prim/expr.h>
29#include <tvm/ir/transform.h>
31#include <tvm/s_tir/stmt.h>
32#include <tvm/target/target.h>
33#include <tvm/tirx/transform.h>
34
35#include <string>
36#include <vector>
37
38namespace tvm {
39namespace s_tir {
40namespace transform {
41
45
47TVM_DLL Pass ConvertSSA();
48
52
58
65
71
79
87
93
132TVM_DLL Pass CompactTensorAllocation(bool is_strict = true);
133
139
145
151
158
166
204
210
216
219
226
233
239
245
251TVM_DLL Pass ThreadSync(runtime::MemoryScope storage_scope);
252
259
265
271
277
282TVM_DLL Pass DefaultGPUSchedule(ffi::Optional<Target> target = std::nullopt);
283
289TVM_DLL Pass RemoveWeightLayoutRewriteBlock(bool skip_tensor_rewrite = false);
290
296
297} // namespace transform
298} // namespace s_tir
299} // namespace tvm
300
301#endif // TVM_S_TIR_TRANSFORM_H_
TIR expressions.
Utilities for IR transformations.
TIR specific transformation passes.
A registered memory space, independent of backend allocation policy.
Definition memory_scope.h:65
PassContext that is used to configure the pass behavior.
Definition transform.h:64
Definition transform.h:307
Parent compiler symbol visibility.
S-TIR (Schedulable TIR) statements and attributes.
Memory scopes and allocation properties for runtime storage.
Pass DefaultGPUSchedule(ffi::Optional< Target > target=std::nullopt)
Set default thread bindings for GPU Functions.
Pass CanonicalizeLoop()
Canonicalize loop to start from zero .
Pass LowerAutoCopy()
Automatically do memory optimizations for auto copy blocks.
Pass ConvertSSA()
De-duplicate definitions, including schedulable block iterators, across Functions.
Pass LowerVtcmAlloc()
Lower VTCM allocations.
Pass LowerInitBlock()
Lower block init stmt into If stmts.
Pass StmtSimplify()
Simplify schedulable TIR using block iteration constraints and shared simplifier options.
Pass InjectVirtualThread()
Inject virtual thread loops.
Pass TransformMmaTensorLayout()
Transform Mma scope (mma.matrixA/B/C) to local scope with layout transformation.
Pass LowerCrossThreadReduction()
Lower cross-thread reduction from thread bindings to intrinsic function calls.
Pass InjectSoftwarePipeline()
This pass transforms annotated loops into pipelined ones where producers and consumers are overlapped...
Pass RemoveStoreUndef()
Remove stores of tirx::undef_op.
Pass InjectPTXAsyncCopy()
Rewrite global to shared memory copy on CUDA with asynchronous copy.
Pass LoopPartition()
partition loops in the stmt.
Pass LowerThreadBinding()
Lower thread-binding loops to fresh lexical launch regions. Run after LoopPartition and LowerOpaqueBl...
Pass AnnotateIrregularLoop()
Annotate irregular loop mark.
Pass LowerOpaqueBlock()
Remove the block to ensure that the TIR can not be scheduled again. Run LoopPartition first when thre...
Pass InjectPermutedLayout()
Inject permuted layout for shared memory.
Pass ConvertBlocksToOpaque()
Substitute all the block vars with the PrimExprs they are bound to, indicated by the corresponding it...
Pass PlanAndUpdateTensorAllocationLocation()
Locate the tensor allocation to the exact position (usually is the lca of tensor access)....
Pass ThreadSync(runtime::MemoryScope storage_scope)
Insert sync between parallel read/write of shared buffers.
Pass LowerMatchTensor()
Remove match tensors inside the block. Also, it will validate the binding.
Pass ManifestSharedMemoryLocalStage()
Add the explicit local stage for the shared memory access on GPU.
Pass LowerSynchronization()
Lower asynchronous queue operations and remove synchronization regions. Run after ThreadSync and opti...
Pass CompactTensorAllocation(bool is_strict=true)
Compact the tensor access region by removing the tensor regions that are not accessed,...
Pass LiftThreadBinding()
Lift the same thread bindings to their LCA loops.
Pass RemoveWeightLayoutRewriteBlock(bool skip_tensor_rewrite=false)
Remove weight layout rewrite block before benchmark.
Pass RewriteUnsafeSelect()
Detect and rewrite unsafe select that contains memory access.
Pass MergeSharedMemoryAllocations()
Merge multiple TIR-level shared memory allocations into one.
Pass InferFragment()
Infer the TensorCore fragment information using tensor intrinsics.
TVM_TIRX_DLL Pass CreateFunctionPass(ffi::TypedFunction< ffi::Optional< Function >(ffi::RValueRef< Function >, IRModule, PassContext)> pass_func, int opt_level, ffi::String name)
Create a function pass from an owning FFI callback.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41
Compilation target object.