17 Commits

Author SHA1 Message Date
Chao Chen
9c697b3a02
[MLIR][XeGPU] Update the type of offsets for CreateDescOp and UpdateOffsetOp (#110741)
This PR changes the type of `offsets` operand of CreateDescOp and
UpdateOffsetOp to 1D Vector of index, for convenience of users.
2024-10-02 09:18:41 -05:00
Chao Chen
8b5e841487
[MLIR][XeGPU] Updates XeGPU TensorDescAttr and Refine Gather/Scatter definition (#109675)
Bring back #109144 with fixes to VectorToXeGPU
2024-09-24 10:14:13 -05:00
Chao Chen
09e94d09fd
Revert "[MLIR][XeGPU] Updates XeGPU TensorDescAttr and Refine Gather/Scatter definition. " (#109666)
Reverts llvm/llvm-project#109144
2024-09-23 09:32:37 -05:00
Chao Chen
2162723636
[MLIR][XeGPU] Updates XeGPU TensorDescAttr and Refine Gather/Scatter definition. (#109144)
The PR makes the following refine changes to the XeGPU dialect. 
1. Separated the old `TensorDescAttr` into two independent attributes: `BlockTensorDescAttr` and `ScatterTensorDescAttr`
2. Renamed the `MemoryScopeAttr` to `MemorySpaceAttr` and updated the enumeration value for shared memory following OpenCL standard.
3. Introduced `transpose` UnitAttr to `StoreScatterOp`and `LoadGatherOp`
4. Added memory space check for `CreateNdDesc` and `CreateDesc` op, as well as valid and invalid test cases for them.
2024-09-23 09:00:26 -05:00
Youngsuk Kim
123e8c735d [mlir] Don't call llvm::raw_string_ostream::flush() (NFC)
Don't call raw_string_ostream::flush(), which is essentially a no-op.
As specified in the docs, raw_string_ostream is always unbuffered.
( 65b13610a5226b84889b923bae884ba395ad084d for further reference )
2024-09-22 15:37:34 -05:00
Chao Chen
6c783e19ef
[MLIR][XeGPU] Refine XeGPU definitions (#100763)
This PR has following changes/fixes to XeGPU definition: 
- Fix type print format for atomic_rmw
- removed 2D support for MaskType
- Update LoadNd definition
   - Add 1D TensorDesc support 
   - Replaced vnni_axis attribute with packed attribute 
- Update DPAS op definition, limiting A to 2D vector, and B to either 2D/3D vector.
2024-08-02 17:10:02 -05:00
Artem Kroviakov
73a2fd470c
[mlir][xegpu] Patch dynamic descriptor creation (#93580)
fixes the bug in XeGPU's `CreateNdDescOp` tensor creation with dynamic offset and strides.
2024-06-05 14:39:05 -05:00
Chao Chen
03bb10dfb3
[MLIR][XeGPU] Add dpas, atomic, and named barrier ops (#88973)
---------

Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
Co-authored-by: Adam Siemieniuk <adam.siemieniuk@intel.com>
2024-04-24 14:29:11 -05:00
Christian Sigg
a5757c5b65
Switch member calls to isa/dyn_cast/cast/... to free function calls. (#89356)
This change cleans up call sites. Next step is to mark the member
functions deprecated.

See https://mlir.llvm.org/deprecation and
https://discourse.llvm.org/t/preferred-casting-style-going-forward.
2024-04-19 15:58:27 +02:00
Kazu Hirata
c9731a3dcc [mlir] Fix a warning about an extraneous semicolon
This patch fixes:

  mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp:58:2: error: extra ';'
  outside of a function is incompatible with C++98
  [-Werror,-Wc++98-compat-extra-semi]
2024-04-16 12:10:05 -07:00
Chao Chen
b01879ec1f
[MLIR][XeGPU] Add XeGPU scattered ops (#86594)
- Extended TensorDescAttr with scattered attribute
- Add scattered ops: CreateDescOp, PrefetchOp, LoadGatherOp,
StoreScatterOp, UpdateOffsetOp
- Add a block op: UpdateNdOffsetOp

---------

Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
Co-authored-by: Adam Siemieniuk <adam.siemieniuk@intel.com>
2024-04-16 13:44:14 -05:00
Jie Fu
258091e76d [mlir] Fix -Wunused-variable in XeGPUOps.cpp (NFC)
llvm-project/mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp:47:8:
error: unused variable 'ty' [-Werror,-Wunused-variable]
  auto ty = source.getType();
       ^
1 error generated.
2024-03-21 07:51:56 +08:00
Chao Chen
61b24c61a9
[MLIR][XeGPU] Adding XeGPU 2d block operators (#85804)
This PR adds XeGPU 2D block operators. It contains:
1. TensorDescType and TensorDescAttr definitions
2. MemoryScopeAttr and CacheHintAttr definitions which are used by
TensorDescAttr.
3. CreateNdDescOp, PrefetchNdOp, LoadNdOp, and StoreNdOp definitions,
and their corresponding testcases for illustration.

It cherry-picks daebe5c4f27ba140ac8d13abf41e3fe4db72b91a with asan fix.

---------

Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
2024-03-20 17:32:30 -05:00
Balaji V. Iyer
8d142043e8
Revert "[MLIR][XeGPU] Adding XeGPU 2d block operators (#84692)" (#85653)
This reverts commit daebe5c4f27ba140ac8d13abf41e3fe4db72b91a.

This commit causes the following asan issue:

```
<snip>/llvm-project/build/bin/mlir-opt <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir | <snip>/llvm-project/build/bin/FileCheck <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir
# executed command: <snip>/llvm-project/build/bin/mlir-opt <snip>/llvm-project/mlir/test/Dialect/XeGPU/XeGPUOps.mlir
# .---command stderr------------
# | =================================================================
# | ==2772558==ERROR: AddressSanitizer: stack-use-after-return on address 0x7fd2c2c42b90 at pc 0x55e406d54614 bp 0x7ffc810e4070 sp 0x7ffc810e4068
# | READ of size 8 at 0x7fd2c2c42b90 thread T0
# |     #0 0x55e406d54613 in operator()<long int const*> /usr/include/c++/13/bits/predefined_ops.h:318
# |     #1 0x55e406d54613 in __count_if<long int const*, __gnu_cxx::__ops::_Iter_pred<mlir::verifyListOfOperandsOrIntegers(Operation*, llvm::StringRef, unsigned int, llvm::ArrayRef<long int>, ValueRange)::<lambda(int64_t)> > > /usr/include/c++/13/bits/stl_algobase.h:2125
# |     #2 0x55e406d54613 in count_if<long int const*, mlir::verifyListOfOperandsOrIntegers(Operation*, 
...
```
2024-03-18 11:27:58 -05:00
Adrian Kuegel
bfd1d95de2 [mlir] Fix unused variable error in builds with asserts enabled. 2024-03-18 14:13:47 +00:00
Chao Chen
daebe5c4f2
[MLIR][XeGPU] Adding XeGPU 2d block operators (#84692)
Hi @joker-eph, This PR adds XeGPU 2D block operators. It contains:
1. `TensorDescType` and `TensorDescAttr` definitions
2. `MemoryScopeAttr` and `CacheHintAttr` definitions which are used by
`TensorDescAttr`.
3. `CreateNdDescOp`, `PrefetchNdOp`, `LoadNdOp`, and `StoreNdOp`
definitions, and their corresponding testcases for illustration.

---------

Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
2024-03-18 07:09:47 -05:00
Chao Chen
5669660f37
[MLIR] XeGPU dialect for Intel GPU - core definitions and base classes (#78483)
This PR follows our previous [RFC
](https://discourse.llvm.org/t/rfc-add-xegpu-dialect-for-intel-gpus/75723)
to add XeGPU dialect definition for Intel GPUs. It contains dialect,
type, attributes and operators definitions, as well as testcases for
semantic checks. The lowering and optimization passes will be issued
with separated passes.

---------

Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
2024-03-07 17:25:59 -06:00