Skip to content
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

Extend XeTile.tile to support scatter load (experimental) #811

Merged
merged 9 commits into from
Oct 7, 2024

Conversation

Jianhui-Li
Copy link
Contributor

Please review these guidelines to help with the review process:

  • Have you provided a meaningful PR description?
  • Have you added a test, a reproducer, or a reference to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • If this PR is a work in progress, are you filing the PR as a draft?
  • Have you organized your commits logically and ensured each can be built by itself?

@Jianhui-Li Jianhui-Li changed the title Extend XeTile.tile support to cover nd memref and scatter load Extend XeTile.tile to support scatter load Jul 20, 2024
@Jianhui-Li Jianhui-Li marked this pull request as ready for review July 20, 2024 00:52
@Jianhui-Li Jianhui-Li changed the title Extend XeTile.tile to support scatter load Extend XeTile.tile to support scatter load (experimental) Jul 20, 2024
@@ -208,6 +207,22 @@ With the data being presented as 4D vector, all the vector based XeTile operatio
```
The tile_pack and tile_unpack operation is similar to pack and unpack operation of tensor dialect. The source vector must be a 2D dimension vector, and no permutation is allowed for the result 4D vector, so effectively the blocking effect is identical to tensor pack/unpack operation with inner_dims_pos = [0,1] inner_dims_pos = [0, 1].

## support for load_gather and store_scatter (experimental)
`load_gather` (aka. load) load data with each element's address being explictly specified. The tile is created with a base address and offset for each element to be load. The result tile has a `scatter` attribute to different it from the regular tile.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load ->loads

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

%tile0 = XeTile.init_tile %base_addr, %tile_offsets:
i64, vector<1x256xi32> into tile<1x256xbf16, #scatter>
```
`load_gather` (aka. load) load data with prepared tile and mask. Attribute `padding` specifies the padding value for the out-of-boundary access. The default value is zero.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load->loads

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -208,6 +207,22 @@ With the data being presented as 4D vector, all the vector based XeTile operatio
```
The tile_pack and tile_unpack operation is similar to pack and unpack operation of tensor dialect. The source vector must be a 2D dimension vector, and no permutation is allowed for the result 4D vector, so effectively the blocking effect is identical to tensor pack/unpack operation with inner_dims_pos = [0,1] inner_dims_pos = [0, 1].

## support for load_gather and store_scatter (experimental)
`load_gather` (aka. load) loads data with each element's address being explictly specified. The tile is created with a base address and offset for each element to be load. The result tile has a `scatter` attribute to different it from the regular tile.
Copy link
Contributor

@Garra1980 Garra1980 Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different - > distinguish?

"to be load" - > "to be loaded"

## support for load_gather and store_scatter (experimental)
`load_gather` (aka. load) loads data with each element's address being explictly specified. The tile is created with a base address and offset for each element to be load. The result tile has a `scatter` attribute to different it from the regular tile.
```mlir
%tile0 = XeTile.init_tile %base_addr, %tile_offsets:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XeTile->xetile here and below since it is a name for dialect operation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@Garra1980
Copy link
Contributor

@chencha3 pls take a look, do you think this is enough for now?

change XeTile. to xetile. in the code example
Copy link
Contributor

@chencha3 chencha3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Garra1980
Copy link
Contributor

let's merge after conflicts resolved

@Garra1980 Garra1980 merged commit 26fb4b5 into main Oct 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants