This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] first end-to-end matmul with codegen
ClosedPublic

Authored by aartbik on Nov 9 2022, 1:08 PM.

Details

Summary

(1) also fixes memory leak in sparse2dense rewriting
(2) still needs fix in dense2sparse by skipping zeros

Diff Detail

Event Timeline

aartbik created this revision.Nov 9 2022, 1:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 9 2022, 1:08 PM
aartbik requested review of this revision.Nov 9 2022, 1:08 PM
aartbik updated this revision to Diff 474336.Nov 9 2022, 1:17 PM

rebased with main

wrengr accepted this revision.Nov 9 2022, 1:19 PM
wrengr added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
952

Should this first assert that the buffer has an appropriate type to be the argument to DeallocOp? I'm thinking mainly about ensuring nice error messages for debugging (since I'm guessing the error would only be caught rather further down down the compilation pipeline).

mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.h
149

The type of buffer and the actual implementation are a lot more general than this function name would indicate. Perhaps rename to deallocMemref or deallocBuffer?

This revision is now accepted and ready to land.Nov 9 2022, 1:19 PM
aartbik marked an inline comment as done.Nov 9 2022, 1:38 PM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
952

agreed, also pushed to the next revision (so this one is just moving it out)

mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.h
149

agreed, but since I just migrated existing code out, and we have allocDenseTensor, let's do that as a generic follow-up on all these methods

This revision was automatically updated to reflect the committed changes.
aartbik marked an inline comment as done.