This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Add expand_symmetry attribute to the new operator.
ClosedPublic

Authored by bixia on Nov 17 2022, 11:13 AM.

Details

Summary

The attribute tells the operator to handle symmetric structures for 2D tensors.
By default, the operator assumes the input tensor is not symmetric.

Diff Detail

Event Timeline

bixia created this revision.Nov 17 2022, 11:13 AM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Nov 17 2022, 11:13 AM
Peiming added inline comments.Nov 17 2022, 11:39 AM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
42

we should use *operation according to Alex

wrengr added inline comments.Nov 17 2022, 12:45 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
44–45

The default should be the other way around: assume non-symmetric unless $symmetric is passed.

bixia abandoned this revision.Nov 17 2022, 4:18 PM
bixia reclaimed this revision.Nov 21 2022, 12:30 PM

As discussed offline, until that time that we support symmetry explicitly in the sparse tensor type somehow, let's make an attribute "expand_symmetric" which will do the a_ij/aji insertion when a symmetric matrix is read from e.g. MM. In all other case, we just read the data provided, marked symmetric or not.

bixia updated this revision to Diff 477311.Nov 22 2022, 2:54 PM

Rename the attribute and reverse the default value.

bixia updated this revision to Diff 477313.Nov 22 2022, 2:56 PM

Change operator to operation.

bixia retitled this revision from [mlir][sparse] Add non_symmetric attribute to the new operator. to [mlir][sparse] Add expand_symmetry attribute to the new operator..Nov 22 2022, 2:57 PM
bixia edited the summary of this revision. (Show Details)
bixia marked 2 inline comments as done.
aartbik accepted this revision.Nov 22 2022, 3:55 PM
aartbik added inline comments.
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
43

Rephrase: to make symmetry in external formats explicit in the storage. That is, ....
Also add a note on that this claims more storage than a pure symmetric storage, and thus may cause a bad performance hit.
True symmetric storage is planned for the future.

This revision is now accepted and ready to land.Nov 22 2022, 3:55 PM
bixia updated this revision to Diff 477349.Nov 22 2022, 5:05 PM
bixia marked an inline comment as done.

Update document to address review comment.