| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[MLIR][AArch64] Lower vector.contract to SVE FEAT_BF16 operations (#147052) This patch adds lowering of Bfloat16 widening matrix multiply and accumulate vector.contract, by parametrising and refactoring the pattern for 8-bit integers. | 1 年前 | |
[mlir][Vector] Fold vector.step compared to constant (#161615) This PR adds a canonicalizer to vector.step that folds vector.step iff the result of the fold is a splat value. An alternative would be to always constant fold it, but that might result in some very large/cumbersome constants. I do wonder if vector.step might be better represented as some sort of attribute in the arith dialect, like %step = arith.constant iota<32> : vector<32xindex>. --------- Signed-off-by: James Newling <james.newling@gmail.com> | 9 个月前 | |
[mlir][vector] Tidy-up testing for to/from_elements unrolling (#158309) 1. Remove TestUnrollVectorToElements and TestUnrollVectorFromElements test passes - these are not required. 2. Make "vector-from-elements-lowering.mlir" use TD Op for testing (for consistency "vector-to-elements-lowering.mlir" and to make sure that the TD Op, transform.apply_patterns.vector.unroll_from_elements, is tested). 3. Unify CHECK prefixes (CHECK-UNROLL -> CHECK). 4. Rename @to_elements_1d as @negative_unroll_to_elements_1d, for consistency with it's counterpart for vector.from_elements and to align with our testing guide (*). (*) https://mlir.llvm.org/getting_started/TestingGuide/#after-step-3-add-the-newly-identified-missing-case | 10 个月前 | |
[mlir][vector][gpu] Align minf/maxf reduction kind names with arith (#75901) This is to avoid confusion when dealing with reduction/combining kinds. For example, see a recent PR comment: https://github.com/llvm/llvm-project/pull/75846#discussion_r1430722175. Previously, they were picked to mostly mirror the names of the llvm vector reduction intrinsics: https://llvm.org/docs/LangRef.html#llvm-vector-reduce-fmin-intrinsic. In isolation, it was not clear if <maxf> has arith.maxnumf or arith.maximumf semantics. The new reduction kind names map 1:1 to arith ops, which makes it easier to tell/look up their semantics. Because both the vector and the gpu dialect depend on the arith dialect, it's more natural to align names with those in arith than with the lowering to llvm intrinsics. Issue: https://github.com/llvm/llvm-project/issues/72354 | 2 年前 | |
[mlir] Remove dialect specific bufferization passes (Reland) (#93535) These passes have been depreciated for a long time and replaced by one-shot bufferization. These passes are also unsafe because they do not check for read-after-write conflicts. Relands https://github.com/llvm/llvm-project/pull/93488 which failed on buildbot. Fixes the failure by updating integration tests to use one-shot-bufferize instead. | 2 年前 | |
[MLIR] Extend vector.scatter to accept tensor as base (#165548) This PR makes the following improvements to vector.scatter and its lowering pipeline: - In addition to memref, accept a ranked tensor as the base operand of vector.scatter, similar to vector.transfer_write. - Implement bufferization support for vector.scatter, so that tensor-based scatter ops can be fully lowered to memref-based forms. It's worth to complete the functionality of map_scatter decomposition. Full discussion can be found here: https://github.com/iree-org/iree/issues/21135 --------- Signed-off-by: Ryutaro Okada <1015ryu88@gmail.com> | 8 个月前 | |
[MLIR] [Vector] Added canonicalizer for folding from_elements + transpose (#161841) ## Description Adds a new canonicalizer that folds vector.from_elements(vector.transpose)) => vector.from_elements. This canonicalization reorders the input elements for vector.from_elements, adjusts the output shape to match the effect of the transpose op and eliminating its need. ## Testing Added a 2D vector lit test that verifies the working of the rewrite. --------- Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha@gmail.com> | 9 个月前 | |
[mlir][vector] Add patterns to simplify chained reductions (#73048) Chained reductions get created during vector unrolling. These patterns simplify them into a series of adds followed by a final reductions. This is preferred on GPU targets like SPIR-V/Vulkan where vector reduction gets lowered into subgroup operations that are generally more expensive than simple vector additions. For now, only the add combining kind is handled. | 2 年前 | |
[mlir][vector] Support complete folding in single pass for vector.insert/vector.extract (#142124) ### Description This patch improves the folding efficiency of vector.insert and vector.extract operations by not returning early after successfully converting dynamic indices to static indices. This PR also renames the test pass TestConstantFold to TestSingleFold and adds comprehensive documentation explaining the single-pass folding behavior. ### Motivation Since the OpBuilder::createOrFold function only calls fold **once**, the current fold methods of vector.insert and vector.extract may leave the op in a state that can be folded further. For example, consider the following un-folded IR: %v1 = vector.insert %e1, %v0 [0] : f32 into vector<128xf32> %c0 = arith.constant 0 : index %e2 = vector.extract %v1[%c0] : f32 from vector<128xf32> If we use createOrFold to create the vector.extract op, then the result will be: %v1 = vector.insert %e1, %v0 [127] : f32 into vector<128xf32> %e2 = vector.extract %v1[0] : f32 from vector<128xf32> But this is not the optimal result. createOrFold should have returned %e1. The reason is that the execution of fold returns immediately after extractInsertFoldConstantOp, causing subsequent folding logics to be skipped. --------- Co-authored-by: Yang Bai <yangb@nvidia.com> | 1 年前 | |
[mlir][vector] Add pattern for dropping unit dims from for loops (#109585) This adds a pattern for dropping unit dims from the iter_args of scf.for ops using vector.shape_cast. This composes with the other patterns for dropping unit dims from elementwise ops and transposes. | 1 年前 | |
[mlir][vector][nfc] Update test for mask elimination (#112130) Updates one example so that: * it uses vector.mask, * upper loop bound is a multiple of the loop step, * use vector.outerproduct instead of "test.some_computation". This makes this example a bit closer to realistic cases, which has always been the goal for this test. | 1 年前 | |
[mlir][vector] Restrict narrow-type-emulation patterns (#115612) All patterns in populateVectorNarrowTypeEmulationPatterns currently assume a 1-D vector load/store rather than an n-D vector load/store. This assumption is evident in ConvertVectorTransferRead, for example, here (extracted from ConvertVectorTransferRead): cpp auto newRead = rewriter.create<vector::TransferReadOp>( loc, VectorType::get(numElements, newElementType), adaptor.getSource(), getValueOrCreateConstantIndexOp(rewriter, loc, linearizedIndices), newPadding); auto bitCast = rewriter.create<vector::BitCastOp>( loc, VectorType::get(numElements * scale, oldElementType), newRead); Both invocations of VectorType::get() here generate a 1-D vector. Attempts to use these patterns with more generic cases, such as 2-D vectors, fail. For example, trying to cast the following 2-D case to i32: mlir func.func @vector_maskedload_2d_i8_negative( %idx1: index, %idx2: index, %num_elems: index, %passthru: vector<2x4xi8>) -> vector<2x4xi8> { %0 = memref.alloc() : memref<3x4xi8> %mask = vector.create_mask %num_elems, %num_elems : vector<2x4xi1> %1 = vector.maskedload %0[%idx1, %idx2], %mask, %passthru : memref<3x4xi8>, vector<2x4xi1>, vector<2x4xi8> into vector<2x4xi8> return %1 : vector<2x4xi8> } For example, casting to i32 produces: bash error: 'vector.bitcast' op failed to verify that all of {source, result} have same rank %1 = vector.maskedload %0[%idx1, %idx2], %mask, %passthru : ^ Instead of reworking these patterns (that's going to require much more effort), I’ve marked them as 1-D only and extended "TestEmulateNarrowTypePass" with an option to disable the Memref type converter - that's to be able to add negative tests (otherwise, the type converter throws an error we can't really test for). While not ideal, this workaround should suit a test pass. | 1 年前 | |
[MLIR] Make 1-D memref flattening a prerequisite for vector narrow type emulation (#157771) Addresses: https://github.com/llvm/llvm-project/issues/115653 We already have utilities to flatten memrefs into 1-D. This change makes memref flattening a prerequisite for vector narrow type emulation, ensuring that emulation patterns only need to handle 1-D scenarios. | 10 个月前 | |
[mlir][vector] Generalize folding of ext-contractionOp to other types. (#96593) Many state of the art models and quantization operations are now directly working on vector.contract on integers. This commit enables generalizes ext-contraction folding S.T we can emit more performant vector.contracts on codegen pipelines. Signed-off-by: Stanley Winata <stanley.winata@amd.com> | 2 年前 | |
[mlir][Vector] Add initial support for inlining in the presence of vector ops (#70942) | 2 年前 | |
[MLIR][Vector] Remove vector.splat (#162167) vector.splat has been deprecated (user: please use the very similar vector.broadcast instead) with the last PR landing about 6 weeks ago. The discourse discussion is at https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/1 The last PR was #152230 This PR completely removes vector.splat. In addition to removing vector.splat from VectorOps.td, it - Updates the few remaining places where vector::SplatOp is created (now vector::BroadcastOp is created) - Removes temporary patterns where vector.splat is replaced by vector.broadcast The only place 'vector.splat' appears is now the files https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/test/corpus/op.txt and https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/dialect/vector.js --------- Signed-off-by: James Newling <james.newling@gmail.com> | 9 个月前 | |
[MLIR] Extend vector.scatter to accept tensor as base (#165548) This PR makes the following improvements to vector.scatter and its lowering pipeline: - In addition to memref, accept a ranked tensor as the base operand of vector.scatter, similar to vector.transfer_write. - Implement bufferization support for vector.scatter, so that tensor-based scatter ops can be fully lowered to memref-based forms. It's worth to complete the functionality of map_scatter decomposition. Full discussion can be found here: https://github.com/iree-org/iree/issues/21135 --------- Signed-off-by: Ryutaro Okada <1015ryu88@gmail.com> | 8 个月前 | |
[mlir][vector] Separate bitwidth specific tests out (#138071) In https://github.com/llvm/llvm-project/pull/136581 the logic pertaining to bitwidth was removed from the patterns. This PR further factorizes bitwidth logic out of the main test file. The number of tests with bitwidth (in the new file added in this PR) is now lower than before this PR. This is because this PR only tests the bitwidth specific logic once (there was a fair amount of redundant testing before). I didn't do this test refactoring in https://github.com/llvm/llvm-project/pull/136581 because I wanted to make it clear that it was NFC by leaving the tests unchanged there | 1 年前 | |
[mlir][Vector] Pattern to linearize broadcast (#163845) The PR https://github.com/llvm/llvm-project/pull/162167 removed a pattern to linearize vector.splat, without adding the equivalent pattern for vector.broadcast. This PR adds such a pattern, hopefully brining vector.broadcast up to full parity with vector.splat that has now been removed. --------- Signed-off-by: James Newling <james.newling@gmail.com> | 9 个月前 | |
[mlir][vector] Add vector.to_elements unrolling (#157142) This PR adds support for unrolling vector.to_element's source operand. It transforms mlir %0:8 = vector.to_elements %v : vector<2x2x2xf32> to mlir %v0 = vector.extract %v[0] : vector<2x2xf32> from vector<2x2x2xf32> %v1 = vector.extract %v[1] : vector<2x2xf32> from vector<2x2x2xf32> %0:4 = vector.to_elements %v0 : vector<2x2xf32> %1:4 = vector.to_elements %v1 : vector<2x2xf32> // %0:8 = %0:4 - %1:4 This pattern will be applied until there are only 1-D vectors left. --------- Signed-off-by: hanhanW <hanhan0912@gmail.com> Co-authored-by: hanhanW <hanhan0912@gmail.com> Co-authored-by: Jakub Kuderski <kubakuderski@gmail.com> | 10 个月前 | |
[mlir][vector] Handle empty MaskOp in LowerVectorMask, MaskOpRewritePattern (#72031) This patch adds handling of an empty MaskOp to MaskOpRewritePattern and thereby fixes a crash. It also pulls the MaskOp canonicalization patterns into LowerVectorMask so that empty MaskOps are folded away in the Pass. Fix https://github.com/llvm/llvm-project/issues/71036 | 2 年前 | |
[mlir][vector] Add tests for scalable vectors in one-shot-bufferize.mlir (#102361) | 1 年前 | |
[MLIR] Extend vector.scatter to accept tensor as base (#165548) This PR makes the following improvements to vector.scatter and its lowering pipeline: - In addition to memref, accept a ranked tensor as the base operand of vector.scatter, similar to vector.transfer_write. - Implement bufferization support for vector.scatter, so that tensor-based scatter ops can be fully lowered to memref-based forms. It's worth to complete the functionality of map_scatter decomposition. Full discussion can be found here: https://github.com/iree-org/iree/issues/21135 --------- Signed-off-by: Ryutaro Okada <1015ryu88@gmail.com> | 8 个月前 | |
[mlir][Vector] Remove usage of vector.insertelement/extractelement from Vector (#144413) This PR is part of the last step to remove vector.extractelement and vector.insertelement ops. RFC: https://discourse.llvm.org/t/rfc-psa-remove-vector-extractelement-and-vector-insertelement-ops-in-favor-of-vector-extract-and-vector-insert-ops It removes instances of vector.extractelement and vector.insertelement from the Vector dialect layer. | 1 年前 | |
[mlir][vector] Add a new TD Op for patterns leveraging ShapeCastOp (#110525) Adds a new Transform Dialect Op that collects patters for dropping unit dims from various Ops: * transform.apply_patterns.vector.drop_unit_dims_with_shape_cast. It excludes patterns for vector.transfer Ops - these are collected under: * apply_patterns.vector.rank_reducing_subview_patterns, and use ShapeCastOp _and_ SubviewOp to reduce the rank (and to eliminate unit dims). This new TD Ops allows us to test the "ShapeCast folder" pattern in isolation. I've extracted the only test that I could find for that folder from "vector-transforms.mlir" and moved it to a dedicated file: "shape-cast-folder.mlir". I also added a test case with scalable vectors. Changes in VectorTransforms.cpp are not needed (added a comment with a TODO + ordered the patterns alphabetically). I am Including them here to avoid a separate PR. | 1 年前 | |
[mlir][vector] Fix attaching write effects on transfer_write's base (#142940) This fixes an issue with TransferWriteOp's implementation of the MemoryEffectOpInterface where the write effect was attached to the stored value rather than the base. This had the effect that when asking for the memory effects for the input memref buffer using getEffectsOnValue(...), the function would return no-effects (as the effect would have been attached to the stored value rather than the input buffer). | 1 年前 | |
[mlir][vector] Support complete folding in single pass for vector.insert/vector.extract (#142124) ### Description This patch improves the folding efficiency of vector.insert and vector.extract operations by not returning early after successfully converting dynamic indices to static indices. This PR also renames the test pass TestConstantFold to TestSingleFold and adds comprehensive documentation explaining the single-pass folding behavior. ### Motivation Since the OpBuilder::createOrFold function only calls fold **once**, the current fold methods of vector.insert and vector.extract may leave the op in a state that can be folded further. For example, consider the following un-folded IR: %v1 = vector.insert %e1, %v0 [0] : f32 into vector<128xf32> %c0 = arith.constant 0 : index %e2 = vector.extract %v1[%c0] : f32 from vector<128xf32> If we use createOrFold to create the vector.extract op, then the result will be: %v1 = vector.insert %e1, %v0 [127] : f32 into vector<128xf32> %e2 = vector.extract %v1[0] : f32 from vector<128xf32> But this is not the optimal result. createOrFold should have returned %e1. The reason is that the execution of fold returns immediately after extractInsertFoldConstantOp, causing subsequent folding logics to be skipped. --------- Co-authored-by: Yang Bai <yangb@nvidia.com> | 1 年前 | |
[mlir][Vector] Add a Broadcast::createBroadcastOp helper This helper handles non trivial cases of broadcast + optional transpose creation that should not leak to the outside world. Differential Revision: https://reviews.llvm.org/D139003 | 3 年前 | |
[mlir][GPU] Implement ValueBoundsOpInterface for GPU ID operations (#122190) The GPU ID operations already implement InferIntRangeInterface, which gives constant lower and upper bounds on those IDs when appropriate metadata is prentent on the operations or in the surrounding context. This commit uses that existing code to implement the ValueBoundsOpInterface, which is used when analyzing affine operations (unlike the integer range interface, which is used for arithmetic optimization). It also implements the interface for gpu.launch, where we can use it to express the constraint that block/grid sizes are equal to their value from outside the launch op and that the corresponding IDs are bounded above by that size. As a consequence, the test pass for this inference is updated to work on a FunctionOpInterface and not a func.func, creating minor churn in other tests. | 1 年前 | |
[mlir] use transform-interpreter in test passes (#70040) Update most test passes to use the transform-interpreter pass instead of the test-transform-dialect-interpreter-pass. The new "main" interpreter pass has a named entry point instead of looking up the top-level op with PossibleTopLevelOpTrait, which is arguably a more understandable interface. The change is mechanical, rewriting an unnamed sequence into a named one and wrapping the transform IR in to a module when necessary. Add an option to the transform-interpreter pass to target a tagged payload op instead of the root anchor op, which is also useful for repro generation. Only the test in the transform dialect proper and the examples have not been updated yet. These will be updated separately after a more careful consideration of testing coverage of the transform interpreter logic. | 2 年前 | |
[MLIR][Vector] Test to accompany bug fix (#154434) Bug introduced in https://github.com/llvm/llvm-project/pull/93664 The bug was fixed in https://github.com/llvm/llvm-project/pull/152957 But there was no test. This PR adds a test that hits the assertion failure if the fix is reverted (if I change dyn_cast to cast). | 11 个月前 | |
[mlir][GPU] Implement ValueBoundsOpInterface for GPU ID operations (#122190) The GPU ID operations already implement InferIntRangeInterface, which gives constant lower and upper bounds on those IDs when appropriate metadata is prentent on the operations or in the surrounding context. This commit uses that existing code to implement the ValueBoundsOpInterface, which is used when analyzing affine operations (unlike the integer range interface, which is used for arithmetic optimization). It also implements the interface for gpu.launch, where we can use it to express the constraint that block/grid sizes are equal to their value from outside the launch op and that the corresponding IDs are bounded above by that size. As a consequence, the test pass for this inference is updated to work on a FunctionOpInterface and not a func.func, creating minor churn in other tests. | 1 年前 | |
[mlir][Vector] Introduce poison in LowerVectorBitCast/Broadcast/Transpose (#126180) This PR continues with the introduction of poison as initialization vector, in this particular case, in LowerVectorBitCast, LowerVectorBroadcast and LowerVectorTranspose. | 1 年前 | |
[mlir][vector] Disable BreakDownVectorBitCast for scalable vectors (#122725) BreakDownVectorBitCast leverages * vector.extract_strided_slices + vector.insert_strided_slices As these Ops do not support extracting scalable sub-vectors (i.e. extracting/inserting a fraction of a scalable dim), it's best to bail out. | 1 年前 | |
[mlir][vector] Avoid use of vector.splat in transforms (#150279) This is part of vector.splat deprecation Reference: https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/5 Instead of creating vector::SplatOp, create vector::BroadcastOp | 11 个月前 | |
[mlir][vector] Fix integer promotion type mismatch We need to create a new type with transposed shape after transposing the operand in CanonicalizeContractMatmulToMMT. Reviewed By: kuhar, dcaballe Differential Revision: https://reviews.llvm.org/D148470 | 3 年前 | |
[mlir] Extract RHS rows once when lowering vector.contract to dot (#130130) The vector.contract op on two matrices A and B will be lowered to individual dot products of each row and column of A and B respectively. The existing lowering will extract each column of B for each row of A, which leads to multiple values in the IR representing the same columns of B. This PR makes changes to the ContractOpToDotLowering to make sure that the columns of B are only ever extracted once, so then the SSA values representing the extracted columns are then re-used in the IR for later dot products. I have updated the existing vector-contract-to-dot-transforms test. | 1 年前 | |
[mlir][vector] Refine Vector to LLVM lowering options (#159553) This is a follow-up to https://github.com/llvm/llvm-project/pull/144307, where we removed vector.matrix_multiply and vector.flat_transpose from the Vector dialect. This PR: * Updates comments that were missed in the previous change. * Renames relevant -convert-vector-to-llvm= options: - vector-contract-lowering=matmul → vector-contract-lowering=llvmintr - vector-transpose-lowering=flat_transpose → vector-transpose-lowering=llvmintr These new names better reflect the actual transformation target - LLVM intrinsics - rather than the now-removed abstract operations. | 10 个月前 | |
[mlir][nfc] Update tests for Contract -> Op transforms (#76054) Updates two tests for vector.contract -> vector.outerproduct transformations: 1. Rename "vector-contract-to-outerproduct-transforms.mlir" as "vector-contract-to-outerproduct-matmul-transforms.mlir". The new name more accurate captures what's being tested. it is also consistent with "vector-contract-to-outerproduct-matvec-transforms.mlir", which covers vector matvec operations and makes finding relevant tests easier. 2. For matmul tests, move the traits definining the iteration spaces to the top of the file. This is consistent with how matvec tests are defined and also makes it easy to quickly identify what cases are covered. 3. For matmul tests, use more meaningful names for function arguments. This helps keep things consistent across the file (i.e. function definitions wih check lines and comments). 4. For matvec test, move a few tests around so that the most basic case (without masking) is first. 5. Update comments. | 2 年前 | |
[mlir] split transform interfaces into a separate library (#85221) Transform interfaces are implemented, direction or via extensions, in libraries belonging to multiple other dialects. Those dialects don't need to depend on the non-interface part of the transform dialect, which includes the growing number of ops and transitive dependency footprint. Split out the interfaces into a separate library. This in turn requires flipping the dependency from the interface on the dialect that has crept in because both co-existed in one library. The interface shouldn't depend on the transform dialect either. As a consequence of splitting, the capability of the interpreter to automatically walk the payload IR to identify payload ops of a certain kind based on the type used for the entry point symbol argument is disabled. This is a good move by itself as it simplifies the interpreter logic. This functionality can be trivially replaced by a transform.structured.match operation. | 2 年前 | |
[mlir] use transform-interpreter in test passes (#70040) Update most test passes to use the transform-interpreter pass instead of the test-transform-dialect-interpreter-pass. The new "main" interpreter pass has a named entry point instead of looking up the top-level op with PossibleTopLevelOpTrait, which is arguably a more understandable interface. The change is mechanical, rewriting an unnamed sequence into a named one and wrapping the transform IR in to a module when necessary. Add an option to the transform-interpreter pass to target a tagged payload op instead of the root anchor op, which is also useful for repro generation. Only the test in the transform dialect proper and the examples have not been updated yet. These will be updated separately after a more careful consideration of testing coverage of the transform interpreter logic. | 2 年前 | |
[mlir][vector] Add n-d deinterleave lowering (#94237) This patch implements the lowering for vector deinterleave for vector of n-dimensions. Process involves unrolling the n-d vector to a series of one-dimensional vectors. The deinterleave operation is then used on these vectors. From: %0, %1 = vector.deinterleave %a : vector<2x8xi8> -> vector<2x4xi8> To: %cst = arith.constant dense<0> : vector<2x4xi32> %0 = vector.extract %arg0[0] : vector<8xi32> from vector<2x8xi32> %res1, %res2 = vector.deinterleave %0 : vector<8xi32> -> vector<4xi32> %1 = vector.insert %res1, %cst [0] : vector<4xi32> into vector<2x4xi32> %2 = vector.insert %res2, %cst [0] : vector<4xi32> into vector<2x4xi32> %3 = vector.extract %arg0[1] : vector<8xi32> from vector<2x8xi32> %res1_0, %res2_1 = vector.deinterleave %3 : vector<8xi32> -> vector<4xi32> %4 = vector.insert %res1_0, %1 [1] : vector<4xi32> into vector<2x4xi32> %5 = vector.insert %res2_1, %2 [1] : vector<4xi32> into vector<2x4xi32> ...etc. | 2 年前 | |
[mlir][test] Fix filecheck annotation typos [2/n] (#93476) Few more fixes previous: https://github.com/llvm/llvm-project/pull/92897 pr Issues from https://github.com/llvm/llvm-project/issues/93154 unfixed. --------- Co-authored-by: klensy <nightouser@gmail.com> | 2 年前 | |
[MLIR][Vector] Remove vector.splat (#162167) vector.splat has been deprecated (user: please use the very similar vector.broadcast instead) with the last PR landing about 6 weeks ago. The discourse discussion is at https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/1 The last PR was #152230 This PR completely removes vector.splat. In addition to removing vector.splat from VectorOps.td, it - Updates the few remaining places where vector::SplatOp is created (now vector::BroadcastOp is created) - Removes temporary patterns where vector.splat is replaced by vector.broadcast The only place 'vector.splat' appears is now the files https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/test/corpus/op.txt and https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/dialect/vector.js --------- Signed-off-by: James Newling <james.newling@gmail.com> | 9 个月前 | |
[mlir][vector] Document ConvertVectorStore + unify var names (nfc) (#126422) 1. Documents ConvertVectorStore. As the generated output is rather complex, I have refined the comments + variable names in: * "vector-emulate-narrow-type-unaligned-non-atomic.mlir", to serve as reference for this pattern. 2. As a follow-on for #123527, renames isAlignedEmulation to isFullyAligned and numSrcElemsPerDest to emulatedPerContainerElem. | 1 年前 | |
[mlir][vector] Fix emulation of "narrow" type vector.store (#133231) Below are two examples of "narrow" vector.stores. The first example does not require partial stores and hence no RMW stores. This is currently emulated correctly. mlir func.func @example_1(%arg0: vector<4xi2>) { %0 = memref.alloc() : memref<13xi2> %c4 = arith.constant 4 : index vector.store %arg0, %0[%c4] : memref<13xi2>, vector<4xi2> return } The second example requires a partial (and hence RMW) store due to the offset pointing outside the emulated type boundary (%c3). mlir func.func @example_2(%arg0: vector<4xi2>) { %0 = memref.alloc() : memref<13xi2> %c3 = arith.constant 3 : index vector.store %arg0, %0[%c3] : memref<13xi2>, vector<4xi2> return } This is currently incorrectly emulated as a single "full" store (note that the offset is incorrect) instead of partial stores: mlir func.func @example_2(%arg0: vector<4xi2>) { %alloc = memref.alloc() : memref<4xi8> %0 = vector.bitcast %arg0 : vector<4xi2> to vector<1xi8> %c0 = arith.constant 0 : index vector.store %0, %alloc[%c0] : memref<4xi8>, vector<1xi8> return } The incorrect emulation stems from this simplified (i.e. incomplete) calculation of the front padding: cpp std::optional<int64_t> foldedNumFrontPadElems = isDivisibleInSize ? 0 : getConstantIntValue(linearizedInfo.intraDataOffset); Since isDivisibleInSize is true (i8 / i2 = 4): * front padding is set to 0 and, as a result, * the input offset (%c3) is ignored, and * we incorrectly assume that partial stores won't be needed. Note that in both examples we are storing vector<4xi2> into memref<13xi2> (note _different_ trailing dims) and hence partial stores might in fact be required. The condition above is updated to: cpp std::optional<int64_t> foldedNumFrontPadElems = (isDivisibleInSize && trailingDimsMatch) ? 0 : getConstantIntValue(linearizedInfo.intraDataOffset); This change ensures that the input offset is properly taken into account, which fixes the issue. It doesn't affect @example1. Additional comments are added to clarify the current logic. | 1 年前 | |
[mlir][MemRef] Add support for emulating narrow floats (#148036) This enables memref.load/store + vector.load/store support for sub-byte float types. Since the memref types don't matter for loads/stores, we still use the same types as integers with equivalent widths, with a few extra bitcasts needed around certain operations. There is no direct change needed for vector.load/store support. The tests added for them are to verify that float types are supported as well. | 1 年前 | |
[mlir][vector] add result type to vector.extract assembly format (#66499) The vector.extract assembly format currently only contains the source type, for example: %1 = vector.extract %0[1] : vector<3x7x8xf32> it's not immediately obvious if this is the source or result type. This patch improves the assembly format to make this clearer, so the above becomes: %1 = vector.extract %0[1] : vector<7x8xf32> from vector<3x7x8xf32> | 2 年前 | |
[mlir][vector] Tidy-up testing for to/from_elements unrolling (#158309) 1. Remove TestUnrollVectorToElements and TestUnrollVectorFromElements test passes - these are not required. 2. Make "vector-from-elements-lowering.mlir" use TD Op for testing (for consistency "vector-to-elements-lowering.mlir" and to make sure that the TD Op, transform.apply_patterns.vector.unroll_from_elements, is tested). 3. Unify CHECK prefixes (CHECK-UNROLL -> CHECK). 4. Rename @to_elements_1d as @negative_unroll_to_elements_1d, for consistency with it's counterpart for vector.from_elements and to align with our testing guide (*). (*) https://mlir.llvm.org/getting_started/TestingGuide/#after-step-3-add-the-newly-identified-missing-case | 10 个月前 | |
[mlir][vector] Propagate alignment in LowerVectorGather. (#155683) Alignment is properly propagated when patterns UnrollGather, RemoveStrideFromGatherSource, or Gather1DToConditionalLoads are applied. | 10 个月前 | |
[mlir][vector] Add result type to interleave assembly format (#93392) This is to make it more obvious for what the result type is, especially with some less trivial cases like 0-d inputs resulting in 1-d inputs or interaction with scalable vector types. Note that vector.deinterleave uses the same format with explicit result type. Also improve examples and clean up surrounding code. | 2 年前 | |
[mlir][vector] Add result type to interleave assembly format (#93392) This is to make it more obvious for what the result type is, especially with some less trivial cases like 0-d inputs resulting in 1-d inputs or interaction with scalable vector types. Note that vector.deinterleave uses the same format with explicit result type. Also improve examples and clean up surrounding code. | 2 年前 | |
[mlir][Vector] Move vector.insert canonicalizers for DenseElementsAttr to folders (#128040) This PR moves vector.insert canonicalizers for DenseElementsAttr (splat and non splat case) to folders. Folders are local, and it's always better to implement a folder than a canonicalizer. This PR is mostly NFC-ish, because the functionality mostly remains same, but is now run as part of a folder, which is why some tests are changed, because GreedyPatternRewriter tries to fold by default. | 1 年前 | |
[mlir] split transform interfaces into a separate library (#85221) Transform interfaces are implemented, direction or via extensions, in libraries belonging to multiple other dialects. Those dialects don't need to depend on the non-interface part of the transform dialect, which includes the growing number of ops and transitive dependency footprint. Split out the interfaces into a separate library. This in turn requires flipping the dependency from the interface on the dialect that has crept in because both co-existed in one library. The interface shouldn't depend on the transform dialect either. As a consequence of splitting, the capability of the interpreter to automatically walk the payload IR to identify payload ops of a certain kind based on the type used for the entry point symbol argument is disabled. This is a good move by itself as it simplifies the interpreter logic. This functionality can be trivially replaced by a transform.structured.match operation. | 2 年前 | |
[mlir][vector][nfc] Update tests for folding mem operations (#164255) Tests in "fold_maskedload_to_load_all_true_dynamic" excercise folders for: * vector.maskedload, vector.maskedstore, vector.scatter, vector.gather, vector.compressstore, vector.expandload. This patch renames and documents these tests in accordance with: * https://mlir.llvm.org/getting_started/TestingGuide/ Note: the updated tests are referenced in the Test Formatting Best Practices section of the MLIR testing guide: * https://mlir.llvm.org/getting_started/TestingGuide/#test-formatting-best-practices Keeping them aligned with the guidelines ensures consistency and clarity across MLIR’s test suite. | 9 个月前 | |
[mlir][Vector] Remove trivial uses of vector.extractelement/vector.insertelement (1/N) (#116053) This patch removes trivial usages of vector.extractelement/vector.insertelement. These operations can be fully represented by vector.extract/vector.insert. See https://discourse.llvm.org/t/rfc-psa-remove-vector-extractelement-and-vector-insertelement-ops-in-favor-of-vector-extract-and-vector-insert-ops/71116 for more information. Further patches will remove more usages of these ops. | 1 年前 | |
[mlir] split transform interfaces into a separate library (#85221) Transform interfaces are implemented, direction or via extensions, in libraries belonging to multiple other dialects. Those dialects don't need to depend on the non-interface part of the transform dialect, which includes the growing number of ops and transitive dependency footprint. Split out the interfaces into a separate library. This in turn requires flipping the dependency from the interface on the dialect that has crept in because both co-existed in one library. The interface shouldn't depend on the transform dialect either. As a consequence of splitting, the capability of the interpreter to automatically walk the payload IR to identify payload ops of a certain kind based on the type used for the entry point symbol argument is disabled. This is a good move by itself as it simplifies the interpreter logic. This functionality can be trivially replaced by a transform.structured.match operation. | 2 年前 | |
[MLIR][Vector] Add support for inner-parallel masked multi-reductions (#126722) This commit adds support to lower inner-parallel flavor of masked vector multi-reductions. | 1 年前 | |
[mlir][vector] Avoid use of vector.splat in transforms (#150279) This is part of vector.splat deprecation Reference: https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/5 Instead of creating vector::SplatOp, create vector::BroadcastOp | 11 个月前 | |
[NFC] Fix typos 'seperate' -> 'separate' (#144368) Correct few typos: 'seperate' -> 'separate' . | 10 个月前 | |
[mlir][vector] Move tests for rewriteAlignedSubByteInt{Ext|Trunc} (nfc) (#126416) Moves tests for rewriteAlignedSubByteIntExt and rewriteAlignedSubByteIntTrunc into a dedicated files. Also adds + fixes some comments. This is merely for better organisation and so that it's easier to identify the patterns and edge cases being tested. | 1 年前 | |
[mlir][vector] Move tests for rewriteAlignedSubByteInt{Ext|Trunc} (nfc) (#126416) Moves tests for rewriteAlignedSubByteIntExt and rewriteAlignedSubByteIntTrunc into a dedicated files. Also adds + fixes some comments. This is merely for better organisation and so that it's easier to identify the patterns and edge cases being tested. | 1 年前 | |
[mlir][Transforms] GreedyPatternRewriteDriver: Do not CSE constants during iterations (#75897) The GreedyPatternRewriteDriver tries to iteratively fold ops and apply rewrite patterns to ops. It has special handling for constants: they are CSE'd and sometimes moved to parent regions to allow for additional CSE'ing. This happens in OperationFolder. To allow for efficient CSE'ing, OperationFolder maintains an internal lookup data structure to find the existing constant ops with the same value for each IsolatedFromAbove region: c++ /// A mapping between an insertion region and the constants that have been /// created within it. DenseMap<Region *, ConstantMap> foldScopes; Rewrite patterns are allowed to modify operations. In particular, they may move operations (including constants) from one region to another one. Such an IR rewrite can make the above lookup data structure inconsistent. We encountered such a bug in a downstream project. This bug materialized in the form of an op that uses the result of a constant op from a different IsolatedFromAbove region (that is not accessible). This commit changes the behavior of the GreedyPatternRewriteDriver such that OperationFolder is used to CSE constants at the beginning of each iteration (as the worklist is populated), but no longer during an iteration. OperationFolder is no longer used after populating the worklist, so we do not have to care about inconsistent state in the OperationFolder due to IR rewrites. The GreedyPatternRewriteDriver now performs the op folding by itself instead of calling OperationFolder::tryToFold. This change changes the order of constant ops in test cases, but not the region in which they appear. All broken test cases were fixed by turning CHECK into CHECK-DAG. Alternatives considered: The state of OperationFolder could be partially invalidated with every notifyOperationModified notification. That is more fragile than the solution in this commit because incorrect rewriter API usage can lead to missing notifications and hard-to-debug IsolatedFromAbove violations. (It did not fix the above mention bug in a downstream project, which could be due to incorrect rewriter API usage or due to another conceptual problem that I missed.) Moreover, ops are frequently getting modified during a greedy pattern rewrite, so we would likely keep invalidating large parts of the state of OperationFolder over and over. Migration guide: Turn CHECK into CHECK-DAG in test cases. Constant ops are no longer folded during a greedy pattern rewrite. If you rely on folding (and rematerialization) of constant ops during a greedy pattern rewrite, turn the folder into a pattern. | 2 年前 | |
[mlir][Vector] Add support for scalable vectors to ScanToArithOps (#123117) Note, scalable reductions dims are left as a TODO. | 8 个月前 | |
[mlir][Vector] Generate poison vectors in vector.shape_cast lowering (#125613) This is the first PR that introduces ub.poison vectors as part of a rewrite/conversion pattern in the Vector dialect. It replaces the arith.constant dense<0> vector initialization for vector.insert_slice ops with a poison vector. This PR depends on all the previous PRs that introduced support for poison in Vector operations such as vector.shuffle, vector.extract, vector.insert, including ODS, canonicalization and lowering support. This PR may improve end-to-end compilation time through LLVM, depending on the workloads. | 1 年前 | |
[mlir][vector] Improve shape_cast lowering (#140800) Before this PR, a rank-m -> rank-n vector.shape_cast with m,n>1 was lowered to extracts/inserts of single elements, so that a shape_cast on a vector with N elements would always require N extracts/inserts. While this is necessary in the worst case scenario it is sometimes possible to use fewer, larger extracts/inserts. Specifically, the largest common suffix on the shapes of the source and result can be extracted/inserted. For example: mlir %0 = vector.shape_cast %arg0 : vector<10x2x3xf32> to vector<2x5x2x3xf32> has common suffix of shape 2x3. Before this PR, this would be lowered to 60 extract/insert pairs with extracts of the form vector.extract %arg0 [a, b, c] : f32 from vector<10x2x3xf32>. With this PR it is 10 extract/insert pairs with extracts of the form vector.extract %arg0 [a] : vector<2x3xf32> from vector<10x2x3xf32>. | 1 年前 | |
[mlir][Vector] Add patterns to lower vector.shuffle (#157611) This PR adds patterns to lower vector.shuffle with inputs with different vector sizes more efficiently. The current LLVM lowering for these cases degenerates to a sequence of vector.extract and vector.insert operations. With this PR, the smaller input is promoted to larger vector size by introducing an extra vector.shuffle. | 10 个月前 | |
[mlir][vector] Sink vector.extract/splat into load/store ops (#134389) vector.load %arg0[%arg1] : memref<?xf32>, vector<4xf32> vector.extract %0[1] : f32 from vector<4xf32> Gets converted to: %c1 = arith.constant 1 : index %0 = arith.addi %arg1, %c1 overflow<nsw> : index %1 = memref.load %arg0[%0] : memref<?xf32> %0 = vector.splat %arg2 : vector<1xf32> vector.store %0, %arg0[%arg1] : memref<?xf32>, vector<1xf32> Gets converted to: memref.store %arg2, %arg0[%arg1] : memref<?xf32> | 1 年前 | |
[mlir][vector] Replace vector.splat with vector.broadcast in some tests (#152230) Splat is deprecated, and being prepared for removal in a future release. https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/5 The command I used, catches almost every splat op: perl -i -pe 's/vector\.splat\s+(\S+)\s*:\s*vector<((?:\[?\d+\]?x)*)\s*([^>]+)>/vector.broadcast $1 : $3 to vector<$2$3>/g' filename | 11 个月前 | |
[mlir][vector] Tidy-up testing for to/from_elements unrolling (#158309) 1. Remove TestUnrollVectorToElements and TestUnrollVectorFromElements test passes - these are not required. 2. Make "vector-from-elements-lowering.mlir" use TD Op for testing (for consistency "vector-to-elements-lowering.mlir" and to make sure that the TD Op, transform.apply_patterns.vector.unroll_from_elements, is tested). 3. Unify CHECK prefixes (CHECK-UNROLL -> CHECK). 4. Rename @to_elements_1d as @negative_unroll_to_elements_1d, for consistency with it's counterpart for vector.from_elements and to align with our testing guide (*). (*) https://mlir.llvm.org/getting_started/TestingGuide/#after-step-3-add-the-newly-identified-missing-case | 10 个月前 | |
[mlir][Vector] Add vector.shuffle tree transformation (#145740) This PR adds a new transformation that turns sequences of vector.to_elements and vector.from_elements into a binary tree of vector.shuffle operations. (Related RFC: https://discourse.llvm.org/t/rfc-adding-vector-to-elements-op-to-the-vector-dialect/86779). Example: %0:4 = vector.to_elements %a : vector<4xf32> %1:4 = vector.to_elements %b : vector<4xf32> %2:4 = vector.to_elements %c : vector<4xf32> %3 = vector.from_elements %0#0, %0#1, %0#2, %0#3, %1#0, %1#1, %1#2, %1#3, %2#0, %2#1, %2#2, %2#3 : vector<12xf32> ==> %0 = vector.shuffle %a, %b [0, 1, 2, 3, 4, 5, 6, 7] : vector<4xf32>, vector<4xf32> %1 = vector.shuffle %c, %c [0, 1, 2, 3, -1, -1, -1, -1] : vector<4xf32>, vector<4xf32> %2 = vector.shuffle %0, %1 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] : vector<8xf32>, vector<8xf32> The algorithm leverages the structured extraction/insertion information of vector.to_elements and vector.from_elements operations and builds a set of intervals to determine the vector length that should be used at each level of the tree to combine the level inputs in pairs. There are a few improvements that can be implemented in the future, such as shuffle mask compression to avoid unnecessarily large vector lengths with poison values, but I decided to keep things "simpler" and spend more time documenting the different steps of the algorithm so that people can follow along. | 1 年前 | |
[mlir][vector] Add a new TD op to wrap unit-dim collapsing patterns (#157507) Adds a new TD Op, * apply_patterns.vector.drop_inner_most_unit_dims_from_xfer_ops, which wraps the following Vector patterns: * DropInnerMostUnitDimsTransferRead * DropInnerMostUnitDimsTransferWrite This complements other existing unit-dimension–related patterns. To reduce duplication, the TestVectorTransferCollapseInnerMostContiguousDims pass has been removed. That pass was only used for testing, and its functionality is now covered by the newly added TD Op. | 10 个月前 | |
[MLIR][Vector] Update Transfer{Read|Write}DropUnitDimsPattern patterns (#112394) Updates TransferWriteDropUnitDimsPattern and TransferReadDropUnitDimsPattern to inherit from MaskableOpRewritePattern so that masked versions of xfer_read/xfer_write Ops are also supported: mlir %v = vector.mask %mask { vector.transfer_read %arg[%c0, %c0, %c0, %c0], %cst : memref<1x1x3x2xi8, strided<[6, 6, 2, 1], offset: ?>>, vector<3x2xi8> } : vector<3x2xi1> -> vector<3x2xi8> | 1 年前 | |
[mlir][vector] Avoid setting padding by default to 0 in vector.transfer_read prefer ub.poison (#146088) Context: vector.transfer_read always requires a padding value. Most of its builders take no padding value and assume the safe value of 0. However, this should be a conscious choice by the API user, as it makes it easy to introduce bugs. For example, I found several occasions while making this patch that the padding value was not getting propagated (vector.transfer_read was transformed into another vector.transfer_read). These bugs, were always caused because of constructors that don't require specifying padding. Additionally, using ub.poison as a possible default value is better, as it indicates the user "doesn't care" about the actual padding value, forcing users to specify the actual padding semantics they want. With that in mind, this patch changes the builders in vector.transfer_read to always having a std::optional<Value> padding argument. This argument is never optional, but for convenience users can pass std::nullopt, padding the transfer read with ub.poison. --------- Signed-off-by: Fabian Mora <fabian.mora-cordero@amd.com> | 1 年前 | |
[mlir] split transform interfaces into a separate library (#85221) Transform interfaces are implemented, direction or via extensions, in libraries belonging to multiple other dialects. Those dialects don't need to depend on the non-interface part of the transform dialect, which includes the growing number of ops and transitive dependency footprint. Split out the interfaces into a separate library. This in turn requires flipping the dependency from the interface on the dialect that has crept in because both co-existed in one library. The interface shouldn't depend on the transform dialect either. As a consequence of splitting, the capability of the interpreter to automatically walk the payload IR to identify payload ops of a certain kind based on the type used for the entry point symbol argument is disabled. This is a good move by itself as it simplifies the interpreter logic. This functionality can be trivially replaced by a transform.structured.match operation. | 2 年前 | |
[mlir] split transform interfaces into a separate library (#85221) Transform interfaces are implemented, direction or via extensions, in libraries belonging to multiple other dialects. Those dialects don't need to depend on the non-interface part of the transform dialect, which includes the growing number of ops and transitive dependency footprint. Split out the interfaces into a separate library. This in turn requires flipping the dependency from the interface on the dialect that has crept in because both co-existed in one library. The interface shouldn't depend on the transform dialect either. As a consequence of splitting, the capability of the interpreter to automatically walk the payload IR to identify payload ops of a certain kind based on the type used for the entry point symbol argument is disabled. This is a good move by itself as it simplifies the interpreter logic. This functionality can be trivially replaced by a transform.structured.match operation. | 2 年前 | |
[mlir][vector] Update tests for xfer permutation lowering (4/N) (#127624) * Document the remaining test cases, add a note that these are exercising TransferOpReduceRank (addresses an existing TODO). * Add missing cases (for fixed-width and scalable vectors). * Remove scalable vectors from the negative test (the masked case) - this test will also fail with fixed-width vectors. For consistency, lets make all negative test use fixed-width vectors. | 1 年前 | |
[mlir][vector] Replace vector.splat with vector.broadcast in some tests (#152230) Splat is deprecated, and being prepared for removal in a future release. https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/5 The command I used, catches almost every splat op: perl -i -pe 's/vector\.splat\s+(\S+)\s*:\s*vector<((?:\[?\d+\]?x)*)\s*([^>]+)>/vector.broadcast $1 : $3 to vector<$2$3>/g' filename | 11 个月前 | |
[mlir][vector] Add a check to ensure input vector rank equals target shape rank (#149239) The crash is caused because, during IR transformation, the vector-unrolling pass (using ExtractStridedSliceOp) attempts to slice an input vector of higher rank using a target vector of lower rank, which is not supported. Fixes #148368. | 1 年前 | |
[mlir][vector] Add all view-like ops to transfer flow opt (#110521) vector.transfer_* folding and forwarding currently does not take into account reshaping view-like memref ops (expand and collapse shape), leading to potentially invalid store folding or value forwarding. This patch adds tracking for those (and other) view-like ops. It is still possible to design operations that alias memrefs without being a view (e.g. memref in the iter_args of an scf.for), so these patterns may still need revisiting in the future. | 1 年前 | |
[MLIR] Fix BubbleDownVectorBitCastForExtract crash on non-static index (#116518) Previously the patch was not expecting to handle non-static index, when the index is a non constant value it will crash. This patch is to make sure it return gracefully instead of crashing. | 1 年前 | |
[mlir][vector] Remove MatrixMultiplyOp and FlatTransposeOp from Vector dialect (#144307) This patch deletes vector.matrix_multiply and vector.flat_transpose, which are thin wrappers around the corresponding LLVM intrinsics: - llvm.intr.matrix.multiply - llvm.intr.matrix.transpose These Vector dialect ops did not provide additional semantics or abstraction beyond the LLVM intrinsics. Their removal simplifies the lowering pipeline without losing any functionality. The lowering chains: - vector.contract → vector.matrix_multiply → llvm.intr.matrix.multiply - vector.transpose → vector.flat_transpose → llvm.intr.matrix.transpose are now replaced with: - vector.contract → llvm.intr.matrix.multiply - vector.transpose → llvm.intr.matrix.transpose This was accomplished by directly replacing: - vector::MatrixMultiplyOp with LLVM::MatrixMultiplyOp - vector::FlatTransposeOp with LLVM::MatrixTransposeOp Note: To avoid a build-time dependency from Vector to LLVM, relevant transformations are moved from "Vector/Transforms" to Conversion/VectorToLLVM. | 1 年前 | |
[mlir][vector] Refine Vector to LLVM lowering options (#159553) This is a follow-up to https://github.com/llvm/llvm-project/pull/144307, where we removed vector.matrix_multiply and vector.flat_transpose from the Vector dialect. This PR: * Updates comments that were missed in the previous change. * Renames relevant -convert-vector-to-llvm= options: - vector-contract-lowering=matmul → vector-contract-lowering=llvmintr - vector-transpose-lowering=flat_transpose → vector-transpose-lowering=llvmintr These new names better reflect the actual transformation target - LLVM intrinsics - rather than the now-removed abstract operations. | 10 个月前 | |
[MLIR][Vector] Add unroll pattern for vector.shape_cast (#167738) This PR adds pattern for unrolling shape_cast given a targetShape. This PR is a follow up of #164010 which was very general and was using inserts and extracts on each element (which is also LowerVectorShapeCast.cpp is doing). After doing some more research on use cases, we (me and @Jianhui-Li ) realized that the previous version in #164010 is unnecessarily generic and doesn't fit our performance needs. Our use case requires that targetShape is contiguous in both source and result vector. This pattern only applies when contiguous slices can be extracted from the source vector and inserted into the result vector such that each slice remains in vector form with targetShape (and not decompose to scalars). In these cases, the unrolling proceeds as: vector.extract_strided_slice -> vector.shape_cast (on the slice unrolled) -> vector.insert_strided_slice | 8 个月前 | |
[mlir][vector] Add support for yielding loop bounds in scf.for distribution. (#163443) In some cases, loop bounds (lower, upper and step) of scf.for can come locally from the parent warp op the scf.for. Current logic will not yield the loop bounds in the new warp op generated during lowering causing sinked scf.for to have non dominating use. In this PR, we have added logic to yield loop bounds by default (treat them as other operands of scf.for) which fixes this bug. | 9 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 1 年前 | ||
| 9 个月前 | ||
| 10 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 9 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 10 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 8 个月前 | ||
| 9 个月前 |