Skip to content

Commit ca51def

Browse files
committed
fix
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 1b5f853 commit ca51def

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Dialect/TritonGPU/IR/Dialect.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,12 @@ SmallVector<unsigned> getOrder(Attribute layout) {
299299
}
300300
if (auto dotLayout = dyn_cast<DotOperandEncodingAttr>(layout)) {
301301
auto rank = getWarpsPerCTA(dotLayout.getParent()).size();
302-
auto mmaParent = dyn_cast<MmaEncodingTrait>(dotLayout.getParent());
303-
return mmaParent.getOrderForDotOperand(dotLayout.getOpIdx(), rank);
302+
if (auto mmaParent = dyn_cast<MmaEncodingTrait>(dotLayout.getParent())) {
303+
return mmaParent.getOrderForDotOperand(dotLayout.getOpIdx(), rank);
304+
}
305+
// This branch had to be left because not all types
306+
// inherit `MmaEncodingTrait` interface, for example `BlockedEncodingAttr`.
307+
return getOrderForDotOperand(dotLayout.getOpIdx(), rank);
304308
}
305309
if (auto sliceLayout = dyn_cast<SliceEncodingAttr>(layout)) {
306310
SmallVector<unsigned> parentOrder = getOrder(sliceLayout.getParent());

0 commit comments

Comments
 (0)