In quantized comutation, there are casting ops around computation ops.
Reorder the ops to make reduce-to-contract actually work.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1033–1034 | you can just use op.getType()? | |
1061–1063 | same comment, you can use op.getType()? | |
2669–2684 | can we use CastOpInterface instead of listing all the ops explicitly. It is probably fine to apply this to all unary ops as well otherwise. | |
mlir/test/Dialect/Vector/vector-reduce-to-contract.mlir | ||
97 | nit: can you add the return type |
Address comments
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1033–1034 | ah, good point! |
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1012 | Please add a line for why this would be the canonical form (along the lines of your commit summary) -- this isn't obvious at all. | |
1038 | Likewise. | |
1049 | Use named accessor instead of getOperand(0)? | |
1049 | I don't see where the template type here is. |
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1019–1023 | nit: having the contract here may be a bit confusing as the pattern doesn't need the contract to kick in. Overall re-ordering the broadcast allows to do less work so it is usually better. |
Update comments
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1049 | I don't find a named accessor. Seems that the CastOpInterface does not have named accessor? |
Please add a line for why this would be the canonical form (along the lines of your commit summary) -- this isn't obvious at all.