SparseAllreduce¶
-
ccl::event CCL_API sparse_allreduce (const void *send_ind_buf, size_t send_ind_count, const void *send_val_buf, size_t send_val_count, void *recv_ind_buf, size_t recv_ind_count, void *recv_val_buf, size_t recv_val_count, ccl::datatype ind_dtype, ccl::datatype val_dtype, ccl::reduction rtype, const ccl::communicator &comm, const ccl::stream &stream, const ccl::sparse_allreduce_attr &attr=ccl::default_sparse_allreduce_attr, const ccl::vector_class< ccl::event > &deps={})
Sparse allreduce is a collective communication operation that makes global reduction operation on sparse buffers from all ranks of communicator and distributes result back to all ranks. Sparse buffers are defined by separate index and value buffers.
- Parameters
send_ind_buf – the buffer of indices with
send_ind_count
elements of typeind_dtype
send_ind_count – the number of elements of type
ind_type
send_ind_buf
send_val_buf – the buffer of values with
send_val_count
elements of typeval_dtype
send_val_count – the number of elements of type
val_type
send_val_buf
recv_ind_buf – [out] the buffer to store reduced indices, unused
recv_ind_count – [out] the number of elements in
recv_ind_buf
, unusedrecv_val_buf – [out] the buffer to store reduced values, unused
recv_val_count – [out] the number of elements in
recv_val_buf
, unusedind_dtype – the datatype of elements in
send_ind_buf
andrecv_ind_buf
val_dtype – the datatype of elements in
send_val_buf
andrecv_val_buf
rtype – the type of the reduction operation to be applied
comm – the communicator for which the operation will be performed
stream – a stream associated with the operation
attr – optional attributes to customize operation
deps – an optional vector of the events that the operation should depend on
- Returns
ccl::event an object to track the progress of the operation
-
ccl::event CCL_API sparse_allreduce (const void *send_ind_buf, size_t send_ind_count, const void *send_val_buf, size_t send_val_count, void *recv_ind_buf, size_t recv_ind_count, void *recv_val_buf, size_t recv_val_count, ccl::datatype ind_dtype, ccl::datatype val_dtype, ccl::reduction rtype, const ccl::communicator &comm, const ccl::sparse_allreduce_attr &attr=ccl::default_sparse_allreduce_attr, const ccl::vector_class< ccl::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 IndexBufferType, class ValueBufferType, class = typename std::enable_if<ccl::is_native_type_supported<ValueBufferType>(), ccl::event>::type> ccl::event CCL_API sparse_allreduce (const IndexBufferType *send_ind_buf, size_t send_ind_count, const ValueBufferType *send_val_buf, size_t send_val_count, IndexBufferType *recv_ind_buf, size_t recv_ind_count, ValueBufferType *recv_val_buf, size_t recv_val_count, ccl::reduction rtype, const ccl::communicator &comm, const ccl::stream &stream, const ccl::sparse_allreduce_attr &attr=ccl::default_sparse_allreduce_attr, const ccl::vector_class< ccl::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 IndexBufferType, class ValueBufferType, class = typename std::enable_if<ccl::is_native_type_supported<ValueBufferType>(), ccl::event>::type> ccl::event CCL_API sparse_allreduce (const IndexBufferType *send_ind_buf, size_t send_ind_count, const ValueBufferType *send_val_buf, size_t send_val_count, IndexBufferType *recv_ind_buf, size_t recv_ind_count, ValueBufferType *recv_val_buf, size_t recv_val_count, ccl::reduction rtype, const ccl::communicator &comm, const ccl::sparse_allreduce_attr &attr=ccl::default_sparse_allreduce_attr, const ccl::vector_class< ccl::event > &deps={})
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.