10Creates a common world for communication operators.
12 .Input(0, "kv_handler",
"Key/value handler for rendezvous (optional).")
13 .Output(0,
"comm_world",
"A common world for collective operations.")
14 .Arg(
"size",
"(int) size of the common world.")
15 .Arg(
"rank",
"(int) rank of this node in the common world.");
21Clones existing common world.
23 .Input(0, "existing_comm_world",
"Existing common world to clone.")
24 .Output(0,
"comm_world",
"A common world for collective operations.");
29 .EnforceInplace({{0, 0}})
30 .
SetDoc(
"Closes all connections managed by a common world.")
31 .Input(0,
"common_world",
"The common world to be destroyed.");
34 .NumInputsOutputs([](
int in,
int out) {
35 return in >= 2 &&
out == (
in - 1);
39 .IdenticalTypeAndShapeOfInput(0)
41Does a broadcast operation from the root node to every other node. The tensor
42on each node should have been pre-created with the same shape and data type.
44 .Input(0, "comm_world",
"The common world.")
45 .Input(1,
"X",
"A tensor to be broadcasted.")
46 .Output(0,
"X",
"In-place as input 1.")
47 .Arg(
"root",
"(int, default 0) the root to run broadcast from.");
52 .InputsCanCrossDevices()
53 .IdenticalTypeAndShapeOfInput(0)
55Does a reduce operation from every node to the root node. Currently only
58 .Input(0, "comm_world",
"The common world.")
59 .Input(1,
"X",
"A tensor to be reduced.")
60 .Output(0,
"Y",
"The reduced result on root, not set for other nodes.")
61 .Arg(
"root",
"(int, default 0) the root to run reduce into.");
64 .NumInputsOutputs([](
int in,
int out) {
65 return in >= 2 &&
out == (
in - 1);
69 .InputsCanCrossDevices()
71Does an allreduce operation among the nodes. Currently only Sum is supported.
73 .Input(0, "comm_world",
"The common world.")
74 .Input(1,
"X",
"A tensor to be allreduced.")
75 .Output(0,
"Y",
"The allreduced tensor, same on all nodes.");
78 .NumInputsOutputs([](
int in,
int out) {
79 return in >= 2 &&
out == (
in - 1);
83 .InputsCanCrossDevices()
85Does reduce-scatter operation among the nodes. Currently only Sum is supported.
87 .Input(0, "comm_world",
"The common world.")
88 .Input(1,
"X",
"A tensor to be reduce-scattered.")
89 .Output(0,
"Y",
"The reduced tensor, scattered on all nodes.");
94 .InputsCanCrossDevices()
96Does an allgather operation among the nodes.
98 .Input(0, "comm_world",
"The common world.")
99 .Input(1,
"X",
"A tensor to be allgathered.")
100 .Output(0,
"Y",
"The allgathered tensor, same on all nodes.");
105Does a barrier operation among the nodes.
107 .Input(0, "comm_world",
"The common world.");
113Sends the tensor to another node.
115 .Input(0, "comm_world",
"The common world.")
116 .Input(1,
"X",
"A tensor to be allgathered.")
120 "An int CPUtensor of size 1 specifying the rank. If "
121 "given, this overrides the 'to' argument of the op.")
125 "An int CPUtensor of size 1 specifying the tag to "
126 "send the tensor with. This overrides the 'tag' "
127 "argument of the op.")
128 .Arg(
"dst",
"The rank to send the tensor to.")
129 .Arg(
"tag",
"(int) a tag to send the tensor with.")
132 "(bool) if set, only send the content and assume that the receiver "
133 "has already known the tensor's shape and information.");
138 .EnforceInplace({{1, 0}})
141Receives the tensor from another node.
143 .Input(0, "comm_world",
"The common world.")
147 "In-place output. If raw_buffer is specified, "
148 "Y should have pre-allocated data and type..")
152 "An int CPUtensor of size 1 specifying the rank. If "
153 "given, this overrides the 'from' argument of the op.")
157 "An int CPUtensor of size 1 specifying the tag to "
158 "send the tensor with. This overrides the 'tag' "
159 "argument of the op.")
160 .Output(0,
"Y",
"The received tensor.")
164 "The sender that sent the message as a CPUTensor "
165 "of size 1 and of type int.")
169 "The tag that the message is sent with as a CPUTensor "
170 "of size 1 and of type int.")
171 .Arg(
"src",
"(int) he rank to receive the tensor from.")
172 .Arg(
"tag",
"(int) a tag to receive the tensor with.")
175 "(bool) if set, only send the content and assume that the receiver "
176 "has already known the tensor's shape and information.");
A helper class to denote that an op does not have a default engine.
TORCH_API void Broadcast(const int X_ndim, const int *X_dims, const int Y_ndim, const int *Y_dims, const T alpha, const T *X, T *Y, Context *context)
def Allreduce(net, blobs, reduced_affix="_reduced", gpu_indices=None)
Copyright (c) 2016-present, Facebook, Inc.
REGISTER_CPU_OPERATOR(ATen, ATenOp< CPUContext >)
InputsCanCrossDevices() .IdenticalTypeAndShapeOfInput(0) .SetDoc(R"DOC( Does a broadcast operation from the root node to every other node. The tensor on each node should have been pre-created with the same shape and data type. )DOC") .Input(0
const vector< TensorShape > & in
INT_MAX NumOutputs(1, INT_MAX)
SHOULD_NOT_DO_GRADIENT(ScriptModule)
SparseLengths8BitsRowwiseOp< CPUContext, 0, 1 >::LENGTHS SetDoc(R"DOC(
Variation of SparseLengthsMean operator, where DATA is
stored using 8bits. DATA was quantized with 8Bit row-wise
quantization (see doc to FloatToRowwiseQuantized8Bits operator). To
restore DATA from 8Bit, we use additional input that stores scales
and biases.
)DOC") .Input(0
IdenticalTypeAndShapeOfInput(0)
Tensor * Reduce(const std::string &name, const std::vector< DimArg > &dim_args, const Reducer &reducer, const Placeholder &buffer, const std::vector< DimArg > &reduce_args)