This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Generate AOS subviews on-demand.
ClosedPublic

Authored by bixia on Jan 9 2023, 2:18 PM.

Details

Summary

Previously, we generate AOS subviews for indices buffers when constructing an
immutable sparse tensor descriptor. We now only generate such subviews when
getIdxMemRefOrView is requested.

Diff Detail

Event Timeline

bixia created this revision.Jan 9 2023, 2:18 PM
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Jan 9 2023, 2:18 PM
Peiming added inline comments.Jan 9 2023, 11:22 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorStorageLayout.cpp
122

I am not sure whether a mutDesc is really needed here.

Peiming added inline comments.Jan 9 2023, 11:26 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorStorageLayout.h
313–314

You can move the getter to the base class (shared by mut/immut)

Peiming added inline comments.Jan 10 2023, 9:21 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorStorageLayout.cpp
123

Seems that you only need the idxMemSize from mutDesc, but these getters can be safely moved to the base class (they are not updating the descriptor anyway, see my previous comments), then you can get rid of this mutDesc here.

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorStorageLayout.h
339–340

Did you rebase? if not, these template need to be removed as well.

bixia updated this revision to Diff 487872.Jan 10 2023, 10:16 AM
bixia marked 4 inline comments as done.

Move some getters to the Impl class, remove the need for mutDesc for a case.

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorStorageLayout.cpp
123

Removed mutDesc here.

Peiming accepted this revision.Jan 10 2023, 11:31 AM
This revision is now accepted and ready to land.Jan 10 2023, 11:31 AM
Peiming added inline comments.Jan 10 2023, 11:33 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorStorageLayout.h
393

These two parameter seems unecessary now

bixia updated this revision to Diff 487951.Jan 10 2023, 12:35 PM
bixia marked an inline comment as done.

Removed unused parameters.

This revision was automatically updated to reflect the committed changes.