This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] improved tensor type lowering
ClosedPublic

Authored by aartbik on Aug 31 2022, 6:35 PM.

Details

Summary

Also includes a first codegen example (although full support need tuple access)

Diff Detail

Event Timeline

aartbik created this revision.Aug 31 2022, 6:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2022, 6:35 PM
aartbik requested review of this revision.Aug 31 2022, 6:35 PM
aartbik retitled this revision from [mlir][sparse] improved tensor type lowering Also includes a first codegen example (although full support need tuple access) to [mlir][sparse] improved tensor type lowering.Aug 31 2022, 6:36 PM
aartbik edited the summary of this revision. (Show Details)
aartbik updated this revision to Diff 457152.Aug 31 2022, 6:57 PM

minor edit

Peiming accepted this revision.Sep 1 2022, 9:05 AM
This revision is now accepted and ready to land.Sep 1 2022, 9:05 AM
bixia added inline comments.Sep 1 2022, 9:06 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
66

I don't quite understand the implication of this optimization yet: Either casting a sparse tensor created from a dynamic shape to its "true static type" is not a noop, or we will have problems in reading the sparse tensor using its "true static type"?

66–67

Need to indent from the previous line.

aartbik marked 2 inline comments as done.Sep 1 2022, 9:11 AM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
66

For a static type, codegen never needs to query this, since all information is implicit in the context (I showed the dimop lowering as the first example of that).

aartbik updated this revision to Diff 457299.Sep 1 2022, 9:13 AM
aartbik marked an inline comment as done.

fixed indentation

aartbik added inline comments.Sep 1 2022, 9:16 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
66

The cast operation back and forth will indeed need to add/remove the sizes back as metadata.

This revision was landed with ongoing or failed builds.Sep 1 2022, 9:24 AM
This revision was automatically updated to reflect the committed changes.