forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GlobalOpt][CPU] Move to using indexing maps for data tiling encoding…
…s instead of named op enums (iree-org#15984) This PR adds a `user_indexing_maps` attribute to `linalg_ext.encoding`, and uses this attribute in MaterializeEncoding in place of the case-by-case enums for matmul and batch_matmul. This will enable data tiling on transposed matmul cases like `linalg.matmul_transpose_a`, and is a step towards data-tiling of `linalg.generic` contraction ops. In SetEncoding, the `user_indexing_maps` attribute is set, containing the indexing maps of the LHS, RHS, and RESULT of the op to be data-tiled. The case-by-case checks are removed by this PR, and transposed `linalg::ContractionOpInterface` ops are allowed to get encodings. The `MATMUL` and `BATCH_MATMUL` user encodings are kept for now, but will eventually be removed. In MaterializeEncoding, the `user_indexing_maps` are used to infer the contraction dimensions (M, N, K, Batch) of the inputs, and a `tensor.pack` op is created with appropriate `inner_dims_pos` and `outer_dims_perm` to transpose and pack the input into the canonical `linalg.mmt4d` input shapes.
- Loading branch information
Showing
8 changed files
with
1,536 additions
and
784 deletions.
There are no files selected for viewing
1,350 changes: 865 additions & 485 deletions
1,350
compiler/src/iree/compiler/Codegen/Common/CPU/test/llvmcpu_materialize_encoding.mlir
Large diffs are not rendered by default.
Oops, something went wrong.
115 changes: 65 additions & 50 deletions
115
compiler/src/iree/compiler/Codegen/Common/CPU/test/vmvx_materialize_encoding.mlir
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.