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/ir/prim/expr.h>
28#include <tvm/ir/transform.h>
29#include <tvm/s_tir/stmt.h>
30#include <tvm/target/target.h>
31#include <tvm/tirx/transform.h>
32
33#include <string>
34#include <vector>
35
36namespace tvm {
37namespace s_tir {
38namespace transform {
39
43
45TVM_DLL Pass ConvertSSA();
46
50
56
63
69
77
85
91
130TVM_DLL Pass CompactTensorAllocation(bool is_strict = true);
131
137
143
149
156
164
202
208
214
217
224
231
237
243
249TVM_DLL Pass ThreadSync(tvm::ffi::String storage_scope);
250
257
263
269
275
281
287
293TVM_DLL Pass RemoveWeightLayoutRewriteBlock(bool skip_tensor_rewrite = false);
294
300
301} // namespace transform
302} // namespace s_tir
303} // namespace tvm
304
305#endif // TVM_S_TIR_TRANSFORM_H_
PassContext that is used to configure the pass behavior.
Definition transform.h:62
Definition transform.h:298
TIR expressions.
Utilities for IR transformations.
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 (m16n8k8.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 LowerThreadAllreduce()
Lower cross thread allreduce.
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 DefaultGPUSchedule()
Set default thread bindings for GPU Functions.
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 ThreadSync(tvm::ffi::String storage_scope)
Insert sync between parallel read/write of shared buffers.
Pass InferFragment()
Infer the TensorCore fragment information using tensor intrinsics.
TVM_TIRX_DLL Pass CreateFunctionPass(std::function< ffi::Optional< Function >(Function, IRModule, PassContext)> pass_func, int opt_level, ffi::String name)
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
S-TIR (Schedulable TIR) statements and attributes.
Compilation target object.
TIR specific transformation passes.