Poplar and PopLibs
VarStructure.hpp File Reference

Manage partitioning and grouping in tensors. More...

#include <functional>
#include <map>
#include <unordered_set>
#include <vector>
#include <poplar/Graph.hpp>

Go to the source code of this file.

Namespaces

namespace  poputil
 General utility functions for building graphs.
 

Typedefs

using poputil::GroupingInfo = std::pair< unsigned, unsigned >
 Grouped dimension info. More...
 

Functions

unsigned poputil::detectInnermostGrouping (const poplar::Graph &graph, const poplar::Tensor &t)
 Detect if the tensor t has a grouping in its innermost dimension. More...
 
std::vector< GroupingInfo > poputil::detectDimGroupings (const poplar::Graph &graph, const poplar::Tensor &t)
 Find all grouped dimensions from the innermost grouped dimension moving outwards, returning groupings for each. More...
 
poplar::Tensor poputil::createPartitionableTensor (poplar::Graph &graph, const poplar::Type &type, const std::vector< std::size_t > &shape, const std::vector< std::size_t > &nPartitions, const poplar::DebugContext &debugContext={})
 Create a tensor with the given shape, so that when it is partitioned into slices according to the given number of partitions in each dimension, each slice is a single contiguous region. More...
 
void poputil::iterateTensorPartitions (const poplar::Tensor &t, const std::vector< std::size_t > &nPartitions, const std::function< void(const std::vector< std::size_t > &i, const poplar::Tensor &s)> &f)
 Iterate a function over the partitions of a tensor. More...
 

Detailed Description

Manage partitioning and grouping in tensors.