华为CANN TensorFlow AllGather算子
allgather【免费下载链接】tensorflowAscend TensorFlow Adapter项目地址: https://gitcode.com/cann/tensorflow功能说明集合通信算子AllGather的操作接口将通信域内所有节点的输入按照rank id重新排序然后拼接起来再将结果发送到所有节点的输出。[!NOTE]说明 针对AllGather操作每个节点都接收按照rank id重新排序后的数据集合即每个节点的AllGather输出都是一样的。函数原型def allgather(tensor, rank_size, grouphccl_world_group, fusion0, fusion_id-1)参数说明参数名输入/输出描述tensor输入TensorFlow的tensor类型。针对Ascend 950PR/Ascend 950DT支持数据类型int8、uint8、int16、uint16、int32、uint32、int64、uint64、float16、float32、float64、bfp16。针对Atlas A3 训练系列产品/Atlas A3 推理系列产品支持数据类型int8、uint8、int16、uint16、int32、uint32、int64、uint64、float16、float32、float64、bfp16。针对Atlas A2 训练系列产品/Atlas A2 推理系列产品支持数据类型int8、uint8、int16、uint16、int32、uint32、int64、uint64、float16、float32、float64、bfp16。针对Atlas 训练系列产品支持数据类型int8、uint8、int16、uint16、int32、uint32、int64、uint64、float16、float32、float64。针对Atlas 300I Duo 推理卡支持数据类型int8、uint8、int16、uint16、int32、uint32、int64、uint64、float16、float32、float64。rank_size输入group内device的数量int类型。最大值为32768。group输入String类型最大长度为128字节含结束符。group名称可以为用户自定义group或者hccl_world_group。fusion输入AllGather算子融合标识int类型支持以下取值- 0标识网络编译时不会对该算子进行融合即该AllGather算子不和其他AllGather算子融合。- 2网络编译时会对AllGather算子按照相同的fusion_id进行融合即“fusion_id”相同的AllGather算子之间会进行融合。fusion_id输入AllGather算子的融合idint类型。当“fusion”取值为“2”时网络编译时对相同fusion_id的AllGather算子进行融合。返回值对输入tensor执行完allgather操作之后的结果tensor。约束说明调用该接口的rank必须在当前接口入参group定义的范围内不在此范围内的rank调用该接口会失败。调用示例from npu_bridge.hccl import hccl_ops tensor tf.random_uniform((1, 3), minval1, maxval10, dtypetf.float32) rank_size 2 result hccl_ops.allgather(tensor, rank_size)【免费下载链接】tensorflowAscend TensorFlow Adapter项目地址: https://gitcode.com/cann/tensorflow创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2598539.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!