Adding more test cases for sparse_tensor.BinaryOp, including different cases when overlap/left/right region is implemented/empty/identity
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Nice extra test!
To global nits:
(1) shall we either rename the file, or move the new code in its own file, since it is no longer just triangular binary
(2) always run asan on new integration tests to detect leaks (we are working on a more "comprehensive" bufferization with auto allocation story for sparse, literally ;-), but until then, we will need to insert proper alloc/deallocs ourselves
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_triangular_bin.mlir | ||
---|---|---|
0 | you will need to release all the other sparse tensors too, but perhaps you can do that in print_result now, so we never skip one | |
1 | It is actually funny this will achieve exactly the same as just addf as body ;-) | |
4 | Here and below, any comment on its own line should look like a sentence, as in // Define out-of-block constant bounds. You can skip that rule for same line comment,as in a = 1; // anything goes | |
117 | Space after //, look like sentence | |
135 | same |
Solid work! I like it. A few last nits, but we are very close to submitting!
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_binary.mlir | ||
---|---|---|
39 | either: | |
166–346 | either remove the comment on this dump, or otherwise add a comment on all other dump functions too | |
265 | It is nice that you threw in some extra testing of such cases. Perhaps bonus points for a follow up CL where you accept constants in the generic block as well (like we do for linalg index). There is a very subtle problem there, but that makes it a nice follow up "starter" project. | |
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_triangular_bin.mlir | ||
1 | I won't ask this now, but for the future, typically when you move code from one place to another, and then change and/or add code, we break this up in two revisions, the NFC (no functional change) that moves the code, and then the one that changes, adds. That way it is a bit easier to review the deltas. |
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_binary.mlir | ||
---|---|---|
265 | Will take a look! |
either:
for sparse tensor.binary operations (plural ops)
or:
for a sparse_tensor.binary operation (indefinite article)