communication#
Communication utilities
Functions
Clean up the distributed environment. |
|
|
Exchange tensor data with a peer rank using collective communication. |
Get the rank of the current process. |
|
Get the total number of processes. |
|
|
Initialize |
- comm_exchange_arrays(send_data: Tensor, recv_data: Tensor, pair_rank: int | None) None[source]#
Exchange tensor data with a peer rank using collective communication.
This performs a point-to-point communication via
dist.all_to_all_singleand allows specific ranks to participate in the collective call without active data transfer by settingpair_ranktoNone.- Parameters:
send_data (Tensor) – Data to be sent to the
pair_rank. Ifpair_rankisNone, this can be an empty tensor with correct dtype and device.recv_data (Tensor) – Pre-allocated buffer to store received data. Must match
send_datain shape and dtype ifpair_rankis active. Ifpair_rankisNone, this can be an empty tensor.pair_rank (int | None) – The target rank for exchange, or
Noneto remain quiescent during the collective call.