The cast_slices vector operation type casts slices from a 'source' vector to
slices of a 'result' vector, where there is a one-to-one mapping between source
vector and result vector slices (specified by the 'source_sizes' and 'result_sizes' arguments).
Details
- Reviewers
nicolasvasilache aartbik
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/VectorOps/VectorOps.td | ||
---|---|---|
951 | I would like to see a bit more documentation of this operation in terms of ranks and sizes of the arrays, like we do for the other sliced operations (so, like "n-D" with restrictions on n array sizes for the input arguments and output). |
Please fix the description, BEGIN_PUBLIC/END_PUBLIC don't make sense. The summary should also have a [mlir] tag.
Unit tests: pass. 61909 tests passed, 0 failed and 782 were skipped.
clang-tidy: unknown.
clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 61909 tests passed, 0 failed and 782 were skipped.
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
mlir/include/mlir/Dialect/VectorOps/VectorOps.td | ||
---|---|---|
964 | I find the semantics harder to grasp than it could, I think. %1 = vector.cast_slices %0, [1, 1, 3, 12], [3, 12] : vector<4x1x3x12xf32> to vector<12x12xf32> I can think of different ways of specifying this that I would find more natural but first I'd like to understand why you need these attributes in this form and where ambiguity appears that makes it impossible to derive them automatically. In particular I view this as conflating 2 unrelated things: (1) a reshape that does not move and (2) a multiplicity. It would be great if we could uniformize things (if is makes sense). Marking as "request changes" until the discussion is resolved. |
mlir/include/mlir/Dialect/VectorOps/VectorOps.td | ||
---|---|---|
964 | This operation specifies a cast from one vector type to another. I intentionally did not use affine maps (or even the less expressive permutation of dimensions to reshape), so that this operation was even more restricted to its purpose. Its purpose is express a trivial cast between slices of the source/result vectors. Because these aggegate vectors will eventually need to be decomposed to hardware vectors, whats important is that the slices of these vectors have trivial casts that can be canonicalized away. As an analogy. Think of a reshape operation which starts with the linear address, and de-linearizes this into the source (resp result) vector shape, by using the source (resp result) strides. Instead of source/result permutation of dims, the cast_slices operation specifies the source/result decomposition of slices and further restricts the operation in the following simple ways:
|
We sync'ed offline and the intuition is that there is a more idiomatic way involving just a "natural" vector.cast that works on both vector and tuple<vector<>,...>
I would like to see a bit more documentation of this operation in terms of ranks and sizes of the arrays, like we do for the other sliced operations (so, like "n-D" with restrictions on n array sizes for the input arguments and output).