This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] add a "release" operation to sparse tensor dialect
ClosedPublic

Authored by aartbik on Oct 4 2021, 3:41 PM.

Details

Summary

We have several ways to materialize sparse tensors (new and convert) but no explicit operation to release the underlying sparse storage scheme at runtime (other than making an explicit delSparseTensor() library call). To simplify memory management, a sparse_tensor.release operation has been introduced that lowers to the runtime library call while keeping tensors, opague pointers, and memrefs transparent in the initial IR.

*Note* There is obviously some tension between the concept of immutable tensors and memory management methods. This tension is addressed by simply stating that after the "release" call, no further memref related operations are allowed on the tensor value. We expect the design to evolve over time, however, and arrive at a more satisfactory view of tensors and buffers eventually.

Bug:
http://llvm.org/pr52046

Diff Detail

Event Timeline

aartbik created this revision.Oct 4 2021, 3:41 PM
aartbik requested review of this revision.Oct 4 2021, 3:41 PM
aartbik updated this revision to Diff 377056.Oct 4 2021, 4:56 PM

add noasan to one test

bixia accepted this revision.Oct 5 2021, 9:32 AM
This revision is now accepted and ready to land.Oct 5 2021, 9:32 AM