Skip to content

Commit dd2433e

Browse files
committed
Remove Intel code
1 parent daa8c28 commit dd2433e

File tree

1 file changed

+37
-41
lines changed

1 file changed

+37
-41
lines changed

lib/Dialect/TritonGPU/IR/Dialect.cpp

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66
#include "mlir/IR/DialectImplementation.h"
77
#include "mlir/IR/OpImplementation.h"
8-
9-
#include "intel/include/Dialect/TritonIntelGPU/IR/Dialect.h"
10-
118
#include "mlir/Support/LLVM.h"
129
#include "triton/Analysis/Utility.h"
1310
#include "triton/Dialect/Triton/IR/Utility.h"
@@ -316,11 +313,11 @@ SmallVector<unsigned> getOrder(Attribute layout) {
316313
// with Intel layouts.
317314
// More details:
318315
// https://github.com/intel/intel-xpu-backend-for-triton/pull/2517
319-
if (dyn_cast<intel::DpasEncodingAttr>(dotLayout.getParent())) {
320-
SmallVector<unsigned> order(rank);
321-
std::iota(order.rbegin(), order.rend(), 0);
322-
return order;
323-
}
316+
// if (dyn_cast<intel::DpasEncodingAttr>(dotLayout.getParent())) {
317+
// SmallVector<unsigned> order(rank);
318+
// std::iota(order.rbegin(), order.rend(), 0);
319+
// return order;
320+
// }
324321
return getOrderForDotOperand(dotLayout.getOpIdx(), rank, /*kMajor*/ true);
325322
}
326323
if (auto sliceLayout = dyn_cast<SliceEncodingAttr>(layout)) {
@@ -1120,10 +1117,11 @@ unsigned DotOperandEncodingAttr::getTotalElemsPerThread(ArrayRef<int64_t> shape,
11201117
return amdWmmaParent.getTotalElemsPerThreadForOperand(
11211118
shape, eltTy, getKWidth(), getOpIdx());
11221119
}
1123-
if (auto dpasParent = mlir::dyn_cast<intel::DpasEncodingAttr>(mmaParent)) {
1124-
return dpasParent.getTotalElemsPerThreadForOperand(
1125-
shape, eltTy, getKWidth(), getOpIdx());
1126-
}
1120+
// if (auto dpasParent =
1121+
// mlir::dyn_cast<intel::DpasEncodingAttr>(mmaParent)) {
1122+
// return dpasParent.getTotalElemsPerThreadForOperand(
1123+
// shape, eltTy, getKWidth(), getOpIdx());
1124+
// }
11271125
}
11281126
if (auto blockedLayout = mlir::dyn_cast<BlockedEncodingAttr>(getParent())) {
11291127
auto shapePerCTA = getShapePerCTA(*this, shape);
@@ -1188,17 +1186,19 @@ SmallVector<unsigned> DotOperandEncodingAttr::getWarpOrder() const {
11881186
return {};
11891187
}
11901188
SmallVector<unsigned> DotOperandEncodingAttr::getThreadOrder() const {
1191-
// FIXME: delete if branch for `DpasEncodingAttr` and provide more
1192-
// general solution to make `getOrderForDotOperand` function compatible
1193-
// with Intel layouts.
1194-
// More details:
1195-
// https://github.com/intel/intel-xpu-backend-for-triton/pull/2517
1196-
if (mlir::dyn_cast<intel::DpasEncodingAttr>(getParent())) {
1197-
return ::getOrder(*this);
1198-
} else {
1199-
return getOrderForDotOperand(getOpIdx(), getWarpsPerCTA().size(),
1200-
/*kMajor*/ true);
1201-
}
1189+
// // FIXME: delete if branch for `DpasEncodingAttr` and provide more
1190+
// // general solution to make `getOrderForDotOperand` function compatible
1191+
// // with Intel layouts.
1192+
// // More details:
1193+
// // https://github.com/intel/intel-xpu-backend-for-triton/pull/2517
1194+
// if (mlir::dyn_cast<intel::DpasEncodingAttr>(getParent())) {
1195+
// return ::getOrder(*this);
1196+
// } else {
1197+
// return getOrderForDotOperand(getOpIdx(), getWarpsPerCTA().size(),
1198+
// /*kMajor*/ true);
1199+
// }
1200+
return getOrderForDotOperand(getOpIdx(), getWarpsPerCTA().size(),
1201+
/*kMajor*/ true);
12021202
}
12031203

12041204
LogicalResult DotOperandEncodingAttr::verify(
@@ -1241,19 +1241,19 @@ LogicalResult DotOperandEncodingAttr::verify(
12411241
return success();
12421242
}
12431243

1244-
if (auto parentAttr = mlir::dyn_cast<intel::DpasEncodingAttr>(parent)) {
1245-
if (kWidth != parentAttr.getOpsPerChannel())
1246-
return emitError() << "ttg.dot_op kWidth parameter must match the "
1247-
"parent's opsPerChannel";
1248-
return success();
1249-
}
1250-
1251-
if (auto parentAttr = mlir::dyn_cast<intel::WarpEncodingAttr>(parent)) {
1252-
if (kWidth != 0)
1253-
return emitError() << "ttg.dot_op kWidth parameter is not supported "
1254-
"when the parent is a warp layout";
1255-
return success();
1256-
}
1244+
// if (auto parentAttr = mlir::dyn_cast<intel::DpasEncodingAttr>(parent)) {
1245+
// if (kWidth != parentAttr.getOpsPerChannel())
1246+
// return emitError() << "ttg.dot_op kWidth parameter must match the "
1247+
// "parent's opsPerChannel";
1248+
// return success();
1249+
// }
1250+
//
1251+
// if (auto parentAttr = mlir::dyn_cast<intel::WarpEncodingAttr>(parent)) {
1252+
// if (kWidth != 0)
1253+
// return emitError() << "ttg.dot_op kWidth parameter is not supported "
1254+
// "when the parent is a warp layout";
1255+
// return success();
1256+
// }
12571257

12581258
if (auto parentAttr = mlir::dyn_cast<BlockedEncodingAttr>(parent)) {
12591259
if (kWidth != 0)
@@ -2518,9 +2518,6 @@ class TritonGPUOpAsmInterface : public OpAsmDialectInterface {
25182518
} else if (auto linearAttr = mlir::dyn_cast<LinearEncodingAttr>(attr)) {
25192519
os << "linear";
25202520
return AliasResult::FinalAlias;
2521-
} else if (auto warpAttr = mlir::dyn_cast<intel::WarpEncodingAttr>(attr)) {
2522-
os << "warp";
2523-
return AliasResult::FinalAlias;
25242521
} /* else if (auto sliceAttr = dyn_cast<SliceEncodingAttr>(attr)) {
25252522
os << "slice";
25262523
return AliasResult::FinalAlias;
@@ -3239,8 +3236,7 @@ struct CanonicalizeConvertFromConvert
32393236
auto srcType = op.getSrc().getType();
32403237
auto dstType = op.getType();
32413238
if (mlir::isa<DotOperandEncodingAttr>(dstType.getEncoding()) &&
3242-
(mlir::isa<NvidiaMmaEncodingAttr>(srcType.getEncoding()) ||
3243-
mlir::isa<intel::DpasEncodingAttr>(srcType.getEncoding())))
3239+
mlir::isa<NvidiaMmaEncodingAttr>(srcType.getEncoding()))
32443240
return failure();
32453241

32463242
// for hopper MMAv3

0 commit comments

Comments
 (0)