[mlir][sparse] generalize sparse storage format to many more types
authorAart Bik <ajcbik@google.com>
Thu, 18 Feb 2021 00:47:33 +0000 (16:47 -0800)
committerAart Bik <ajcbik@google.com>
Thu, 18 Feb 2021 02:20:23 +0000 (18:20 -0800)
commitff6c84b803c6a7f5e79dcdbad25332dc7936303c
tree0a4d168deea53662241c345be884e4ec6a81042c
parent766ee1096f0b32616c3e96b7acddc293e56c16ef
[mlir][sparse] generalize sparse storage format to many more types

Rationale:
Narrower types for overhead storage yield a smaller memory footprint for
sparse tensors and thus needs to be supported. Also, more value types
need to be supported to deal with all kinds of kernels. Since the
"one-size-fits-all" sparse storage scheme implementation is used
instead of actual codegen, the library needs to be able to support
all combinations of desired types. With some crafty templating and
overloading, the actual code for this is kept reasonably sized though.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D96819
mlir/integration_test/Sparse/CPU/sparse_sampled_matmul.mlir [new file with mode: 0644]
mlir/integration_test/Sparse/CPU/sparse_sum.mlir
mlir/lib/Dialect/Linalg/Transforms/SparseLowering.cpp
mlir/lib/ExecutionEngine/SparseUtils.cpp
mlir/test/Dialect/Linalg/sparse_lower.mlir
mlir/test/Dialect/Linalg/sparse_lower_calls.mlir