Tiling
tiling
OperandTileInfo
dataclass
This records how one operand should be sliced when we enter a tile.
- source_type keeps the original type.
- loop_dims the loop dimension that comes from each indexing-map.
- result_shape the shape that tiled subview should have.
Source code in xdsl/dialects/linalg/transforms/tiling.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
source_type: MemRefType[Attribute]
instance-attribute
loop_dims: tuple[int, ...]
instance-attribute
result_shape: tuple[int, ...]
instance-attribute
__init__(source_type: MemRefType[Attribute], loop_dims: tuple[int, ...], result_shape: tuple[int, ...]) -> None
analyze(indexing_map: AffineMap, source_type: MemRefType[Attribute], tile_sizes: Sequence[int]) -> OperandTileInfo
staticmethod
Analyze how one operand should be sliced for each tile.
Source code in xdsl/dialects/linalg/transforms/tiling.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
TilingPlan
dataclass
This stores the information needed to turn one op into tiled loop and tiled subview.
- loop_ranges are original static loop ranges.
- tiled_dims the dimensions that really get tiled.
- operand_infos stores one OperandTileInfo per operand.
- tile_sizes are the normalized tile sizes, padded to match the op loop count.
Source code in xdsl/dialects/linalg/transforms/tiling.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
loop_ranges: tuple[int, ...]
instance-attribute
tiled_dims: tuple[int, ...]
instance-attribute
operand_infos: tuple[OperandTileInfo, ...]
instance-attribute
tile_sizes: tuple[int, ...]
instance-attribute
__init__(loop_ranges: tuple[int, ...], tiled_dims: tuple[int, ...], operand_infos: tuple[OperandTileInfo, ...], tile_sizes: tuple[int, ...]) -> None
analyze_generic_op(op: linalg.ops.GenericOp, tile_sizes: tuple[int, ...]) -> TilingPlan
staticmethod
Analyze one supported linalg.generic and return a TilingPlan.
Source code in xdsl/dialects/linalg/transforms/tiling.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
tile_linalg_generic(rewriter: PatternRewriter, op: linalg.ops.GenericOp, tile_sizes: tuple[int, ...]) -> bool
Rewrite supported linalg.generic ops into tiled formed.
Source code in xdsl/dialects/linalg/transforms/tiling.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | |