Skip to content

Commit 1e306d6

Browse files
author
Alexandra
authored
Update collective_operations.rst (#507)
1 parent 2189b57 commit 1e306d6

1 file changed

Lines changed: 137 additions & 0 deletions

File tree

source/elements/oneCCL/source/spec/collective_operations.rst

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ oneCCL specification defines the following collective communication operations:
1515
- `Broadcast`_
1616
- `Reduce`_
1717
- `ReduceScatter`_
18+
- `PointToPoint`_
1819

1920
These operations are collective, meaning that all participants (ranks) of oneCCL communicator should make a call.
2021
The order of collective operation calls should be the same across all ranks.
@@ -398,6 +399,142 @@ return ``event``
398399
an object to track the progress of the operation
399400

400401

402+
.. _PointToPoint:
403+
404+
Point-To-Point Operations
405+
*************************
406+
407+
OneCCL specification defines the following point-to-point operations:
408+
409+
* Send
410+
* Recv
411+
412+
In point-to-point communication, two ranks participate in the communication so when a process sends data to a peer rank,
413+
the peer rank needs to post a ``recv`` call with the same datatype and count as the sending rank.
414+
415+
The current specification only supports blocking ``send`` and ``recv`` and does not support for multiple ``send``
416+
and ``receive`` operations to proceed concurrently.
417+
418+
In the ``send`` operation, the peer specifies the destination process, while in the recv operation peer specifies the source process.
419+
420+
As with the collective operations, the communicator can perform communication operations on host or device memory buffers
421+
depending on the device used to create the communicator. Additionally, communication operations accept an execution
422+
context (stream) and may accept a vector of events on which the communication operation should depend, that is, input dependencies.
423+
The output event object provides the ability to track the operation's progress.
424+
425+
.. note:: Support for the handling of input events is optional.
426+
427+
BufferType is used below to define the C++ type of elements in communication operations' data buffers
428+
(``buf``, ``send_buf``, and ``recv_buf``). At least the following types should be supported: ``[u]int{8/16/32/64}_t, float, double``.
429+
The explicit datatype parameter enable data types that cannot be inferred from the function arguments.
430+
For more information, see Custom Datatypes.
431+
432+
The communication operation accepts a stream object. If a communicator is created from ``native_device_type``,
433+
then the stream translates to ``native_stream_type`` created from the corresponding device.
434+
435+
The communication operation may accept attribute objects. If that parameter is missed, then the default attribute object is used
436+
(``default_<operation_name>_attr``). The default attribute object is provided by the library.
437+
For more information, see Operation Attributes.
438+
439+
If the arguments provided to a communication operation call do not comply with the requirements of the operation,
440+
the behavior is undefined, unless otherwise specified.
441+
442+
Send
443+
^^^^
444+
445+
A blocking point-to-point communication operation that sends the data in a buf to a peer rank.
446+
447+
.. code:: cpp
448+
449+
template <class BufferType,
450+
event CCL_API send(BufferType *buf,
451+
size_t count,
452+
int peer,
453+
const communicator &comm,
454+
const stream &stream,
455+
const pt2pt_attr &attr = default_pt2pt_attr,
456+
const vector_class<event>& deps = {});
457+
458+
event CCL_API send(void *buf,
459+
size_t count,
460+
datatype dtype,
461+
int peer,
462+
const communicator &comm,
463+
const stream &stream,
464+
const pt2pt_attr &attr = default_pt2pt_attr,
465+
const vector_class<event> &deps = {});
466+
467+
buf
468+
the buffer with count elements of ``dtype`` that contains the data to be sent
469+
count
470+
the number of elements of type dtype in buf
471+
dtype
472+
the datatype of elements in buf
473+
must be skipped if ``BufferType`` can be inferred
474+
otherwise must be passed explicitly
475+
peer
476+
the destination rank
477+
comm
478+
the communicator that defines a group of ranks for the operation
479+
stream
480+
the stream associated with the operation
481+
attr
482+
optional attributes to customize the operation
483+
deps
484+
an optional vector of the events that the operation should depend on
485+
486+
return event
487+
an object to track the progress of the operation
488+
489+
Recv
490+
^^^^^
491+
492+
A blocking point-to-point communication operation that receives the data in a buf from a peer rank.
493+
494+
.. code:: cpp
495+
496+
template <class BufferType,
497+
event CCL_API recv(BufferType *buf,
498+
size_t count,
499+
int peer,
500+
const communicator &comm,
501+
const stream &stream,
502+
const pt2pt_attr &attr = default_pt2pt_attr,
503+
const vector_class<event> &deps = {});
504+
505+
event CCL_API send(void *buf,
506+
size_t count,
507+
datatype dtype,
508+
int peer,
509+
const communicator &comm,
510+
const stream &stream,
511+
const pt2pt_attr &attr = default_pt2pt_attr,
512+
const vector_class<event> &deps = {});
513+
514+
buf [out]
515+
the buffer with count elements of dtype that contains the data to be sent
516+
count
517+
the number of elements of type dtype in buf
518+
dtype
519+
the datatype of elements in buf
520+
must be skipped if ``BufferType`` can be inferred
521+
otherwise must be passed explicitly
522+
peer
523+
the destination rank
524+
comm
525+
the communicator that defines a group of ranks for the operation
526+
stream
527+
The stream associated with the operation
528+
attr
529+
optional attributes to customize the operation
530+
deps
531+
an optional vector of the events that the operation should depend on
532+
533+
return event
534+
object to track the progress of the operation
535+
536+
537+
401538
.. note::
402539
See also:
403540

0 commit comments

Comments
 (0)