This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse]Add more integration tests for sparse_tensor.unary
ClosedPublic

Authored by Peiming on Jun 23 2022, 1:19 PM.

Details

Summary

Previously, the sparse_tensor.unary integration test does not contain cases with the use of linalg.index (previoulsy unsupported), this commit adds test cases that use linalg.index operators.

Diff Detail

Event Timeline

Peiming created this revision.Jun 23 2022, 1:19 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Jun 23 2022, 1:19 PM
Peiming edited the summary of this revision. (Show Details)Jun 23 2022, 1:22 PM
Peiming added reviewers: bixia, wrengr.
Peiming added a reviewer: yinying-lisa-li.
Peiming retitled this revision from Add more integration tests for sparse_tensor.unary to [mlir][sparse]Add more integration tests for sparse_tensor.unary.Jun 23 2022, 1:24 PM

Nice direction. One last nit.

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_unary.mlir
126–127

This is a bit misleading kernel. You say that we only "keep" a certain part, but what you really do is output zeros for that part. In the sparse format, you can see that there are a lot of explicitly stored zeros.

To make this a more realistic example, perhaps say that we keep values in the corner, and set all others to some value (nonzero), e.g. 99 or so. Just to avoid the misleading "only keep"

Peiming updated this revision to Diff 439897.Jun 24 2022, 2:42 PM

A less misleading kernel

aartbik accepted this revision.Jun 24 2022, 3:27 PM

Nice work, Peiming! Ship it!

This revision is now accepted and ready to land.Jun 24 2022, 3:27 PM
This revision was automatically updated to reflect the committed changes.