#
c2470810 |
| 24-Nov-2020 |
Nicolas Vasilache <nicolas.vasilache@gmail.com> |
[mlir] NFC - Refactor and expose a helper printOffsetSizesAndStrides helper function.
Print part of an op of the form: ``` <optional-offset-prefix>`[` offset-list `]` <optional-size-prefix>`[` s
[mlir] NFC - Refactor and expose a helper printOffsetSizesAndStrides helper function.
Print part of an op of the form: ``` <optional-offset-prefix>`[` offset-list `]` <optional-size-prefix>`[` size-list `]` <optional-stride-prefix>[` stride-list `]` ```
Also address some leftover nits.
Differential revision: https://reviews.llvm.org/D92031
show more ...
|
#
11ea2e24 |
| 23-Nov-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir][Linalg] NFC: Expose some utility functions used for promotion.
Exposing some utility functions from Linalg to allow for promotion of fused views outside of the core tile+fuse logic. This is a
[mlir][Linalg] NFC: Expose some utility functions used for promotion.
Exposing some utility functions from Linalg to allow for promotion of fused views outside of the core tile+fuse logic. This is an alternative to patch D91322 which adds the promotion logic to the tileAndFuse method. Downside with that approach is that it is not easily customizable based on needs.
Differential Revision: https://reviews.llvm.org/D91503
show more ...
|
#
e65a5e5b |
| 23-Nov-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)
Enhance the tile+fuse logic to allow fusing a sequence of operations.
Make sure the value used to obtain tile shape is a SubViewOp/SubT
[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)
Enhance the tile+fuse logic to allow fusing a sequence of operations.
Make sure the value used to obtain tile shape is a SubViewOp/SubTensorOp. Current logic used to get the bounds of loop depends on the use of `getOrCreateRange` method on `SubViewOp` and `SubTensorOp`. Make sure that the value/dim used to compute the range is from such ops. This fix is a reasonable WAR, but a btter fix would be to make `getOrCreateRange` method be a method of `ViewInterface`.
Differential Revision: https://reviews.llvm.org/D90991
show more ...
|
#
0caa82e2 |
| 20-Nov-2020 |
Mikhail Goncharov <goncharov.mikhail@gmail.com> |
Revert "[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)"
This reverts commit f8284d21a8e294d58a0acd4b8b2e906d7a9f110c.
Revert "[mlir][Linalg] NFC: Expose some utility functions used f
Revert "[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)"
This reverts commit f8284d21a8e294d58a0acd4b8b2e906d7a9f110c.
Revert "[mlir][Linalg] NFC: Expose some utility functions used for promotion."
This reverts commit 0c59f51592ef5c014352994369f5216c6376fae1.
Revert "Remove unused isZero function"
This reverts commit 0f9f0a4046e11c2b4c130640f343e3b2b5db08c1.
Change f8284d21 led to multiple failures in IREE compilation.
show more ...
|
#
0f9f0a40 |
| 20-Nov-2020 |
Geoffrey Martin-Noble <gcmn@google.com> |
Remove unused isZero function
Unused since https://reviews.llvm.org/D91503 and triggering -Wunused-function
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D91838
|
#
0c59f515 |
| 20-Nov-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir][Linalg] NFC: Expose some utility functions used for promotion.
Exposing some utility functions from Linalg to allow for promotion of fused views outside of the core tile+fuse logic. This is a
[mlir][Linalg] NFC: Expose some utility functions used for promotion.
Exposing some utility functions from Linalg to allow for promotion of fused views outside of the core tile+fuse logic. This is an alternative to patch D91322 which adds the promotion logic to the tileAndFuse method. Downside with that approach is that it is not easily customizable based on needs.
Differential Revision: https://reviews.llvm.org/D91503
show more ...
|
#
f8284d21 |
| 20-Nov-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)
Enhance the tile+fuse logic to allow fusing a sequence of operations.
Differential Revision: https://reviews.llvm.org/D90991
|
#
5ca20851 |
| 12-Nov-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir][Linalg] Improve the logic to perform tile and fuse with better dependence tracking.
This change does two main things 1) An operation might have multiple dependences to the same producer. N
[mlir][Linalg] Improve the logic to perform tile and fuse with better dependence tracking.
This change does two main things 1) An operation might have multiple dependences to the same producer. Not tracking them correctly can result in incorrect code generation with fusion. To rectify this the dependence tracking needs to also have the operand number in the consumer. 2) Improve the logic used to find the fused loops making it easier to follow. The only constraint for fusion is that linalg ops (on buffers) have update semantics for the result. Fusion should be such that only one iteration of the fused loop (which is also a tiled loop) must touch only one (disjoint) tile of the output. This could be relaxed by allowing for recomputation that is the default when oeprands are tensors, or can be made legal with promotion of the fused view (in future).
Differential Revision: https://reviews.llvm.org/D90579
show more ...
|
#
9b17bf2e |
| 29-Oct-2020 |
Nicolas Vasilache <nicolas.vasilache@gmail.com> |
[mlir][Linalg] Make Linalg fusion a test pass
Linalg "tile-and-fuse" is currently exposed as a Linalg pass "-linalg-fusion" but only the mechanics of the transformation are currently relevant. Inste
[mlir][Linalg] Make Linalg fusion a test pass
Linalg "tile-and-fuse" is currently exposed as a Linalg pass "-linalg-fusion" but only the mechanics of the transformation are currently relevant. Instead turn it into a "-test-linalg-greedy-fusion" pass which performs canonicalizations to enable more fusions to compose. This allows dropping the OperationFolder which is not meant to be used with the pattern rewrite infrastructure.
Differential Revision: https://reviews.llvm.org/D90394
show more ...
|
#
b6eb26fd |
| 27-Oct-2020 |
River Riddle <riddleriver@gmail.com> |
[mlir][NFC] Move around the code related to PatternRewriting to improve layering
There are several pieces of pattern rewriting infra in IR/ that really shouldn't be there. This revision moves those
[mlir][NFC] Move around the code related to PatternRewriting to improve layering
There are several pieces of pattern rewriting infra in IR/ that really shouldn't be there. This revision moves those pieces to a better location such that they are easier to evolve in the future(e.g. with PDL). More concretely this revision does the following:
* Create a Transforms/GreedyPatternRewriteDriver.h and move the apply*andFold methods there. The definitions for these methods are already in Transforms/ so it doesn't make sense for the declarations to be in IR.
* Create a new lib/Rewrite library and move PatternApplicator there. This new library will be focused on applying rewrites, and will also include compiling rewrites with PDL.
Differential Revision: https://reviews.llvm.org/D89103
show more ...
|
#
37e0fdd0 |
| 26-Oct-2020 |
Nicolas Vasilache <nicolas.vasilache@gmail.com> |
[mlir][Linalg] Add basic support for TileAndFuse on Linalg on tensors.
This revision allows the fusion of the producer of input tensors in the consumer under a tiling transformation (which produces
[mlir][Linalg] Add basic support for TileAndFuse on Linalg on tensors.
This revision allows the fusion of the producer of input tensors in the consumer under a tiling transformation (which produces subtensors). Many pieces are still missing (e.g. support init_tensors, better refactor LinalgStructuredOp interface support, try to merge implementations and reuse code) but this still allows getting started.
The greedy pass itself is just for testing purposes and will be extracted in a separate test pass.
Differential revision: https://reviews.llvm.org/D89491
show more ...
|
#
a3adcba6 |
| 06-Oct-2020 |
Nicolas Vasilache <nicolas.vasilache@gmail.com> |
[mlir][Linalg] Implement tiling on tensors
This revision implements tiling on tensors as described in: https://llvm.discourse.group/t/an-update-on-linalg-on-tensors/1878/4
Differential revision: ht
[mlir][Linalg] Implement tiling on tensors
This revision implements tiling on tensors as described in: https://llvm.discourse.group/t/an-update-on-linalg-on-tensors/1878/4
Differential revision: https://reviews.llvm.org/D88733
show more ...
|
#
e3de249a |
| 02-Oct-2020 |
Nicolas Vasilache <ntv@google.com> |
[mlir] Add a subtensor operation
This revision introduces a `subtensor` op, which is the counterpart of `subview` for a tensor operand. This also refactors the relevant pieces to allow reusing the `
[mlir] Add a subtensor operation
This revision introduces a `subtensor` op, which is the counterpart of `subview` for a tensor operand. This also refactors the relevant pieces to allow reusing the `subview` implementation where appropriate.
This operation will be used to implement tiling for Linalg on tensors.
show more ...
|
#
c6ea095b |
| 01-Oct-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir][Linalg] NFC : Move fusion on tensors to separate file.
Differential Revision: https://reviews.llvm.org/D88633
|
#
c694588f |
| 30-Sep-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir][Linalg] Add pattern to tile and fuse Linalg operations on buffers.
The pattern is structured similar to other patterns like LinalgTilingPattern. The fusion patterns takes options that allows
[mlir][Linalg] Add pattern to tile and fuse Linalg operations on buffers.
The pattern is structured similar to other patterns like LinalgTilingPattern. The fusion patterns takes options that allows you to fuse with producers of multiple operands at once. - The pattern fuses only at the level that is known to be legal, i.e if a reduction loop in the consumer is tiled, then fusion should happen "before" this loop. Some refactoring of the fusion code is needed to fuse only where it is legal. - Since the fusion on buffers uses the LinalgDependenceGraph that is not mutable in place the fusion pattern keeps the original operations in the IR, but are tagged with a marker that can be later used to find the original operations.
This change also fixes an issue with tiling and distribution/interchange where if the tile size of a loop were 0 it wasnt account for in these.
Differential Revision: https://reviews.llvm.org/D88435
show more ...
|
#
6b649570 |
| 29-Sep-2020 |
Nicolas Vasilache <ntv@google.com> |
[mlir][Linalg] Refactor Linalg op initTensors support - NFC
Manually-defined named ops do not currently support `init_tensors` or return values and may never support them. Add extra interface to the
[mlir][Linalg] Refactor Linalg op initTensors support - NFC
Manually-defined named ops do not currently support `init_tensors` or return values and may never support them. Add extra interface to the StructuredOpInterface so that we can still write op-agnostic transformations based on StructuredOpInterface.
This is an NFC extension in preparation for tiling on tensors.
Differential Revision: https://reviews.llvm.org/D88481
show more ...
|
#
ed229132 |
| 21-Sep-2020 |
Nicolas Vasilache <ntv@google.com> |
[mlir][Linalg] Uniformize linalg.generic with named ops.
This revision allows representing a reduction at the level of linalg on tensors for generic ops by uniformizing with the named ops approach.
|
#
136eb79a |
| 07-Sep-2020 |
Frederik Gossen <frgossen@google.com> |
[MLIR][Standard] Add `dynamic_tensor_from_elements` operation
With `dynamic_tensor_from_elements` tensor values of dynamic size can be created. The body of the operation essentially maps the index s
[MLIR][Standard] Add `dynamic_tensor_from_elements` operation
With `dynamic_tensor_from_elements` tensor values of dynamic size can be created. The body of the operation essentially maps the index space to tensor elements.
Declare SCF operations in the `scf` namespace to avoid name clash with the new `std.yield` operation. Resolve ambiguities between `linalg/shape/std/scf.yield` operations.
Differential Revision: https://reviews.llvm.org/D86276
show more ...
|
#
8782c727 |
| 28-Aug-2020 |
Benjamin Kramer <benny.kra@googlemail.com> |
Strength-reduce SmallVectors to arrays. NFCI.
|
#
eb4efa88 |
| 28-Aug-2020 |
Hanhan Wang <hanchung@google.com> |
[mlir][Linalg] Enhance Linalg fusion on generic op and tensor_reshape op.
The tensor_reshape op was only fusible only if it is a collapsing case. Now we propagate the op to all the operands so there
[mlir][Linalg] Enhance Linalg fusion on generic op and tensor_reshape op.
The tensor_reshape op was only fusible only if it is a collapsing case. Now we propagate the op to all the operands so there is a further chance to fuse it with generic op. The pre-conditions are:
1) The producer is not an indexed_generic op. 2) All the shapes of the operands are the same. 3) All the indexing maps are identity. 4) All the loops are parallel loops. 5) The producer has a single user.
It is possible to fuse the ops if the producer is an indexed_generic op. We still can compute the original indices. E.g., if the reshape op collapses the d0 and d1, we can use DimOp to get the width of d1, and calculate the index `d0 * width + d1`. Then replace all the uses with it. However, this pattern is not implemented in the patch.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D86314
show more ...
|
#
8f6e84ba |
| 27-Jul-2020 |
MaheshRavishankar <ravishankarm@google.com> |
[mlir][Linalg] Enable fusion of std.constant (producer) with linalg.indexed_generic (consumer) with tensor arguments.
The implementation of fusing std.constant producer with a linalg.indexed_generic
[mlir][Linalg] Enable fusion of std.constant (producer) with linalg.indexed_generic (consumer) with tensor arguments.
The implementation of fusing std.constant producer with a linalg.indexed_generic consumer was already in place. It is exposed with this change. Also cleaning up some of the patterns that implement the fusion to not be templated, thereby avoiding lot of conditional checks for calling the right instantiation.
Differential Revision: https://reviews.llvm.org/D84566
show more ...
|
#
f9c8febc |
| 20-Jul-2020 |
Jakub Lichman <limo@google.com> |
[mlir] Added support for symbols inside linalg.generic and map concatenation
This commit adds functionality needed for implementation of convolutions with linalg.generic op. Since linalg.generic rig
[mlir] Added support for symbols inside linalg.generic and map concatenation
This commit adds functionality needed for implementation of convolutions with linalg.generic op. Since linalg.generic right now expects indexing maps to be just permutations, offset indexing needed in convolutions is not possible. Therefore in this commit we address the issue by adding support for symbols inside indexing maps which enables more advanced indexing. The upcoming commit will solve the problem of computing loop bounds from such maps.
Differential Revision: https://reviews.llvm.org/D83158
show more ...
|
#
9db53a18 |
| 07-Jul-2020 |
River Riddle <riddleriver@gmail.com> |
[mlir][NFC] Remove usernames and google bug numbers from TODO comments.
These were largely leftover from when MLIR was a google project, and don't really follow LLVM guidelines.
|
#
ee394e68 |
| 29-Jun-2020 |
Rahul Joshi <jurahul@google.com> |
[MLIR] Add variadic isa<> for Type, Value, and Attribute
- Also adopt variadic llvm::isa<> in more places. - Fixes https://bugs.llvm.org/show_bug.cgi?id=46445
Differential Revision: https://reviews
[MLIR] Add variadic isa<> for Type, Value, and Attribute
- Also adopt variadic llvm::isa<> in more places. - Fixes https://bugs.llvm.org/show_bug.cgi?id=46445
Differential Revision: https://reviews.llvm.org/D82769
show more ...
|
#
27fca575 |
| 03-Jun-2020 |
Hanhan Wang <hanchung@google.com> |
[mlir][Linalg] Add support for fusion between indexed_generic ops and tensor_reshape ops
Summary: The fusion for tensor_reshape is embedding the information to indexing maps, thus the exising patten
[mlir][Linalg] Add support for fusion between indexed_generic ops and tensor_reshape ops
Summary: The fusion for tensor_reshape is embedding the information to indexing maps, thus the exising pattenr also works for indexed_generic ops.
Depends On D80347
Differential Revision: https://reviews.llvm.org/D80348
show more ...
|