warp icon indicating copy to clipboard operation
warp copied to clipboard

[QUESTION] Does tile support reading matrices from column-major arrays and performing operations?

Open lmtss opened this issue 11 months ago • 2 comments

As I understand, tile operations currently assume data is in row-major order by default. However, I noticed that there is a layout field in the tile-related code to describe the memory ordering. Is it possible to specify the major order?

class tile(Tile[DType, Shape]):
    """A Warp tile object.

    Attributes:
        dtype (DType): The data type of the tile
        shape (Shape): Dimensions of the tile
        storage (str): 'register' or 'shared' memory storage
        layout (str): 'rowmajor' or 'colmajor' layout  # here!!!!!!!!!!!!!!!!!!!!!!!!
        strides (tuple[int]): Number of tile elements between successive tile entries in each dimension
        size (int): Total number of tile elements
        owner (bool): Whether this tile aliases or owns its data

lmtss avatar Dec 16 '25 18:12 lmtss

It isn't possible to specify row or column-major order when loading data into tiles, but you can use wp.transpose() which effectively swaps the layout interpretation of the data.

daedalus5 avatar Dec 18 '25 19:12 daedalus5

It isn't possible to specify row or column-major order when loading data into tiles, but you can use wp.transpose() which effectively swaps the layout interpretation of the data.

Thank you. I'll try it out.

lmtss avatar Dec 19 '25 04:12 lmtss