Next step towards supporting sparse tensors outputs.
Also some minor refactoring of enum constants as well
as replacing tensor arguments with proper buffer arguments
(latter is required for more general sizes arguments for
the sparse_tensor.init operation, as well as more general
spares_tensor.convert operations later)
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Overall I like the changes in SparseTensorConversion.cpp, but I'm a little worried about switching from APInt to attributes because of the comment about blowing up compiler memory usage in mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp on lines 1380–1382. Do we have anything set up to track performance metrics and prevent regressions?
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp | ||
---|---|---|
32 | Typo: ".." -> "." | |
148 | This should be called genAlloca (or similar) since it generates an alloca rather than a malloc | |
179–182 | Not sure if that'll allow the last statement to fit on one line, but it's a cleanup I've been meaning to make for a while. Feel free to choose a better name for dlt of course. |
mlir/lib/ExecutionEngine/SparseUtils.cpp | ||
---|---|---|
184 | Shouldn't that just be "per-dimension"? | |
190–191 | Throughout this file, I feel like the old d name makes more sense, since we're iterating through dimensions d1,d2,...dr up to the rank r. | |
194 | Given that we keep calling this for all the loops, it should be floated out to the top of the function, to reduce boilerplate | |
267 | Please rename this to rank, to avoid confusion with the sizes parameter and for consistency with the rest of the file | |
540 | +1 :) |
conversion.mlir looks at least conceptually good to me, though I'm not familiar enough with FileCheck to sign off on it.
The other three files LGTM once the comments are addressed
Typo: ".." -> "."