Skip to content

Commit

Permalink
Init_tile takes memref not base address (i64) for load gather and sca…
Browse files Browse the repository at this point in the history
…tter (#930)
  • Loading branch information
Jianhui-Li authored Oct 18, 2024
1 parent c4210b3 commit bfd47e4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/rfcs/XeTile.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,13 @@ 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)
`init_tile` can create a tile with each element's address being explictly specified. The tile is created with a base address and offsets for all elements to be loaded. The result tile has a `scatter` attribute to distinguish it from the regular tile.
`init_tile` can create a tile with each element's address being explictly specified. The tile is created with a base memref and offsets for all elements to be loaded. The offsets and result tile can be either 1D or 2D. The resule tile has a `scatter` attribute to distinguish it from the regular tile.
```mlir
%tile0 = xetile.init_tile %base_addr, %tile_offsets:
i64, vector<1x256xindex> into tile<1x256xbf16, #scatter>
%tile0 = xetile.init_tile %base_memref, %tile_offsets:
memref<?xbf16>, vector<256xindex> into tile<256xbf16, #scatter>
%tile0 = xetile.init_tile %base_memref, %tile_offsets:
memref<?xbf16>, vector<8x64xindex> into tile<8x64xbf16, #scatter>
```
`load_gather` (aka. load) loads data with prepared tile and mask. Attribute `padding` specifies the padding value for the out-of-boundary access. The default value is zero.
```mlir
Expand Down

0 comments on commit bfd47e4

Please sign in to comment.