6#ifndef POPSPARSE_BLOCK_SPARSE_H
7#define POPSPARSE_BLOCK_SPARSE_H
13#include <poplar/Graph.hpp>
14#include <poplar/Program.hpp>
15#include <poplar/Tensor.hpp>
16#include <poplar/Type.hpp>
19namespace experimental {
66 const std::array<int, 2> &dim,
67 const std::array<int, 2> &blockSize,
68 const std::vector<unsigned char> &sparsity,
104 const std::array<int, 2> &dim,
105 const std::array<int, 2> &blockSize,
106 const std::vector<unsigned char> &sparsity,
136 const std::array<int, 2> &dim,
137 const std::array<int, 2> &blockSize,
138 const std::vector<unsigned char> &sparsity,
poplar::Tensor bsSoftmax(poplar::Graph &graph, poplar::Tensor sparseTensor, const std::array< int, 2 > &dim, const std::array< int, 2 > &blockSize, const std::vector< unsigned char > &sparsity, SubBlockMask subBlockMaskType, unsigned numGroups, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
This function computes softmax on a sparse tensor.
SubBlockMask
Define the sparsity mask inside a block.
Definition: BlockSparse.hpp:26
@ None
No elements are zeroed out.
@ ZeroLowerTriangle
Elements in the lower triangle, below the diagonal, are zeroed out.
@ ZeroUpperTriangle
Elements in the upper triangle, above the diagonal, are zeroed out.
poplar::Tensor bsSoftmaxGrad(poplar::Graph &graph, poplar::Tensor sparseOut, poplar::Tensor sparseOutGrad, const std::array< int, 2 > &dim, const std::array< int, 2 > &blockSize, const std::vector< unsigned char > &sparsity, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
This function computes softmax gradient on a sparse tensor.
void bsSoftmaxInPlace(poplar::Graph &graph, poplar::Tensor sparseTensor, const std::array< int, 2 > &dim, const std::array< int, 2 > &blockSize, const std::vector< unsigned char > &sparsity, SubBlockMask subBlockMaskType, unsigned numGroups, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
This function computes softmax on a sparse tensor, in place.
DebugContext gathers the common external parameters of the context of an operation.
Definition: DebugContext.hpp:221
This class represents a graph program to be executed on the IPU.
Definition: Graph.hpp:52
A reference to a subset of tensor elements.
Definition: Tensor.hpp:38
Program that executes a sequence of programs.
Definition: Program.hpp:77
Support for sparse matrices.
Definition: codelets.hpp:8