Skip to content

Commit 912e595

Browse files
authored
[NFC] Remove unused forOp argument from setStageCluster (#5288)
<git-pr-chain> [NFC] Remove unused forOp argument from `setStageCluster` #### [PR chain](https://github.com/jlebar/git-pr-chain) 1. ๐Ÿ‘‰ #5288 ๐Ÿ‘ˆ **YOU ARE HERE** 1. #5289 1. #5290 </git-pr-chain>
1 parent 27e11ab commit 912e595

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

โ€Žinclude/triton/Dialect/TritonGPU/Transforms/PipeliningUtility.hโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void replaceUsesAndPropagateType(OpBuilder &builder, Operation *oldUse,
3535
// Return the minClusterId and maxClusterId for the given ForOp.
3636
std::pair<int, int> getMinMaxCluster(scf::ForOp &forOp);
3737
std::pair<int, int> getStageCluster(Operation *op);
38-
void setStageCluster(scf::ForOp &forOp, Operation *op, int stage, int cluster);
38+
void setStageCluster(Operation *op, int stage, int cluster);
3939
} // namespace triton
4040
} // namespace mlir
4141

โ€Žlib/Dialect/TritonGPU/Transforms/Pipeliner/MatmulLoopPipeline.cppโ€Ž

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,7 @@ class OpBuilderWithStage : public OpBuilder {
6464
OpTy createWithStage(Location location, int stage, int cluster,
6565
Args &&...args) {
6666
OpTy op = OpBuilder::create<OpTy>(location, std::forward<Args>(args)...);
67-
auto ctx = getContext();
68-
op->setAttr(mlir::triton::kLoopStageAttrName,
69-
IntegerAttr::get(IntegerType::get(ctx, 32), stage));
70-
op->setAttr(mlir::triton::kLoopClusterAttrName,
71-
IntegerAttr::get(IntegerType::get(ctx, 32), cluster));
67+
tt::setStageCluster(op, stage, cluster);
7268
return op;
7369
}
7470
using OpBuilder::create;
@@ -204,9 +200,8 @@ static int createAsyncCopy(scf::ForOp forOp, tt::LoadOp loadOp, Value alloc,
204200
// Prefetch load if is not MMAV3 and is used by the dot.
205201
if (loadToInfo[loadOp].usedByDot) {
206202
assert(stageForFirstUse >= 1);
207-
tt::setStageCluster(forOp, wait, stageForFirstUse - 1, maxClusterId + 1);
208-
tt::setStageCluster(forOp, viewLoad, stageForFirstUse - 1,
209-
maxClusterId + 1);
203+
tt::setStageCluster(wait, stageForFirstUse - 1, maxClusterId + 1);
204+
tt::setStageCluster(viewLoad, stageForFirstUse - 1, maxClusterId + 1);
210205
retCode = stageForFirstUse - 1;
211206
}
212207
}

โ€Žlib/Dialect/TritonGPU/Transforms/Pipeliner/PipeliningUtility.cppโ€Ž

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,8 @@ std::pair<int, int> mlir::triton::getStageCluster(Operation *op) {
188188
return std::make_pair(stage, clusterId);
189189
}
190190

191-
void mlir::triton::setStageCluster(scf::ForOp &forOp, Operation *op, int stage,
192-
int cluster) {
193-
auto ctx = forOp.getContext();
191+
void mlir::triton::setStageCluster(Operation *op, int stage, int cluster) {
192+
auto ctx = op->getContext();
194193
op->setAttr(mlir::triton::kLoopStageAttrName,
195194
IntegerAttr::get(IntegerType::get(ctx, 32), stage));
196195
op->setAttr(mlir::triton::kLoopClusterAttrName,

โ€Žlib/Dialect/TritonGPU/Transforms/Pipeliner/Schedule.cppโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void tt::CoarseSchedule::dump() {
9494
// Set <stage, cluster> based on CoarseSchedule.
9595
void tt::CoarseSchedule::serialize(scf::ForOp &forOp) {
9696
for (auto [op, stage, cluster] : getOpsInOrder(forOp)) {
97-
tt::setStageCluster(forOp, op, stage, *cluster);
97+
tt::setStageCluster(op, stage, *cluster);
9898
}
9999
}
100100

0 commit comments

Comments
ย (0)