[Mlir-commits] [mlir] [MLIR][XeGPU] Enhance XeGPU lane layout to support "wrap-around" distribution (PR #186958)
Artem Kroviakov
llvmlistbot at llvm.org
Thu Mar 19 08:11:07 PDT 2026
================
@@ -871,6 +1041,50 @@ bool SliceAttr::isEqualTo(const xegpu::DistributeLayoutAttr &other) {
(flattenedThis.getDims() == flattenedOther.getDims()));
}
+bool SliceAttr::isCompatibleWith(const xegpu::DistributeLayoutAttr &other,
+ SmallVector<int64_t> shape,
+ xegpu::LayoutKind level) {
+ if (!other)
+ return false;
+ if (getEffectiveOrderAsInt() == other.getEffectiveOrderAsInt()) {
+ // short cut when order is the same, no need to compute coords and compare
+ if (level == xegpu::LayoutKind::Subgroup)
+ if (getEffectiveSgLayoutAsInt() == other.getEffectiveSgLayoutAsInt() &&
+ getEffectiveSgDataAsInt() == other.getEffectiveSgDataAsInt())
+ return true;
+ if (level == xegpu::LayoutKind::Lane)
+ if (getEffectiveLaneLayoutAsInt() ==
+ other.getEffectiveLaneLayoutAsInt() &&
+ getEffectiveLaneDataAsInt() == other.getEffectiveLaneDataAsInt())
+ return true;
+ }
+
+ auto flattenedThis = flatten();
+ auto parent = dyn_cast<LayoutAttr>(flattenedThis.getParent());
----------------
akroviakov wrote:
Why do we need the same coordinates in parent?
Assuming one loads or stores using compatible effective layouts of sliced attributes (i.e., same coordinates), but parent layouts differ, will it have visible effects for the op itself?
https://github.com/llvm/llvm-project/pull/186958
More information about the Mlir-commits
mailing list