[all-commits] [llvm/llvm-project] 35517a: [mlir][sparse] add init sparse tensor operation

Aart Bik via All-commits all-commits at lists.llvm.org
Wed Oct 13 09:48:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35517a251dcef1c555d341a4955cbee2f2fae80a
      https://github.com/llvm/llvm-project/commit/35517a251dcef1c555d341a4955cbee2f2fae80a
  Author: Aart Bik <ajcbik at google.com>
  Date:   2021-10-13 (Wed, 13 Oct 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td
    M mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
    M mlir/test/Dialect/SparseTensor/invalid.mlir
    M mlir/test/Dialect/SparseTensor/roundtrip.mlir

  Log Message:
  -----------
  [mlir][sparse] add init sparse tensor operation

This is the first step towards supporting general sparse tensors as output
of operations. The init sparse tensor is used to materialize an empty sparse
tensor of given shape and sparsity into a subsequent computation (similar to
the dense tensor init operation counterpart).

Example:
  %c = sparse_tensor.init %d1, %d2 : tensor<?x?xf32, #SparseMatrix>
  %0 = linalg.matmul
    ins(%a, %b: tensor<?x?xf32>, tensor<?x?xf32>)
    outs(%c: tensor<?x?xf32, #SparseMatrix>) -> tensor<?x?xf32, #SparseMatrix>

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D111684




More information about the All-commits mailing list