| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[mlir][NFC] update mlir/Dialect create APIs (18/n) (#149925) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in BufferViewFlowOpInterfaceImpl.cpp (NFC) | 11 个月前 | |
[mlir][memref] Add a new ReifyResultShapes pass (#145927) This pass reifies the shapes of a subset of ReifyRankedShapedTypeOpInterface ops with tensor results. The pass currently only supports result shape type reification for: - tensor::PadOp - tensor::ConcatOp It addresses a representation gap where implicit op semantics are needed to infer static result types from dynamic operands. But it does so by using ReifyRankedShapedTypeOpInterface as the source of truth rather than the op itself. As a consequence, this cannot generalize today. TODO: in the future, we should consider coupling this information with op "transfer functions" (e.g. IndexingMapOpInterface) to provide a source of truth that can work across result shape inference, canonicalization and op verifiers. The pass replaces the operations with their reified versions, when more static information can be derived, and inserts casts when results shapes are updated. Example: mlir #map = affine_map<(d0) -> (-d0 + 256)> func.func @func(%arg0: f32, %arg1: index, %arg2: tensor<64x?x64xf32>) -> tensor<1x?x64xf32> { %0 = affine.apply #map(%arg1) %extracted_slice = tensor.extract_slice %arg2[0, 0, 0] [1, %arg1, 64] [1, 1, 1] : tensor<64x?x64xf32> to tensor<1x?x64xf32> %padded = tensor.pad %extracted_slice low[0, 0, 0] high[0, %0, 0] { ^bb0(%arg3: index, %arg4: index, %arg5: index): tensor.yield %arg0 : f32 } : tensor<1x?x64xf32> to tensor<1x?x64xf32> return %padded : tensor<1x?x64xf32> } // mlir-opt --reify-result-shapes #map = affine_map<()[s0] -> (-s0 + 256)> func.func @func(%arg0: f32, %arg1: index, %arg2: tensor<64x?x64xf32>) -> tensor<1x?x64xf32> { %0 = affine.apply #map()[%arg1] %extracted_slice = tensor.extract_slice %arg2[0, 0, 0] [1, %arg1, 64] [1, 1, 1] : tensor<64x?x64xf32> to tensor<1x?x64xf32> %padded = tensor.pad %extracted_slice low[0, 0, 0] high[0, %0, 0] { ^bb0(%arg3: index, %arg4: index, %arg5: index): tensor.yield %arg0 : f32 } : tensor<1x?x64xf32> to tensor<1x256x64xf32> %cast = tensor.cast %padded : tensor<1x256x64xf32> to tensor<1x?x64xf32> return %cast : tensor<1x?x64xf32> } --------- Co-authored-by: Fabian Mora <fabian.mora-cordero@amd.com> | 1 年前 | |
[mlir][memref] Support test-compose-subview dynamic size (#146881) Supports the case where the sizes of the subview op is dynamic.When there are more for loops in the tile algorithm, multiple subviews are performed and test-compose-subview does not work when the size operand of the subview ops is dynamic value. | 1 年前 | |
[MLIR] Apply clang-tidy fixes for readability-container-size-empty in EmulateNarrowType.cpp (NFC) | 10 个月前 | |
[MLIR] Fix typo of the word "pattern" in CAPI and docs (#163780) This includes the rename from mlirOpRewritePattenCreate to mlirOpRewritePatternCreate in CAPI, and other typo fixes in docs and code comments. | 9 个月前 | |
[mlir][NFC] update mlir/Dialect create APIs (18/n) (#149925) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir][NFC] update mlir/Dialect create APIs (18/n) (#149925) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir][memref] Remove invalid extract_aligned_pointer_as_index folding in ExpandStridedMetadata (#167615) RewriteExtractAlignedPointerAsIndexOfViewLikeOp tries to propagate extract_aligned_pointer_as_index through the view ops. ViewLikeOpInterface by itself doesn't guarantee to preserve the base pointer and memref.view is one such example, so limit pattern to a few specific ops. | 8 个月前 | |
[mlir][NFC] update mlir/Dialect create APIs (18/n) (#149925) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir] Simplify Default cases in type switches. NFC. (#165767) Use default values instead of lambdas when possible. std::nullopt and nullptr can be used now because of https://github.com/llvm/llvm-project/pull/165724. | 9 个月前 | |
[milr][memref]: Fold expand_shape + transfer_read (#167679) Extend the load of a expand shape rewrite pattern to support folding a memref.expand_shape and vector.transfer_read when the permutation map on vector.transfer_read is a minor identity. --------- Signed-off-by: Jack Frankland <jack.frankland@arm.com> | 8 个月前 | |
[mlir][NFC] update mlir/Dialect create APIs (33/n) (#150659) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir][MemRef] Address TODO to use early_inc to simplify elimination of uses (NFC) (#155123) | 11 个月前 | |
[mlir][NFC] update mlir/Dialect create APIs (18/n) (#149925) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir][NFC] update mlir/Dialect create APIs (18/n) (#149925) See https://github.com/llvm/llvm-project/pull/147168 for more info. | 1 年前 | |
[mlir][Interfaces] Add interface methods to allow reifying single result/single dim of result. (#162924) Current implementation of reifyResultShapes forces all implementations to return all dimensions of all results. This can be wasteful when you only require dimensions of one result, or a single dimension of a result. Further this also creates issues with using patterns to resolve the tensor.dim and memref.dim operations since the extra operations created result in the pattern rewriter entering an infinite loop (eventually breaking out of the loop due to the iteration limit on the pattern rewriter). This is demonstrated by some of the test cases added here that hit this limit when using --resolve-shaped-type-result-dims and --resolve-ranked-shaped-type-result-dims. To resolve this issue the interface should allow for creating just the operations needed. This change is the first step in resolving this. The original implementation was done with the restriction in mind that it might not always be possible to compute dimension of a single result or one dimension of a single result in all cases. To account for such cases, two additional interface methods are added - reifyShapeOfResult (which allows reifying dimensions of just one result), has a default implementation that calls reifyResultShapes and returns the dimensions of a single result. - reifyDimOfResult (which allows reifying a single dimension of a single result) has a default implementation that calls reifyDimOfResult and returns the value for the dimension of the result (which in turn for the default case would call reifyDimOfResult). While this change sets up the interface, ideally most operations will implement the refiyDimOfResult when possible. For almost all operations in tree this is true. Subsequent commits will change those incrementally. Some of the tests added here that check that the default implementations for the above method work as expected, also end up hitting the pattern rewriter limit when using --resolve-ranked-shaped-type-result-dims/ --resolve-ranked-shaped-type-result-dims. For testing purposes, a flag is added to these passes that ignore the error returned by the pattern application (this flag is left on by default to maintain current state). Changes required downstream to integrate this change 1. In operation definitions in .td files, for those operations that implement the ReifyRankedShapedTypeOpInterface. def <op-name> : Op<..., [..., DeclareOpInterfaceMethods[ReifyRankedShapedTypeOpInterface]]> should be changed to def <op-name> : Op<..., [..., DeclareOpInterfaceMethods[ReifyRankedShapedTypeOpInterface, [ "reifyResultShapes"]]]> --------- Signed-off-by: MaheshRavishankar <mahesh.ravishankar@gmail.com> | 8 个月前 | |
[mlir][memref] Fix runtime verification for memref.subview for empty memref subviews (#166581) This PR applies the same fix from #166569 to memref.subview. That PR fixed the issue for tensor.extract_slice, and this one addresses the identical problem for memref.subview. The runtime verification for memref.subview incorrectly rejects valid empty subviews (size=0) starting at the memref boundary. **Example that demonstrates the issue:** mlir func.func @subview_with_empty_slice(%memref: memref<10x4x1xf32, strided<[?, ?, ?], offset: ?>>, %dim_0: index, %dim_1: index, %dim_2: index, %offset: index) { // When called with: offset=10, dim_0=0, dim_1=4, dim_2=1 // Runtime verification fails: "offset 0 is out-of-bounds" %subview = memref.subview %memref[%offset, 0, 0] [%dim_0, %dim_1, %dim_2] [1, 1, 1] : memref<10x4x1xf32, strided<[?, ?, ?], offset: ?>> to memref<?x?x?xf32, strided<[?, ?, ?], offset: ?>> return } When %offset=10 and %dim_0=0, we're creating an empty subview (zero elements along dimension 0) starting at the boundary. The current verification enforces offset < dim_size, which evaluates to 10 < 10 and fails. I feel this should be valid since no memory is accessed. **The fix:** Same as #166569 - make the offset check conditional on subview size: - Empty subview (size == 0): allow 0 <= offset <= dim_size - Non-empty subview (size > 0): require 0 <= offset < dim_size Please see #166569 for motivation and rationale. --- Co-authored-by: Hanumanth Hanumantharayappa <hhanuman@ah-hhanuman-l.dhcp.mathworks.com> | 8 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 8 个月前 |