-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[mlir][xegpu] SIMT distribution patterns for XeGPU CreateNdTdesc, LoadNd, StoreNd and Dpas Ops. #135271
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
[mlir][xegpu] SIMT distribution patterns for XeGPU CreateNdTdesc, LoadNd, StoreNd and Dpas Ops. #135271
Changes from 82 commits
Commits
Show all changes
101 commits
Select commit
Hold shift + click to select a range
39dcf9d
save work
charithaintc 2058773
moving all ops to region working
charithaintc 14233fa
moving all ops to region working
charithaintc f599873
save work
charithaintc 220ed1f
save work
charithaintc 2a8070f
save work
charithaintc 4838b52
extend sg_map from subgroup to workgroup
chencha3 cb26979
format code
chencha3 273fc40
remove changes to prefetch op
chencha3 504d274
refine the doc for TensorDesc
chencha3 90e0704
save work
charithaintc 3abe7cb
save work
charithaintc 7c87319
Merge branch 'main' into xegpu_simt_dist
charithaintc 596c953
update doc
chencha3 2065764
save work
charithaintc 899439b
refine docs
chencha3 8636d15
refine docs
chencha3 0190418
refine util
chencha3 32f9272
refine convert_layout docs
chencha3 fe11c79
save work
charithaintc 6e1ef3e
save work
charithaintc 55c272c
save work
charithaintc ee56a3e
Merge branch 'gpu_dialect_changes' into xegpu_simt_dist
charithaintc 1ffe5c8
save work
charithaintc e5521f9
save work before merging with Chao's PR
charithaintc 350b581
Merge branch 'users/chencha3/xegpu/extend_sg_map' into xegpu_simt_dist
charithaintc 5700c81
merge xegpu changes
charithaintc 1619fcf
Merge branch 'main' into xegpu_simt_dist
charithaintc 2334a97
refactor names
charithaintc 9bddeb6
drop ScopeAttr and refine 1D layout support
chencha3 784ab38
refine isEvenDistributed
chencha3 28cf69e
format code
chencha3 930f1ab
Merge branch 'main' into extend_sg_map
chencha3 9ed0f87
fix format issue
chencha3 3b389bf
add 1D layout examples
chencha3 589d217
refactor names
charithaintc 8b647c4
Merge branch 'users/chencha3/xegpu/extend_sg_map' into xegpu_simt_dist
charithaintc c6ccef2
refactor
charithaintc cbd0af0
refine LayoutAttr verifier
chencha3 3fb4fd4
add unit test
chencha3 77fdfef
remove dump file
chencha3 2751332
fix typo
chencha3 2a16d11
Merge branch 'main' into extend_sg_map
chencha3 d281a14
fix an error after mering with main
chencha3 fb28ce8
new line at the end of file
chencha3 f464662
update doc
chencha3 eea3c35
Merge branch 'main' into extend_sg_map
chencha3 7acc56d
Merge branch 'users/chencha3/xegpu/extend_sg_map' into xegpu_simt_dist
charithaintc 270b498
Merge branch 'main' into xegpu_simt_dist
charithaintc 2a1d373
Switch to 1D representation for SIMT
chencha3 2159119
refine verfier for load_nd and store_nd
chencha3 21f50c0
fix issues
charithaintc 35f9cbe
Merge branch 'main' into xegpu_simt_dist
charithaintc c81b2e0
fix issues
charithaintc 03bfe08
Merge branch 'users/chencha3/xegpu/xegpu_simt_2d_to_1d' into xegpu_si…
charithaintc 2f2ec10
fix issues
charithaintc 2ae3543
fix issues
charithaintc 4c63916
fix issues
charithaintc 2d9cfa3
fix build issue
charithaintc 775d039
refine verifier for gather/scatter
chencha3 5520ce1
update comments
chencha3 6abc12a
fix tests
charithaintc 379e186
fix
charithaintc aa7dbe1
fix
charithaintc dce6d2a
Merge branch 'users/chencha3/xegpu/xegpu_simt_2d_to_1d' into xegpu_si…
charithaintc ca5c7e9
fix comments
charithaintc ed3119c
fix comments
charithaintc c898de6
fix comments
charithaintc 55be710
fix comments
charithaintc 6e8888a
fix
charithaintc 6ae7aa0
fix
charithaintc 2896b34
Merge branch 'main' into xegpu_simt_dist
charithaintc 68b1750
fix
charithaintc 9391696
Merge branch 'main' into xegpu_simt_dist
charithaintc b3e6dc5
save work
charithaintc 5c1c908
save work
charithaintc 7ad625d
save work
charithaintc d6c0722
save work
charithaintc d879f8c
Merge branch 'main' into xegpu_simt_dist
charithaintc 5f0d164
save work
charithaintc ac0d93e
save work
charithaintc 90543a0
add missing files
charithaintc a72ec25
Merge branch 'main' into xegpu_simt_dist
charithaintc bf9c0ab
save work
charithaintc 9b28449
Merge branch 'main' into xegpu_simt_dist
charithaintc 1464adb
address comments
charithaintc 14468b5
address comments
charithaintc b84c2f9
address comments
charithaintc bff1f5e
address comments
charithaintc 36206bb
address comments
charithaintc 0328684
save work
charithaintc 466712f
save work
charithaintc 0baef66
save work
charithaintc cadc078
save work
charithaintc 24635e0
add missing lib
charithaintc bed781b
add missing lib
charithaintc afdf394
Merge branch 'main' into xegpu_simt_dist
charithaintc 84afb20
Merge branch 'main' into xegpu_simt_dist
charithaintc 7e0d753
Merge branch 'main' into xegpu_simt_dist
charithaintc d4abd69
Merge branch 'main' into xegpu_simt_dist
charithaintc 3722dec
Merge branch 'main' into xegpu_simt_dist
charithaintc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| //===- XeGPUUtils.h - Vector Utilities --------------------------*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef MLIR_DIALECT_XEGPU_UTILS_XEGPUUTILS_H_ | ||
| #define MLIR_DIALECT_XEGPU_UTILS_XEGPUUTILS_H_ | ||
|
|
||
| #include "mlir/IR/BuiltinTypes.h" | ||
| namespace mlir { | ||
|
|
||
| class VectorType; | ||
| namespace xegpu { | ||
| class LayoutAttr; | ||
| class TensorDescType; | ||
| } // namespace xegpu | ||
|
|
||
| namespace xegpu { | ||
|
|
||
| // If tensor descriptor has a layout attribute it is used in SIMT mode. | ||
| // In this mode, the distributed vector shape is determined as follows: | ||
| // Definitions: | ||
| // lane_data_size = lane_data[0] × lane_data[1] | ||
| // subgroup_size = lane_layout[0] × lane_layout[1] | ||
| // distribution_unit_size = subgroup_size × lane_data_size | ||
| // | ||
| // Case 1: Regular loads/stores. | ||
| // The following conditions must be met: | ||
| // * tensor_desc[0] == lane_layout[0] | ||
| // Distributed vector is a 1D vector with shape: | ||
| // [chunk_size] | ||
| // | ||
| // Case 2: Block loads/stores | ||
| // Additional definitions: | ||
| // tensor_size = tensor_desc[0] * .. * tensor_desc[r-1] * array_length | ||
| // n_distribution_units = tensor_size / distribution_unit_size | ||
| // fragment_size = n_distribution_units * lane_data_size | ||
| // Given above definitions, the following conditions must be met: | ||
| // * tensor_desc[0] % (lane_layout[0] × lane_data[0]) == 0 | ||
| // * tensor_desc[1] % (lane_layout[1] × lane_data[1]) == 0 | ||
| // Distributed vector is a 1D vector with shape: | ||
| // [fragment_size] | ||
| FailureOr<VectorType> getDistributedVectorType(VectorType originalType, | ||
| LayoutAttr layout); | ||
|
|
||
| // Helper to get the distributed vector type for a given vector type according | ||
| // to a given LayoutAttr. | ||
charithaintc marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| FailureOr<VectorType> getDistributedVectorType(xegpu::TensorDescType tdescTy); | ||
|
|
||
| } // namespace xegpu | ||
|
|
||
| } // namespace mlir | ||
|
|
||
| #endif // MLIR_DIALECT_XEGPU_UTILS_XEGPUUTILS_H_ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| add_subdirectory(IR) | ||
| add_subdirectory(Transforms) | ||
| add_subdirectory(Utils) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,4 +16,5 @@ add_mlir_dialect_library(MLIRXeGPUTransforms | |
| MLIRPass | ||
| MLIRTransforms | ||
| MLIRGPUDialect | ||
| MLIRXeGPUUtils | ||
| ) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.