24 Commits

Author SHA1 Message Date
Nishant Patel
8e17f80908
[MLIR][XeGPU] Distribute vector.step & vector.shape_cast op from wg to sg (#155443)
This PR adds patterns to distribute vector.step and vector.shape_cast op
from wg to sg and it also enables constant, broadcast and elementwise
ops to handle the slice attribute
2025-09-12 14:33:52 -07:00
Charitha Saumya
9b0d7ddb04
[mlir][xegpu] Add support for vector.multi_reduction and vector.shape_cast SIMT distribution. (#157560)
Add support for distributing the `vector.multi_reduction` operation
across lanes in a warp. Currently only 2D to 1D reductions are
supported. Given layouts for the source and accumulator vectors,
* If the reduction dimension is distributed across lanes, the reduction
is non-lane-local and the reduction is done using warp shuffles. Here we
simply rewrite the `MultiDimReductionOp` to a sequence of `ReductionOp`s
inside the warp op body. Actual distribution will be done by
`WarpOpReduction` pattern.
* If the reduction dimension is not distributed across lanes, the
reduction is lane-local. In this case, we yield the source and
accumulator vectors from the warp op and perform the lane-local
reduction outside the warp op using a sequence of `ReductionOp`s.

PR also adds support for distributing `vector.shape_cast` based on
layouts.
2025-09-12 09:37:04 -07:00
Jakub Kuderski
2ed3f49c49
[mlir] Use free op create functions. NFC. (#157374)
The builder create methods are deprecated:
https://mlir.llvm.org/deprecation/. See
https://discourse.llvm.org/t/psa-opty-create-now-with-100-more-tab-complete/87339.
2025-09-07 22:13:20 -04:00
Nishant Patel
fdfc751d39
[MLIR][XeGPU] Distribute load_gather/store_scatter op from Wg To Sg (#154420)
This PR adds distribution patterns for scatter ops (LoadGather and
StoreScatter) with offsets.
2025-09-01 13:56:02 -07:00
Chao Chen
c96e2cdd13
[mlir][XeGPU] Update utils for LayoutAttr and SliceAttr support (#154819) 2025-08-27 12:37:15 -05:00
Chao Chen
68d6866428
[mlir][XeGPU] add WgToSg distribution pattern for load_matrix and store_matrix. (#154403) 2025-08-21 10:02:45 -05:00
Nishant Patel
4a9d038acd
[MLIR][XeGPU] Distribute load_nd/store_nd/prefetch_nd with offsets from Wg to Sg (#153432)
This PR adds pattern to distribute the load/store/prefetch nd ops with
offsets from workgroup to subgroup IR. This PR is part of the transition
to move offsets from create_nd to load/store/prefetch nd ops.

Create_nd PR : #152351
2025-08-18 09:45:29 -07:00
Jacques Pienaar
4bf33958da
[mlir] Update builders to use new form. (#154132)
Mechanically applied using clang-tidy.
2025-08-18 15:19:34 +00:00
Chao Chen
9c4e571ae8
[mlir][xegpu] Add definitions of MemDescType and related ops. (#153273) 2025-08-15 18:02:13 -05:00
Nishant Patel
af87214b84
[MLIR][XeGPU] Add pattern for arith.constant for wg to sg distribution (#151977) 2025-08-13 13:52:07 -07:00
Nishant Patel
88ff0f955c
[MLIR][XeGPU] Distribute create_nd_desc op without offset from Wg to Sg (#152351)
This PR adds pattern to distribute the create_nd_desc op without offsets
from workgroup (Wg) IR to subgroup (Sg) IR.
The round robin distribution logic (involves offset calculation) now
will happen in load/store/prefetch nd ops instead of create_nd.
2025-08-11 21:58:24 -07:00
Chao Chen
c96223434c
[mlir][xegpu] Add definition of SliceAttr (#150146)
---------

Co-authored-by: Charitha Saumya <136391709+charithaintc@users.noreply.github.com>
2025-08-08 11:27:17 -05:00
Maksim Levental
c610b24493
[mlir][NFC] update mlir/Dialect create APIs (27/n) (#150638)
See https://github.com/llvm/llvm-project/pull/147168 for more info.
2025-07-25 11:48:32 -05:00
Nishant Patel
65dec99562
[MLIR][XeGPU] Add support for subgroup_id_range (#148661)
This PR adds a new attribute to the xegpu dialect called xegpu.range.
One use case of this attribute can be to attach subgroup_id_range to
scf.if of to drive the execution.
2025-07-23 11:10:35 -07:00
Chao Chen
317dae1a7e
[mlir][xegpu] Add initial skeleton implementation for lowering ConvertLayoutOp (#146176)
This PR adds initial skeleton implementation for lowering
ConvertLayoutOp. It currently only supports cases where SLM is not
needed.

---------

Co-authored-by: Adam Siemieniuk <adam.siemieniuk@intel.com>
2025-07-23 11:35:40 -05:00
Jianhui Li
90944b85c5
[MLIR][XeGPU] Add offset operands to load_nd/store_nd/prefetch_nd (#149424)
This PR allows load_nd/store_nd/prefetch_nd to take an additional offset
operand.
It is based on this PR https://github.com/llvm/llvm-project/pull/148335.
Now user can create a nd_tdesc with no offset, and instead set the
offset with the load_nd operation.
2025-07-23 09:00:51 -07:00
Nishant Patel
56b263b1bd
[MLIR][XeGPU] Add transformation pattern for vector.broadcast in Wg to Sg pass (#144417)
This PR adds transformation pattern for vector.broadcast op in
xegpu-wg-to-sg-distribute pass
2025-07-23 08:41:53 -07:00
Maksim Levental
7b78796543
[mlir][NFC] update mlir/Dialect create APIs (25/n) (#149932)
See https://github.com/llvm/llvm-project/pull/147168 for more info.
2025-07-21 19:57:59 -04:00
Chao Chen
5d849d3a90
[mlir][xegpu] Fix seg-fault caused by setting a null attribute (#146002) 2025-07-01 15:42:52 -05:00
Nishant Patel
8063bd153c
[MLIR][XeGPU] Add support for elementwise ops in Wg to Sg distribute pass [1/N] (#142797)
This PR adds support for Elementwise operations' (unary & binary)
lowering from Workgroup to Subgroup.
2025-06-17 09:55:02 -07:00
Chao Chen
5578bcbcfd
[mlir][xegpu] add support for structure control flow ops in workgroup to subgroup distribution (#142618)
This PR introduces support for `scf::ForOp`, `scf::WhileOp`, `scf::If`,
and `scf::Condition` within the workgroup-subgroup-distribution pass,
leveraging the `SCFStructuralTypeConversionsAndLegality`.
2025-06-13 12:32:46 -05:00
Nishant Patel
a7ede51b55
[mlir][XeGPU] Add XeGPU Workgroup to Subgroup Distribution Pass (#140805)
This PR adds the XeGPU workgroup (wg) to subgroup (sg) pass. The wg to
sg pass transforms the xegpu wg level operations to subgroup operations
based on the sg_layout and sg_data attribute. The PR adds transformation
patterns for following Ops

1. CreateNdDesc
2. LoadNd
3. StoreNd
4. PrefetchNd
5. UpdateNdOffset
6. Dpas
2025-05-21 08:08:46 -05:00
Jan Patrick Lehr
b99e57583e
Revert "[mlir] [XeGPU] Add XeGPU workgroup to subgroup pass (#139477)" (#140779)
This reverts commit 747620db2a02b889ae3ba3921d6c0e526a3e7677.

Multiple bot failures
2025-05-20 20:31:00 +02:00
Nishant Patel
747620db2a
[mlir] [XeGPU] Add XeGPU workgroup to subgroup pass (#139477)
This PR adds the XeGPU workgroup (wg) to subgroup (sg) pass. The wg to
sg pass transforms the xegpu wg level operations to subgroup operations
based on the sg_layout and sg_data attribute. The PR adds transformation
patterns for following Ops

1. CreateNdDesc
2. LoadNd
3. StoreNd
4. PrefetchNd
4. UpdateNdOffset
5. Dpas
2025-05-20 12:35:50 -05:00