diff --git a/docs/rfcs/XeGPU.md b/docs/rfcs/XeGPU.md index 2bc35432e..421515e13 100644 --- a/docs/rfcs/XeGPU.md +++ b/docs/rfcs/XeGPU.md @@ -61,7 +61,7 @@ create_nd_tdesc creates a tensor descriptor that covers an array of 2D subtensor into tensor_desc<8x16xbf16, array_length=2> ``` -create_nd_tdesc also accepts a memref as input instead of a memory address, shapes, and sizes. +create_nd_tdesc also accepts a memref as input instead of a memory address, shapes, and sizes. The memref can be high-dimension. ```mlir #sg_map_a = xegpu.sg_map %tdesc1 = XeGPU.create_nd_tdesc %mref, %offsets:2 @@ -71,6 +71,10 @@ create_nd_tdesc also accepts a memref as input instead of a memory address, shap %tdesc2 = XeGPU.create_nd_tdesc %mref, %offsets:2 {mode =vc} : memref<1024x1024xbf16>, index, index into tensor_desc<8x16xbf16> + + %tdesc2 = XeGPU.create_nd_tdesc %mref, %offsets:4 {mode =vc} + : memref<4x4x1024x1024xbf16>, index, index + into tensor_desc<8x16xbf16> ``` The example below accepts a memory address and an offset and creates a 1D tensor_desc. The tensor_desc describes a 1D vector that is loaded by all WI threads combined within the subgroup. diff --git a/docs/rfcs/XeTile.md b/docs/rfcs/XeTile.md index ffdc33704..7dc8abd82 100644 --- a/docs/rfcs/XeTile.md +++ b/docs/rfcs/XeTile.md @@ -45,6 +45,13 @@ To create a 2D Tile memory descriptor, the user needs to set up a tile (init_til %tile0 = XeTile.init_tile %base_memref, [%tile_offset:2] : memref<128x128xbf16> into tile<8x16xbf16> ``` + +`init_tile` can take high-dimension memref as input. The innermost two dimension of input memref are used to derive the tile's base_shape and base_strides. +```mlir + %tile0 = XeTile.init_tile %base_memref, [%tile_offset:4] : + memref<4x4x128x128xbf16> into tile<8x16xbf16> +``` + `init_tile` with memref of dynamic shape. The memref has a dynamic shape, so that its shape and strides have to be passed as runtime parameters to init_tile. ```mlir %tile0 = XeTile.init_tile %base_memref, [%tile_offset:2], [%base_shape:2], [%base_strides:2]: @@ -61,9 +68,15 @@ To create a 2D Tile memory descriptor, the user needs to set up a tile (init_til ```mlir #tile_attr = #xetile.tile_attr %tile0 = XeTile.init_tile %base_memref, [%tile_offset:2]: - memref<128x128xbf16, affine_map=<(d0, d1)->(d1, d0)> into tile<64x32xbf16, #tile_attr> + memref<128x128xbf16, affine_map=<(d0, d1)->(d1, d0)>> into tile<64x32xbf16, #tile_attr> ``` +The tile with `order` attribute can be created from the high-dimension memref. +```mlir + #tile_attr = #xetile.tile_attr + %tile0 = XeTile.init_tile %base_memref, [%tile_offset:4]: + memref<4x4x128x128xbf16, affine_map=<(d3, d2, d0, d1)->(d3, d2, d1, d0)>> into tile<64x32xbf16, #tile_attr> +``` With the tile date type, XeTile supports load_tile, prefetch_tile, and store_tile.