6#ifndef popsparse_Embedding_hpp
7#define popsparse_Embedding_hpp
9#include <poplar/Graph.hpp>
10#include <poplar/Interval.hpp>
35 std::size_t numIndices,
59 const FullyConnectedParams ¶ms,
60 std::size_t numIndices,
63 PlanningCache *cache =
nullptr);
83 const FullyConnectedParams ¶ms,
86 PlanningCache *cache =
nullptr);
Parameters used for fully-connected layers using sparse tensors.
Basic representation of a sparse tensor.
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 set of option/value string flags to be used in various APIs.
Definition: OptionFlags.hpp:24
A reference to a subset of tensor elements.
Definition: Tensor.hpp:38
Class representing device data types.
Definition: Type.hpp:42
Program that executes a sequence of programs.
Definition: Program.hpp:77
Representation of a sparse tensor.
Definition: SparseTensor.hpp:16
poplar::Tensor createSliceTensor(poplar::Graph &graph, const poplar::Type &dataType, const FullyConnectedParams ¶ms, std::size_t numIndices, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={}, PlanningCache *cache=nullptr)
Create and map a tensor to be updated from efficiently.
poplar::Tensor createIndicesTensor(poplar::Graph &graph, const FullyConnectedParams ¶ms, std::size_t numIndices, const poplar::OptionFlags &options={}, const poplar::DebugContext &debugContext={})
Create and map a tensor to contain indices for slicing/updating a tensor efficiently.
void embeddingUpdateAdd(poplar::Graph &graph, const SparseTensor &t, const poplar::Tensor &slices, const poplar::Tensor &indices, const poplar::Tensor &scale, poplar::program::Sequence &prog, const FullyConnectedParams ¶ms, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={}, PlanningCache *cache=nullptr)
Update a sparse tensor with a set of slices at the given row indices.
poplar::Tensor embeddingSlice(poplar::Graph &graph, const SparseTensor &t, const poplar::Tensor &indices, poplar::program::Sequence &prog, const FullyConnectedParams ¶ms, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={}, PlanningCache *cache=nullptr)
Take multiple slices from a base tensor.
Support for sparse matrices.
Definition: codelets.hpp:8
Fully-connected layers using sparse tensors.