This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Remove the expansion of symmetric MTX in the sparse tensor storage.
ClosedPublic

Authored by bixia on Feb 14 2023, 4:39 PM.

Details

Summary

We will support symmetric MTX without expanding the data in the sparse tensor
storage.

Diff Detail

Event Timeline

bixia created this revision.Feb 14 2023, 4:39 PM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Feb 14 2023, 4:39 PM
aartbik added inline comments.Feb 14 2023, 5:06 PM
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
42–46

please add doc that reading in a symmetric matrix will result in lower/upper triangular and that proper symmetry support is TBD

mlir/include/mlir/ExecutionEngine/SparseTensor/File.h
169

I think it is okay to record the symmetric property, we just don't use it to do anything special (but in the future we still want to know this information)

303

keep this

mlir/include/mlir/ExecutionEngine/SparseTensorRuntime.h
251 ↗(On Diff #497480)

keep this

mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp
880 ↗(On Diff #497480)

keep

mlir/test/Integration/data/test_complex.mtx
1 ↗(On Diff #497480)

we can still keep the symmetric flag, just to make sure we can read it

aartbik added inline comments.Feb 14 2023, 5:11 PM
mlir/lib/ExecutionEngine/SparseTensor/File.cpp
160 ↗(On Diff #497480)

Oh, I would just record the property but then read the data is as if it were a regular matrix

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_file_io.mlir
43 ↗(On Diff #497480)

keep

113 ↗(On Diff #497480)

keep

bixia updated this revision to Diff 497765.Feb 15 2023, 11:49 AM
bixia marked 9 inline comments as done.

Address review comment: keep symmetric property, keep two tests with symmetric input with TODO, add to doc about symmetric handling is TBD.

aartbik accepted this revision.Feb 15 2023, 1:14 PM
aartbik added inline comments.
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
42–46

did you

43–45

How about:

Reading in a symmetric matrix will result in just the lower/upper triangular part of
the matrix (so that only relevant information is stored). Proper symmetry support
for operating on symmetric matrices is still TBD.

52–53

does this fit on one line now?

This revision is now accepted and ready to land.Feb 15 2023, 1:14 PM
bixia updated this revision to Diff 498056.Feb 16 2023, 9:54 AM
bixia marked 2 inline comments as done.

Fix doc for symmetry. Fix assembly format.