Skip to content

Commit f464662

Browse files
committed
update doc
1 parent fb28ce8 commit f464662

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

mlir/include/mlir/Dialect/XeGPU/IR/XeGPUAttrs.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ def XeGPU_LayoutAttr : XeGPUAttr<"Layout", "layout"> {
202202
```mlir
203203
#xegpu.layout<inst_data = [8, 16], lane_layout = [2, 8], lane_data = [2, 2]>
204204
```
205-
In this example, the original problem size is divided into smaller subproblems of size [8, 16],
206-
which are further distributed across 16 work-items organized as [[0, 1, 2, ..., 7], [8, 9, ..., 15]].
207-
Each work-item is assigned a contiguous 2x2 block.
205+
In this example, the original problem size is partitioned into smaller subproblems of dimensions [8, 16],
206+
which are then distributed among 16 work-items arranged as [[0, 1, 2, ..., 7], [8, 9, ..., 15]]. Each
207+
work-item is assigned four 2x2 blocks in a round-robin manner.
208208

209209
4. Workgroup level layout:
210210
```mlir

mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ isArgShapesValid(TensorDescType tdescTy, VectorType valueTy,
105105
<< " for tensor descriptor " << tdescTy;
106106
}
107107

108+
// Checks if the given shape is evenly distributed based on the layout
109+
// and data factors provided by the LayoutAttr. The function ensures that
110+
// each dimension of the shape can be evenly divided by the corresponding
111+
// data factor, and the resulting quotient can be evenly divided by the
112+
// layout factor. Returns `true` if the shape is evenly distributed,
113+
// otherwise `false`.
108114
static bool isEvenDistributed(llvm::ArrayRef<int64_t> shape,
109115
xegpu::LayoutAttr attr) {
110116
assert(attr && "Layout attribute is missing.");
@@ -121,7 +127,6 @@ static bool isEvenDistributed(llvm::ArrayRef<int64_t> shape,
121127
}
122128
for (auto [dimSize, dataFactor, layoutFactor] :
123129
llvm::zip_equal(shape, data, layout)) {
124-
// check dimSize % (dataFactor * layoutFactor) != 0
125130
if (dimSize % dataFactor != 0 || (dimSize / dataFactor) % layoutFactor != 0)
126131
return false;
127132
}

0 commit comments

Comments
 (0)