Skip to content

Commit 19d3ed5

Browse files
committed
[intel] small fix for 'DotOperandEncodingAttr::getThreadOrder'
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent d046d20 commit 19d3ed5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/Dialect/TritonGPU/IR/Dialect.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,8 +1061,17 @@ SmallVector<unsigned> DotOperandEncodingAttr::getWarpOrder() const {
10611061
return ::getWarpOrder(*this);
10621062
}
10631063
SmallVector<unsigned> DotOperandEncodingAttr::getThreadOrder() const {
1064-
return getOrderForDotOperand(getOpIdx(), getWarpsPerCTA().size(),
1065-
/*kMajor*/ true);
1064+
// FIXME: delete if branch for `DpasEncodingAttr` and provide more
1065+
// general solution to make `getOrderForDotOperand` function compatible
1066+
// with Intel layouts.
1067+
// More details:
1068+
// https://github.com/intel/intel-xpu-backend-for-triton/pull/2517
1069+
if (mlir::dyn_cast<intel::DpasEncodingAttr>(getParent())) {
1070+
return ::getOrder(*this);
1071+
} else {
1072+
return getOrderForDotOperand(getOpIdx(), getWarpsPerCTA().size(),
1073+
/*kMajor*/ true);
1074+
}
10661075
}
10671076
SmallVector<unsigned> DotOperandEncodingAttr::getShapePerCTATile(
10681077
ArrayRef<int64_t> tensorShape) const {

0 commit comments

Comments
 (0)