This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] retry sparse-only for cyclic iteration graphs
ClosedPublic

Authored by aartbik on Jan 14 2021, 12:21 PM.

Details

Summary

This is a very minor improvement during iteration graph construction.
If the first attempt considering the dimension order of all tensors fails,
a second attempt is made using the constraints of sparse tensors only.
Dense tensors prefer dimension order (locality) but provide random access
if needed, enabling the compilation of more sparse kernels.

Diff Detail

Event Timeline

aartbik created this revision.Jan 14 2021, 12:21 PM
aartbik requested review of this revision.Jan 14 2021, 12:21 PM
penpornk accepted this revision.Jan 14 2021, 9:54 PM

Smart! :)
The generated code looks correct to me.

mlir/test/Dialect/Linalg/sparse_nd.mlir
10

You scared me for a second here with all these indices. XD
This is a fun test case.

This revision is now accepted and ready to land.Jan 14 2021, 9:54 PM
aartbik marked an inline comment as done.Jan 14 2021, 10:39 PM
aartbik added inline comments.
mlir/test/Dialect/Linalg/sparse_nd.mlir
10

Yeah, I wanted to stress test higher ranks too with this ;-)

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