This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] integrate sparse annotation into generic linalg op
ClosedPublic

Authored by aartbik on Nov 10 2020, 6:10 PM.

Details

Summary

This CL integrates the new sparse annotations (hereto merely added as fully
transparent attributes) more tightly to the generic linalg op in order to add
verification of the annotations' consistency as well as to make make other
passes more aware of their presence (in the long run, rewriting rules must
preserve the integrity of the annotations).

Diff Detail

Event Timeline

aartbik created this revision.Nov 10 2020, 6:10 PM
aartbik requested review of this revision.Nov 10 2020, 6:10 PM
nicolasvasilache accepted this revision.Nov 11 2020, 1:46 PM
nicolasvasilache added inline comments.
mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
496

Maybe add a comment that this is an ArrayAttr of StrArrayAttr?

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
441

Please factor out the magic string into mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h here and below

This revision is now accepted and ready to land.Nov 11 2020, 1:46 PM
jpienaar added inline comments.
mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
554

Are these the only two expected here? E.g., could we switch to enum rather than string attribute below?

aartbik marked 2 inline comments as done.Nov 11 2020, 3:43 PM
aartbik added inline comments.
mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
554

This is a bit forward looking in the sense that keeping this a string will simplify prototyping other storage formats that go beyond a simple enum (perhaps a property + parameters). So unless you foresee issues, I would prefer not to commit to a enum as of yet (other than what Nicolas proposed).

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
441

That makes sense, yes!

aartbik updated this revision to Diff 304681.Nov 11 2020, 4:31 PM
aartbik marked an inline comment as done.

addresses comments, no more magic strings

aartbik updated this revision to Diff 304683.Nov 11 2020, 4:39 PM

minor cleanup