Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
382 | Do we really need to distinguish enableRT here? Because I see no problem of rewriting reshape/concatenate even when RT is enabled. Since the from/toCOO <==> foreach operator, we can relies on RT only for insertion? But I am okay with how it works right now, maybe it should not be addressed now... |
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
425–426 | Maybe you should use the builder from callback |
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
382 | If enableRT means keep using the RT libs as we are right now, we should rerwrite sparse2sparse reshape here. |
LGTM.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
385–386 | Isn't it already guaranteed by verifier? Anyway, no harm to do extra check |
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
301–366 | not to nitpick, but we always use singular here, since each rule applies to one operator | |
382 | But isn't it easier to have two ruless then, and add them below based on enableRT or not Having the bool leak into the constructors with different codepaths is harder to read than just applying different rule sets? | |
517 | why is this so far away from the other reshape rewriter def? | |
mlir/test/Dialect/SparseTensor/sparse_reshape.mlir | ||
3 | shall we make a new test flag --test_sparse_rewriting that only calls populateSparseTensorRewriting() and applies those rules, so we can test this rewriting without having the full sparsification? |
mlir/test/Dialect/SparseTensor/sparse_reshape.mlir | ||
---|---|---|
3 | This lifts rewriting into its own pass https://reviews.llvm.org/D135319 so we can test the rewrite in isolation from sparsification |
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
301–366 | I was thinking this is a template and is used to two reshape operators. But use singular instead. | |
382 | Split into two rules anyway. It is a little different in the sense that we now add two rewrite rules for one operator. | |
385–386 | Remove the check |
mlir/test/Dialect/SparseTensor/sparse_reshape.mlir | ||
---|---|---|
3 | Thanks. Will update the test when this is landed. |
Yeah, this looks really good. I will wait for the CHECK test simplification, but then good to go!
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp | ||
---|---|---|
301–366 | Ah, yeah, that is a good point too actually ;-) | |
382 | I love how it looks now. Having two rules for same op is fine, since the logic is mutually exclusive, right?! |
not to nitpick, but we always use singular here, since each rule applies to one operator