Poplar and PopLibs
|
A program that copies tensors between replicated sub-graphs. More...
#include <Program.hpp>
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... | |
A program that copies tensors between replicated sub-graphs.
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.
src | Replicated tensor to copy from. |
dst | Replicated tensor to copy to. |
replicaMap | Each 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). |
debugContext | Optional DebugId and program name. |