ProcessGroup#
-
class nvmath.
distributed. ProcessGroup[source]# A ProcessGroup represents a set of processes collectively running
nvmath.operations. A ProcessGroup implements a small set of communication collectives used by nvmath-python to initialize the distributed runtime and set up distributed math operations. It is not used for compute (each math library uses its chosen communication backend(s), like NCCL or NVSHMEM).distributed Attributes
- nranks#
Number of processes in the group.
- rank#
Index of this process in the group.
Methods
- abstractmethod allreduce_buffer(
- array: ndarray,
- *,
- op: ReductionOp,
Allreduce an array.
- Parameters:
array – Input and output of the collective. The function operates in-place.
op – One of the values from
ReduceOpenum. Specifies an operation for element-wise reductions.
- abstractmethod allreduce_object(
- obj: T,
- *,
- op: Callable[[T, T], T],
Reduces all Python objects contributed by members of the group. The result is a single reduced object which is returned on every process.
- Parameters:
obj – object contributed by this process.
op – A Python function that takes two objects and returns a single (reduced) object.