Poplar and PopLibs
|
Block sparse matrix multiply. More...
Go to the source code of this file.
Classes | |
class | popsparse::experimental::BSMatMulParams |
This class supports block-sparse matrix multiplication. More... | |
Namespaces | |
namespace | popsparse |
Support for sparse matrices. | |
Functions | |
poplar::Tensor | popsparse::experimental::createBSMatMulInputLHS (poplar::Graph &graph, const BSMatMulParams &bsMatMul, const poplar::DebugContext &debugContext, const poplar::OptionFlags &options={}) |
Create a tensor for use as the left operand of block-sparse matrix multiplication. More... | |
poplar::Tensor | popsparse::experimental::createBSMatMulInputRHS (poplar::Graph &graph, const BSMatMulParams &bsMatMul, const poplar::DebugContext &debugContext, const poplar::OptionFlags &options={}) |
Create a tensor for use as the right operand of block-sparse matrix multiplication. More... | |
poplar::Tensor | popsparse::experimental::bsMatMul (poplar::Graph &graph, const BSMatMulParams &bsMatMulParams, poplar::program::Sequence &prog, const poplar::Tensor &lhsMatrix, const poplar::Tensor &rhsMatrix, const poplar::OptionFlags &options={}, const poplar::DebugContext &debugContext={}) |
This function multiplies the left-hand matrix by the right-hand matrix. More... | |
Block sparse matrix multiply.
poplar::Tensor popsparse::experimental::bsMatMul | ( | poplar::Graph & | graph, |
const BSMatMulParams & | bsMatMulParams, | ||
poplar::program::Sequence & | prog, | ||
const poplar::Tensor & | lhsMatrix, | ||
const poplar::Tensor & | rhsMatrix, | ||
const poplar::OptionFlags & | options = {} , |
||
const poplar::DebugContext & | debugContext = {} |
||
) |
This function multiplies the left-hand matrix by the right-hand matrix.
Matrix multiply options
numberOfPass
Integer [=1]
The number of passes used to serialise the matrix multiply.
If this is greater than 1, the leading dimension (if the matmul shape is [MxN] x [NxK], it is M) will be divided by numberOfPass
, and each sub matmul will be run in serial to reduce the temporary memory usage.
graph | The Poplar graph. |
bsMatMulParams | The object for block sparse information, includes the sparsity mask, the matrix size, the block size, and the data type. |
prog | A reference to a program sequence which will be appended with the code to perform the multiplication. |
lhsMatrix | If BSMatMulParams is for dense x sparse, this is the left-hand dense matrix. If BSMatMulParams is for sparse x sparse, this is the non-zero blocks of the left sparse matrix. For a group BSMatMulParams object, it should be concatenated along 0 dimension for all tensors in a group. |
rhsMatrix | A tensor for an array of non-zero blocks in the right-hand sparse matrix. For a group BSMatMulParams object, it should be concatenated along 0 dimension for all tensors in a group. |
options | The structure describing options for how the multiplication should be implemented. |
debugContext | Optional debug information. |
poplar::Tensor popsparse::experimental::createBSMatMulInputLHS | ( | poplar::Graph & | graph, |
const BSMatMulParams & | bsMatMul, | ||
const poplar::DebugContext & | debugContext, | ||
const poplar::OptionFlags & | options = {} |
||
) |
Create a tensor for use as the left operand of block-sparse matrix multiplication.
graph | The Poplar graph. |
bsMatMul | The object for block-sparse information, includes the sparsity mask, the matrix size, the block size, and the data type. |
debugContext | Optional debug information. |
options | Matrix multiple options, see bsMatMul() for details. |
poplar::Tensor popsparse::experimental::createBSMatMulInputRHS | ( | poplar::Graph & | graph, |
const BSMatMulParams & | bsMatMul, | ||
const poplar::DebugContext & | debugContext, | ||
const poplar::OptionFlags & | options = {} |
||
) |
Create a tensor for use as the right operand of block-sparse matrix multiplication.
graph | The Poplar graph. |
bsMatMul | The object for block-sparse information, includes the sparsity mask, the matrix size, the block size, and the data type. |
debugContext | Optional debug information. |
options | Matrix multiple options, see bsMatMul() for details. |