RecvOperation
Applicable Products
|
Hardware Model |
Supported |
|---|---|
|
Atlas 350 accelerator cards |
x |
|
|
√ |
|
|
√ |
|
|
x |
|
|
x |
|
|
x |
Description
Receives data from a specified communication card. Send and Recv must be used together.
Definition
1 2 3 4 5 6 7 8 9 10 11 12 |
struct RecvParam { int rank = 0; int rankSize = 0; int rankRoot = 0; uint32_t srcRank = 1; std::string backend = "hccl"; HcclComm hcclComm = nullptr; CommMode commMode = COMM_MULTI_PROCESS; std::string rankTableFile; std::string commDomain; uint8_t rsv[64] = {0}; }; |
Parameters
|
Member |
Type |
Default Value |
Description |
|---|---|---|---|
|
rank |
int |
0 |
Rank of the current device within the communicator. |
|
rankSize |
int |
0 |
Number of devices. |
|
rankRoot |
int |
0 |
Root rank for the operation. |
|
srcRank |
uint32_t |
1 |
ID of the destination rank |
|
backend |
std::string |
hccl |
Communication backend indication. Only hccl is supported. |
|
hcclComm |
HcclComm |
nullptr |
Pointer to the HCCL communicator. By default, this parameter is left blank. The ATB is created by users. If the user wants to manage the communicator, the communicator pointer needs to be passed. The ATB uses the passed communicator pointer to execute the communication operator. |
|
commMode |
CommMode |
COMM_MULTI_PROCESS |
Communication mode. For details, see CommMode. In the scenario where hccl multi-thread is applied, a communicator can only be imported externally. |
|
rankTableFile |
std::string |
- |
Path of the configuration file for cluster information, which applies to single-node and multi-node communication. Currently, only the HCCL backend is supported. If a rank table is configured for a single-node system, the rank table is used to initialize the communicator. |
|
commDomain |
std::string |
- |
Communicator name used by a communication device group when there are multiple communicators. Currently, only hccl is supported. |
|
rsv[64] |
uint8_t |
{0} |
Reserved |
Input
|
Parameter |
Dimension |
Data Type |
Format |
Description |
|---|---|---|---|---|
|
x |
[d0, ..., dn] |
"hccl": float16/float/int8/int16/int32/int64/bf16 |
ND |
Input tensor |
Output
|
Parameter |
Dimension |
Data Type |
Format |
Description |
|---|---|---|---|---|
|
output |
[d0, ..., dn] |
"hccl": float16/float/int8/int16/int32/int64/bf16 |
ND |
Output tensor with the same dimensions as the input. |
Constraints
- rank, rankSize, and rankRoot must meet the following conditions:
- 0 ≤ rank < rankSize
- 0 ≤ rankRoot < rankSize
- 0 ≤ srcRank < rankSize
- If there are multiple users, ATB_SHARE_MEMORY_NAME_SUFFIX (see ATB Environment Variables) needs to be used to distinguish the shared memory and synchronize initialization information.
- When the communication operator of the ATB exits abnormally, run the following commands to clear the residual data to avoid affecting subsequent operations.
rm -rf /dev/shm/sem.lccl* rm -rf /dev/shm/sem.hccl* ipcrm -a