This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Fix a bug in concatenate operator rewriting.
ClosedPublic

Authored by bixia on Nov 21 2022, 7:12 AM.

Details

Summary

When calculating the dynamic dimensions for the concatenate result, we
shouldn't accumulate the sizes for the non-concatenating dimensions.

Diff Detail

Event Timeline

bixia created this revision.Nov 21 2022, 7:12 AM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Nov 21 2022, 7:12 AM
Peiming added inline comments.Nov 21 2022, 9:00 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
472–477

When was it deleted?

Peiming added inline comments.Nov 21 2022, 9:12 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
472–477

NVM, but are you sure there is no compiler warning?

e.g., conDim (size_t) == d.index() (int)?

bixia added inline comments.Nov 21 2022, 12:22 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
472–477

It was a bug when this code was added.

472–477

d.index() is size_t see here

Peiming accepted this revision.Nov 21 2022, 1:21 PM
Peiming added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
472–477

You are right!

This revision is now accepted and ready to land.Nov 21 2022, 1:21 PM
aartbik accepted this revision.Nov 21 2022, 1:58 PM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
472–477

Can you please add a comment to this test (so we will never delete it again)

wrengr added inline comments.Nov 21 2022, 2:02 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
472–477

If the issue is about signedness warnings, then I could move mlir/ExecutionEngine/SparseTensor/ArithmeticUtils.h into MLIRSparseTensorEnums so that safelyEQ can be used here

bixia updated this revision to Diff 477018.Nov 21 2022, 3:24 PM
bixia marked an inline comment as done.

Add a comment.

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
472–477

Thanks! But the two types are the same here.

This revision was automatically updated to reflect the committed changes.