6#ifndef popsparse_FullyConnected_hpp
7#define popsparse_FullyConnected_hpp
9#include <poplar/Graph.hpp>
10#include <poplar/OptionFlags.hpp>
11#include <poplar/Program.hpp>
67 const FullyConnectedParams ¶ms,
70 PlanningCache *cache =
nullptr);
87 const FullyConnectedParams ¶ms,
90 PlanningCache *cache =
nullptr);
123 const FullyConnectedParams &fcParams,
127 PlanningCache *cache =
nullptr);
162 const poplar::Tensor &gradients,
const FullyConnectedParams &fcParams,
219 const FullyConnectedParams &fcParams,
Parameters used for fully-connected layers using sparse tensors.
Caching of plans for dynamically sparse operations.
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
std::tuple< unsigned, unsigned, unsigned > fullyConnectedDenseGradWSerialSplits(const poplar::Graph &graph, const poplar::Type &inputType, const FullyConnectedParams &fcParams, const poplar::OptionFlags &options_={}, PlanningCache *cache=nullptr)
Report the serial splitting of a dense gradW output given the memory proportion limit given in option...
poplar::Tensor createFullyConnectedInput(poplar::Graph &graph, const poplar::Type &inputType, const FullyConnectedParams ¶ms, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={}, PlanningCache *cache=nullptr)
Create a dense tensor that is used as the input activations for a fully connected layer.
poplar::Tensor fullyConnectedSparseGradW(poplar::Graph &graph, const poplar::Tensor sparsityMetaInfo, const poplar::Tensor &gradA, const poplar::Tensor &activations, const FullyConnectedParams &fcParams, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={}, PlanningCache *cache=nullptr)
Run a fully connected GradW pass to compute sparse gradients.
SparseTensor createFullyConnectedWeights(poplar::Graph &graph, const poplar::Type &inputType, const FullyConnectedParams ¶ms, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={}, PlanningCache *cache=nullptr)
Create a sparse tensor that is used as the weights W for a fully connected layer.
poplar::Tensor fullyConnectedFwd(poplar::Graph &graph, const SparseTensor &weights, const poplar::Tensor &activations, const FullyConnectedParams &fcParams, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={}, PlanningCache *cache=nullptr)
Run a fully connected forward (or inference) pass.
poplar::Tensor fullyConnectedGradA(poplar::Graph &graph, const SparseTensor &weights, const poplar::Tensor &gradients, const FullyConnectedParams &fcParams, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={}, PlanningCache *cache=nullptr)
Run a fully connected GradA pass.
Support for sparse matrices.
Definition: codelets.hpp:8