jax.experimental.pallas.mosaic_gpu.Tiling

jax.experimental.pallas.mosaic_gpu.Tiling#

class jax.experimental.pallas.mosaic_gpu.Tiling(tiles)[source]#

A tiling expression describing a permutation of elements of an nd-array.

To apply one level of tiling to an array, each of the trailing dimensions (up to the rank of the tile) is unfolded into two dimensions: first equal to the ratio of the dimension size and the tile size, and second equal to the tile size. Then, all newly unfolded minor dimensions are transposed to appear at the end.

This expression describes multi-level tiling, by applying each element of tiles in sequence to the array.

See https://openxla.org/xla/tiled_layout for a more detailed explanation.

Parameters:

tiles (tuple[tuple[int, ...], ...])

__init__(tiles)#
Parameters:

tiles (tuple[tuple[int, ...], ...])

Return type:

None

Methods

__init__(tiles)

canonicalize()

Returns a canonicalized version of the tiling.

remove_dimension(dim)

Returns a tiling with the given dimension removed.

tile_dimension(dim)

Result is True whenever the tiled dim originated from the given input dim.

tile_indices(indices)

tile_nested_shape_strides(shape, strides)

A fused version of tile_shape and tile_strides for nested shapes.

tile_shape(shape)

Computes the shape of an array after tiling.

tile_strides(strides)

Computes the strides of an array after tiling.

untile_indices(indices)

untile_shape(shape)

Computes the shape of an array before tiling from its tiled shape.

Attributes

tiles