从当前通信卡接收来自指定通信卡的数据。Send和Recv需要配套使用。
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; };
成员名称 |
类型 |
默认值 |
描述 |
---|---|---|---|
rank |
int |
0 |
当前卡所属通信编号。 |
rankSize |
int |
0 |
通信的卡的数量。 |
rankRoot |
int |
0 |
主通信编号。 |
srcRank |
uint32_t |
1 |
通信域内数据接收端的rank编号。 |
backend |
std::string |
"hccl" |
通信后端指示,仅支持"hccl"。 |
hcclComm |
HcclComm |
nullptr |
HCCL通信域指针。 默认为空,加速库为用户创建;若用户想要自己管理通信域,则需要传入该通信域指针,加速库使用传入的通信域指针来执行通信算子。 |
commMode |
CommMode |
COMM_MULTI_PROCESS |
通信模式,CommMode类型枚举值。hccl多线程只支持外部传入通信域方式。 |
rankTableFile |
std::string |
- |
集群信息的配置文件路径,适用单机以及多机通信场景,当前仅支持hccl后端场景,若单机配置了ranktable,则以ranktable来初始化通信域。 ranktable配置请参见《CANN TensorFlow 1.15模型迁移指南》的“模型训练>执行分布式训练>准备ranktable资源配置文件”。 |
commDomain |
std::string |
- |
通信device组用通信域名标识,多通信域时使用,当前仅支持hccl。 |
参数 |
维度 |
数据类型 |
格式 |
描述 |
---|---|---|---|---|
x |
[d0,…,dn] |
"hccl": float16/float/int8/int16/int32/int64/bf16 |
ND |
输入tensor。 |
参数 |
维度 |
数据类型 |
格式 |
描述 |
---|---|---|---|---|
output |
[d0,…,dn] |
"hccl": float16/float/int8/int16/int32/int64/bf16 |
ND |
输出tensor,与输入维度相同。 |
rm -rf /dev/shm/sem.lccl* rm -rf /dev/shm/sem.hccl* ipcrm -a