Allreduce¶
-
event
allreduce
(const void *send_buf, void *recv_buf, size_t count, datatype dtype, reduction rtype, const communicator &comm, const stream &stream, const allreduce_attr &attr = default_allreduce_attr, const vector_class<event> &deps = {}) Allreduce is a collective communication operation that performs the global reduction operation on values from all ranks of communicator and distributes the result back to all ranks.
- Return
ccl::event an object to track the progress of the operation
- Parameters
send_buf
: the buffer withcount
elements ofdtype
that stores local data to be reducedrecv_buf
: [out] the buffer to store reduced result, must have the same dimension assend_buf
count
: the number of elements of typedtype
insend_buf
andrecv_buf
dtype
: the datatype of elements insend_buf
andrecv_buf
rtype
: the type of the reduction operation to be appliedcomm
: the communicator for which the operation will be performedstream
: a stream associated with the operationattr
: optional attributes to customize operationdeps
: an optional vector of the events that the operation should depend on
-
event
allreduce
(const void *send_buf, void *recv_buf, size_t count, datatype dtype, reduction rtype, const communicator &comm, const allreduce_attr &attr = default_allreduce_attr, const vector_class<event> &deps = {}) This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
template<class
BufferType
, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type>
eventallreduce
(const BufferType *send_buf, BufferType *recv_buf, size_t count, reduction rtype, const communicator &comm, const stream &stream, const allreduce_attr &attr = default_allreduce_attr, const vector_class<event> &deps = {}) This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
template<class
BufferType
, class = typename std::enable_if<is_native_type_supported<BufferType>(), event>::type>
eventallreduce
(const BufferType *send_buf, BufferType *recv_buf, size_t count, reduction rtype, const communicator &comm, const allreduce_attr &attr = default_allreduce_attr, const vector_class<event> &deps = {}) This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
template<class
BufferObjectType
, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type>
eventallreduce
(const BufferObjectType &send_buf, BufferObjectType &recv_buf, size_t count, reduction rtype, const communicator &comm, const stream &stream, const allreduce_attr &attr = default_allreduce_attr, const vector_class<event> &deps = {}) This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
-
template<class
BufferObjectType
, class = typename std::enable_if<is_class_supported<BufferObjectType>(), event>::type>
eventallreduce
(const BufferObjectType &send_buf, BufferObjectType &recv_buf, size_t count, reduction rtype, const communicator &comm, const allreduce_attr &attr = default_allreduce_attr, const vector_class<event> &deps = {}) This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.