Skip to content

Commit

Permalink
add LoopScheduling pass
Browse files Browse the repository at this point in the history
Summary: add scheduleDeps based on attributes
  • Loading branch information
manman-ren committed Sep 27, 2024
1 parent e7ec3fe commit c8e9647
Show file tree
Hide file tree
Showing 13 changed files with 1,000 additions and 499 deletions.
13 changes: 13 additions & 0 deletions include/triton/Dialect/TritonGPU/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,17 @@ def TritonGPUOptimizeAccumulatorInit: Pass<"tritongpu-optimize-accumulator-init"
"mlir::triton::TritonDialect"];
}

def TritonGPULoopScheduling: Pass<"tritongpu-loop-scheduling", "mlir::ModuleOp"> {
let summary = "Generate loop scheduling for SWP";

let description = "This pass sets up stages and clustering for software pipelining.";

let dependentDialects = ["mlir::triton::gpu::TritonGPUDialect",
"mlir::triton::TritonDialect"];
let options = [
Option<"numStages", "num-stages",
"int32_t", /*default*/"3",
"number of pipeline stages">
];
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define TRITON_TRITONGPU_TRANSFORMS_PIPELINER_PIPELINING_UTILITY_H_

#include "mlir/Dialect/SCF/IR/SCF.h"
#include "triton/Dialect/TritonGPU/Transforms/Schedule.h"
#include <vector>

namespace mlir {
Expand Down Expand Up @@ -29,6 +30,7 @@ void addOps(scf::ForOp forOp, int stage,
/// mutable.
void replaceUsesAndPropagateType(OpBuilder &builder, Operation *oldUse,
Value val);

} // namespace triton
} // namespace mlir

Expand Down
1 change: 1 addition & 0 deletions lib/Dialect/TritonGPU/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ add_triton_library(TritonGPUTransforms
Coalesce.cpp
F32DotTC.cpp
CombineTensorSelectAndIf.cpp
LoopScheduling.cpp
ReduceDataDuplication.cpp
OptimizeAccumulatorInit.cpp
OptimizeDotOperands.cpp
Expand Down
Loading

0 comments on commit c8e9647

Please sign in to comment.