Poplar and PopLibs
Norms.hpp
Go to the documentation of this file.
1// Copyright (c) 2019 Graphcore Ltd. All rights reserved.
6#ifndef popnn_Norms_hpp
7#define popnn_Norms_hpp
8#include "poplar/DebugContext.hpp"
9#include "poplar/Program.hpp"
10#include "poplar/Tensor.hpp"
11
12namespace popnn {
13
23std::uint64_t getNormFwdFlops(std::size_t statisticsSize,
24 std::size_t numActsElements,
25 bool computeStats = true);
26
33std::uint64_t getNormBwdFlops(std::size_t statisticsSize,
34 std::size_t numActsElements);
35
42std::uint64_t getNormWuFlops(std::size_t paramsSize,
43 std::size_t numActsElements);
44
50 const poplar::DebugContext &debugContext = {});
51
57 const poplar::DebugContext &debugContext = {});
58
64std::pair<poplar::Tensor, poplar::Tensor>
66 const poplar::DebugContext &debugContext = {});
67
68} // namespace popnn
69#endif // popnn_Norms_hpp
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
Functions used in neural networks.
Definition: BatchNorm.hpp:14
poplar::Tensor createNormGamma(poplar::Graph &graph, const poplar::Tensor &acts, const poplar::DebugContext &debugContext={})
std::pair< poplar::Tensor, poplar::Tensor > createNormParams(poplar::Graph &graph, const poplar::Tensor acts, const poplar::DebugContext &debugContext={})
std::uint64_t getNormWuFlops(std::size_t paramsSize, std::size_t numActsElements)
Calculate the floating point operations required for parameter update for a norm layer.
std::uint64_t getNormBwdFlops(std::size_t statisticsSize, std::size_t numActsElements)
Calculate the floating point operations required for computation of the gradient with respect to the ...
poplar::Tensor createNormBeta(poplar::Graph &graph, const poplar::Tensor &acts, const poplar::DebugContext &debugContext={})
std::uint64_t getNormFwdFlops(std::size_t statisticsSize, std::size_t numActsElements, bool computeStats=true)
Calculate the floating point operations required for the forward pass of a norm layer.