Skip to content

Commit 71f6bf6

Browse files
ranukundrscohn2
andauthored
doc:2025.1 spec updates (#613)
* doc:2025.1 spec updates * Update source/elements/oneCCL/source/spec/collective_operations.rst Co-authored-by: Robert Cohn <[email protected]> * fix formatting errors --------- Co-authored-by: Robert Cohn <[email protected]> Co-authored-by: Cohn, Robert S <[email protected]>
1 parent 78f4d02 commit 71f6bf6

File tree

6 files changed

+170
-36
lines changed

6 files changed

+170
-36
lines changed

source/elements/oneCCL/source/conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
# add these directories to sys.path here. If the directory is relative to the
1717
# documentation root, use os.path.abspath to make it absolute, like shown here.
1818
#
19+
#
1920
import os
2021
import sys
21-
sys.path.insert(0, os.path.abspath(os.path.join('..','..','..','conf')))
22-
# element_conf needs to import this conf
23-
sys.path.insert(0, os.path.abspath('.'))
22+
from os.path import join
2423

2524
project = 'oneCCL'
2625

27-
from element_conf import *
26+
repo_root = join('..', '..', '..', '..')
27+
exec(open(join(repo_root, 'source', 'conf', 'common_conf.py')).read())
28+
exec(open(join(repo_root, 'source', 'conf', 'element_conf.py')).read())

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

Lines changed: 96 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Collective Operations
88

99
oneCCL specification defines the following collective communication operations:
1010

11+
- `Allgather`_
1112
- `Allgatherv`_
1213
- `Allreduce`_
1314
- `Alltoallv`_
@@ -39,6 +40,66 @@ The communication operation may accept attribute object. If that parameter is mi
3940

4041
If the arguments provided to a communication operation call do not comply to the requirements of the operation, the behavior is undefined unless it is specified otherwise.
4142

43+
44+
.. _Allgather:
45+
46+
Allgather
47+
*********
48+
49+
Allgather is a collective communication operation that collects the ``send_count`` elements from all the ranks within the communicator and places the results into ``recv_buf``, in such a way that data from rank ``i`` can be found at offset rank ``i * count``. The resulting data in the output ``recv_buf`` buffer is the same for each rank.
50+
51+
52+
Allgather is in place when ``sendbuff == recvbuff + rank * send_count``.
53+
54+
.. code:: cpp
55+
56+
template<class BufferType>
57+
event ccl::allgather(const BufferType* send_buf,
58+
BufferType* recv_buf,
59+
size_t send_count,
60+
const communicator& comm,
61+
const stream& stream,
62+
const allgather_attr& attr = default_allgather_attr,
63+
const vector_class<event>& deps = {});
64+
65+
event ccl::allgather(const void* send_buf,
66+
void* recv_buf,
67+
size_t send_count,
68+
datatype dtype,
69+
const communicator& comm,
70+
const stream& stream,
71+
const allgather_attr& attr = default_allgather_attr,
72+
const vector_class<event>& deps = {});
73+
74+
75+
76+
send_buf
77+
The buffer with send_count elements of BufferType that stores local data to be gathered
78+
79+
recv_buf [out]
80+
The buffer to store gathered result of BufferTuype, must be large enough to hold values from all ranks, i.e., size should be equal do BufferType * send_count
81+
82+
send_count
83+
The number of elements of type BufferType in send_buf
84+
85+
dtype
86+
The datatype of elements in send_buf and recv_buf must be skipped if BufferType can be inferred otherwise must be passed explicitly
87+
88+
comm
89+
The communicator that defines a group of ranks for the operation
90+
91+
stream
92+
The stream associated with the operation
93+
94+
attr
95+
Optional attributes to customize the operation
96+
97+
deps
98+
An optional vector of the events that the operation should depend on
99+
100+
return event
101+
An object to track the progress of the operation
102+
42103
.. _Allgatherv:
43104

44105
Allgatherv
@@ -250,50 +311,53 @@ return ``event``
250311
Broadcast
251312
*********
252313

253-
Broadcast is a collective communication operation that broadcasts data
254-
from one rank of communicator (denoted as root) to all other ranks.
314+
Broadcast is a collective communication operation that broadcasts data from one rank of communicator (denoted as root) to all other ranks.
255315

256-
.. code:: cpp
316+
Broadcast is in-place if send_buf == recv_buf
257317

258-
template <class BufferType>
259-
event ccl::broadcast(BufferType* buf,
260-
size_t count,
261-
int root,
262-
const communicator& comm,
263-
const stream& stream,
264-
const broadcast_attr& attr = default_broadcast_attr,
265-
const vector_class<event>& deps = {});
318+
.. code:: cpp
266319
267-
event ccl::broadcast(void* buf,
268-
size_t count,
269-
datatype dtype,
270-
int root,
271-
const communicator& comm,
272-
const stream& stream,
273-
const broadcast_attr& attr = default_broadcast_attr,
274-
const vector_class<event>& deps = {});
320+
template <class BufferType>
321+
event ccl::broadcast(BufferType*send_buf,
322+
BufferType*recv_buf,
323+
size_t count,
324+
int root,
325+
const communicator& comm,
326+
const stream& stream,
327+
const broadcast_attr& attr = default_broadcast_attr,
328+
const vector_class<event>& deps = {});
329+
330+
event ccl::broadcast(void* send_buf,
331+
void* recv_buf
332+
size_t count,
333+
datatype dtype,
334+
int root,
335+
const communicator& comm,
336+
const stream& stream,
337+
const broadcast_attr& attr = default_broadcast_attr,
338+
const vector_class<event>& deps = {});
339+
275340
276-
buf [in,out]
277-
| the buffer with ``count`` elements of ``BufferType``
278-
| serves as ``send_buf`` for root and as ``recv_buf`` for other ranks
341+
send_buf [in,out]
342+
The buffer with ``count`` elements of ``BufferType`` serves as ``send_buf`` for root and as ``recv_buf`` for other ranks
279343
count
280-
the number of elements of type ``BufferType`` in ``buf``
344+
The number of elements of type ``BufferType`` in ``buf``
281345
root
282-
the rank that broadcasts ``buf``
346+
The rank that broadcasts ``buf``
283347
dtype
284-
| the datatype of elements in ``buf``
285-
| must be skipped if ``BufferType`` can be inferred
286-
| otherwise must be passed explicitly
348+
The datatype of elements in ``buf``
349+
| must be skipped if ``BufferType`` can be inferred
350+
| otherwise must be passed explicitly
287351
comm
288-
the communicator that defines a group of ranks for the operation
352+
The communicator that defines a group of ranks for the operation
289353
stream
290-
the stream associated with the operation
354+
The stream associated with the operation
291355
attr
292-
optional attributes to customize the operation
356+
Optional attributes to customize the operation
293357
deps
294-
an optional vector of the events that the operation should depend on
358+
An optional vector of the events that the operation should depend on
295359
return ``event``
296-
an object to track the progress of the operation
360+
An object to track the progress of the operation
297361

298362

299363
.. _Reduce:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.. SPDX-FileCopyrightText: 2019-2020 Intel Corporation
2+
..
3+
.. SPDX-License-Identifier: CC-BY-4.0
4+
5+
============
6+
Group Calls
7+
============
8+
9+
oneCCL specification defines the following group calls:
10+
11+
* group_start()
12+
* group_end()
13+
14+
15+
Group calls serve to merge multiple calls into a single group operation. These operations are initiated and finalized using primary functions: group_start() and group_end().
16+
17+
Group_start
18+
***********
19+
20+
void CCL_API group_start();
21+
22+
group_start() starts a group call. group_start() can be used to initiate a group call operation to indicate that successive operations should not get blocked due to CPU synchronization.
23+
24+
Group_end
25+
*********
26+
27+
void CCL_API group_end();
28+
29+
group_end() ends a group call. The group_end() call returns when all the operations between group_start() and group_end() have been enqueued for execution, but not necessarily completed.
30+
31+
32+
Note: Currently group calls are supported for point-to-point and collective operations.
33+

source/elements/oneCCL/source/spec/main_objects.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,38 @@ return ``context``
290290
See also: :doc:`collective_operations`
291291

292292

293+
294+
.. _Split_communicator:
295+
296+
SPLIT-COMMUNICATOR
297+
******************
298+
299+
The communicator provides methods to create one or more new communicators from an existing communicator. The new sub-communicators are created based on user-supplied color and key. Each newly formed sub-communicator includes only the ranks that provided the same color. Within each sub-communicator, ranks are reordered by the ascending key. This call is collective over all ranks in the communicator.
300+
301+
.. code:: cpp
302+
303+
communicator split_communicator(const communicator& comm, int color, int key);
304+
305+
``comm``
306+
An existing communicator handle.
307+
308+
``color``
309+
A value that defines which ranks will belong to the new sub-communicator. Ranks providing the same color are part of the same sub-communicator.
310+
311+
``key``
312+
Used to order the ranks within each sub-communicator. Ranks in the resulting communicator are sorted by the ascending key.
313+
314+
315+
316+
Return Value
317+
318+
``communicator``
319+
The handle to the new sub-communicator
320+
321+
322+
323+
324+
293325
.. _Stream:
294326

295327
Stream

source/elements/oneCCL/source/spec/operations.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ This section covers communication operations defined by oneCCL specification.
1616
collective_operations.rst
1717
operation_attributes.rst
1818
operation_progress.rst
19+
group_calls.rst

source/elements/oneCCL/source/spec/reductions.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ oneCCL specification defines the following reduction operations for :ref:`Allred
1616
prod = /* unspecified */,
1717
min = /* unspecified */,
1818
max = /* unspecified */,
19+
avg = /* unspecified */,
1920
custom = /* unspecified */
2021
};
2122
@@ -27,6 +28,8 @@ reduction::min
2728
elementwise min
2829
reduction::max
2930
elementwise max
31+
reduction::avg
32+
arithmethic average
3033
reduction::custom
3134
| specify user-defined reduction operation
3235
| the actual reduction function must be passed through ``reduction_fn`` operation attribute

0 commit comments

Comments
 (0)