Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[MLIR][XeGPU] Add unroll patterns and blocking pass for XeGPU (1/N) #137010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
May 12, 2025
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7d332da
init
chencha3 Apr 17, 2025
d4549ad
Merge branch 'main' into xegpu_unroll_patterns
chencha3 Apr 17, 2025
cdd5059
Merge branch 'main' into xegpu_unroll_patterns
chencha3 Apr 18, 2025
47f9b3d
add patterns for createNdOp and StoreNdOp
chencha3 Apr 18, 2025
932747e
refine nativeShapeFn
chencha3 Apr 18, 2025
f843d98
refine verifier for TensorDescType
chencha3 Apr 23, 2025
c6bdd3c
add loadNd pattern
chencha3 Apr 23, 2025
1d4dc72
add test pass
chencha3 Apr 23, 2025
545f937
format code
chencha3 Apr 23, 2025
008dbc7
add unit test
chencha3 Apr 23, 2025
d077cb0
clean up
chencha3 Apr 24, 2025
0193a04
stage
chencha3 Apr 28, 2025
7f8b00a
Merge branch 'main' into xegpu_unroll_patterns
chencha3 Apr 29, 2025
456465e
add dpas pattern and unit test
chencha3 Apr 29, 2025
906d699
refactor
chencha3 Apr 29, 2025
c63a496
fix format
chencha3 Apr 29, 2025
e2ed1ac
fix format
chencha3 Apr 29, 2025
35b35f0
refine
chencha3 Apr 30, 2025
6fef430
refine
chencha3 Apr 30, 2025
9d24920
cleanup and add patterns for rest nd ops
chencha3 Apr 30, 2025
1a92661
fix format
chencha3 Apr 30, 2025
0126eb9
cleanup
chencha3 Apr 30, 2025
a7d0614
add UnrollOption
chencha3 May 6, 2025
01ca783
fix the format
chencha3 May 6, 2025
ec74833
add comments
chencha3 May 6, 2025
68f95f0
add brief description
chencha3 May 6, 2025
9e6cf29
address comments
chencha3 May 6, 2025
15b1b46
Merge branch 'main' into xegpu_unroll_patterns
chencha3 May 6, 2025
727390f
add comments
chencha3 May 6, 2025
76f8761
fix comments
chencha3 May 6, 2025
45a3d28
renaming
chencha3 May 6, 2025
372dbd7
generalize pack, unpack, createaNdOp for supporting 1D cases
chencha3 May 6, 2025
06cf9b2
refine
chencha3 May 7, 2025
e0399ac
add 1D unit tests
chencha3 May 7, 2025
e873d59
switch to explicit types
chencha3 May 7, 2025
b55f43b
clean up
chencha3 May 7, 2025
383bd1d
move getUnrolledTypes out
chencha3 May 8, 2025
4fc35cf
addressed comments
chencha3 May 8, 2025
536a610
address comments
chencha3 May 8, 2025
39ca440
fix format
chencha3 May 8, 2025
09cec0b
Merge branch 'main' into xegpu_unroll_patterns
chencha3 May 8, 2025
1d3d12c
sync
chencha3 May 8, 2025
96cb62b
address comments
chencha3 May 8, 2025
163204a
Merge branch 'main' into xegpu_unroll_patterns
chencha3 May 9, 2025
1caac76
update cmake
chencha3 May 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix format
  • Loading branch information
chencha3 committed Apr 29, 2025
commit c63a49627a8b51ccd6e46966d8101f64cd213d1b
10 changes: 6 additions & 4 deletions 10 mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ struct UnrollPattern : public OpRewritePattern<SourceOp> {
auto layout = dyn_cast_if_present<xegpu::LayoutAttr>(attr);
if (!layout || layout.getLaneLayout() == nullptr)
return xegpu::LayoutAttr();
return xegpu::LayoutAttr::get(layout.getContext(), nullptr /* sg_layout */, nullptr /* sg_data */,
return xegpu::LayoutAttr::get(
layout.getContext(), nullptr /* sg_layout */, nullptr /* sg_data */,
nullptr /* inst_data */, layout.getLaneLayout(), layout.getLaneData(),
layout.getOrder());
};

std::optional<SmallVector<Type>> convertType(ShapedType type, llvm::ArrayRef<int64_t> blockSize) const {
std::optional<SmallVector<Type>>
convertType(ShapedType type, llvm::ArrayRef<int64_t> blockSize) const {
auto elemTy = type.getElementType();
auto maybeGrids = computeGrids(type.getShape(), blockSize);

Expand All @@ -162,14 +164,14 @@ struct UnrollPattern : public OpRewritePattern<SourceOp> {
auto ctx = tdescTy.getContext();
auto encoding = tdescTy.getEncoding();
auto layout = tdescTy.getLayout();
newTy = xegpu::TensorDescType::get(ctx, blockSize, elemTy, encoding, getLaneLayoutAttr(layout));
newTy = xegpu::TensorDescType::get(ctx, blockSize, elemTy, encoding,
getLaneLayoutAttr(layout));
} else {
newTy = type.clone(blockSize, elemTy);
}
return llvm::SmallVector<Type>(computeProduct(*maybeGrids), newTy);
}


vector::UnrollVectorOptions options;
};

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.