This is an archive of the discontinued LLVM Phabricator instance.

[mlir][taco] Uses sparse_tensor.new to read tensor input data from files.
ClosedPublic

Authored by bixia on Feb 2 2022, 8:40 AM.

Details

Summary

Replace the Python implementation for reading tensor input data from files with
create_sparse_tensor that uses sparse_tensor.new.

The MLIR TNS format has two extra meta data lines. Add the extra meta data to a
test data file.

Implement TACO tensor methods evaluate and unpack.

Add unit tests.

Diff Detail

Event Timeline

bixia created this revision.Feb 2 2022, 8:40 AM
bixia requested review of this revision.Feb 2 2022, 8:40 AM
aartbik added inline comments.Feb 2 2022, 1:31 PM
mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco.py
536

You will need to put the packed/unpacked description in the doc string (not the # comments), since it is part of the enum API. Also, perhaps you can make a small comparison with PyTACO's native pack/unpacked, which is actually very similar in nature?

539

typo? "to a pack MLIR" ?

mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco_io.py
33

very nice to see all this code dup go!

bixia updated this revision to Diff 405443.Feb 2 2022, 2:11 PM

Add Enum values description to doc string and fix the description.

mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco.py
536

Right, move the description to doc string. I assume the last part of your comment is suggestion for later when we do performance comparison with PyTACO.

539

Should be "to a packed MLIR".

aartbik added inline comments.Feb 2 2022, 3:11 PM
mlir/test/Integration/Dialect/SparseTensor/taco/data/nell-2.tns
2

perhaps put a line

; extended FROSTT format

here?

mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_pytaco.py
537

spell out coods as coordinates

aartbik accepted this revision.Feb 2 2022, 3:11 PM

Please address last nits, but LGTMing now so you can proceed once done.

This revision is now accepted and ready to land.Feb 2 2022, 3:11 PM
bixia updated this revision to Diff 405470.Feb 2 2022, 3:29 PM

Fix a problem in the tensor write method.

bixia updated this revision to Diff 405656.Feb 3 2022, 8:23 AM
bixia marked 4 inline comments as done.

Spell out coords as coordinates and add comment to the test data in extended FROSTT format.

This revision was landed with ongoing or failed builds.Feb 3 2022, 8:26 AM
This revision was automatically updated to reflect the committed changes.