Poplar and PopLibs
poplar::program::CrossReplicaCopy Class Reference

A program that copies tensors between replicated sub-graphs. More...

#include <Program.hpp>

Inheritance diagram for poplar::program::CrossReplicaCopy:
poplar::program::Program

Public Member Functions

 CrossReplicaCopy (Tensor src, Tensor dst, std::map< unsigned, unsigned > replicaMap, const DebugContext &debugContext={})
 Constructor to create a program to copy a tensor to the equivalent tensor in a different replica sub-graph. More...
 

Detailed Description

A program that copies tensors between replicated sub-graphs.

Constructor & Destructor Documentation

◆ CrossReplicaCopy()

poplar::program::CrossReplicaCopy::CrossReplicaCopy ( Tensor  src,
Tensor  dst,
std::map< unsigned, unsigned >  replicaMap,
const DebugContext debugContext = {} 
)

Constructor to create a program to copy a tensor to the equivalent tensor in a different replica sub-graph.

When the replicated graphs are created, this will create a Copy program in each replica. Each replica sends to exactly one other replica and receives from exactly one other replica. A replica may not copy to itself.

Parameters
srcReplicated tensor to copy from.
dstReplicated tensor to copy to.
replicaMapEach key in this map specifies a source replica from which to copy. The corresponding value specifies the replica to copy to. The map describes how to copy the replicated tensor src to dst for each replica.
For example, given replicationFactor of 4, a clockwise ring may be constructed with the following replica map: {{0, 2}, {2, 3}, {3, 1}, {1, 0}}
Each replica must be represented once as a key (source) and once as a value (destination).
debugContextOptional DebugId and program name.

The documentation for this class was generated from the following file: