当前位置:网站首页>NCCL 集合通信--Collective Operations
NCCL 集合通信--Collective Operations
2022-07-27 09:17:00 【黄昏贩卖机】
集合通信 Collective Operations
AllReduce

ncclResult_t ncclBroadcast(const void* sendbuff, void* recvbuff, size_t count, ncclDataType_t datatype, int root, ncclComm_t comm, cudaStream_t stream)
- N 个设备参加的AllReduce,没有root,初始状态下,所有的N个设备上sendbuffer 长度为 count(函数中定义 size_t count),N个sendbuffer中的内容记为 in_0,in_1,…,in_N-1, 运行结束后,所有sendbuffer中内容经过op操作,使得N个设备上的recv buffer中有相同的结果副本,长度均为count,即out。
- 以op操作为ncclSum为例, out[i] 来自于所有sendbuffer的 in_k[i] 的和,即 out[i] = sum(in_k[i])
Broadcast

ncclResult_t ncclBroadcast(const void* sendbuff, void* recvbuff, size_t count, ncclDataType_t datatype, int root, ncclComm_t comm, cudaStream_t stream)
N个设备参与的broadcast,root 是 函数中指定的 int root(以上图为例则是2),初始状态下,rank 为 root(上图中2)的设备上的send buffer 长度为count。运行结束后,所有参与broadcast 的N个设备上的recv buffer 长度为 count, 且所有N个rank 的 recv buffer 部分的数据均来自于 root设备的send buffer 的拷贝。
Reduce

ncclResult_t ncclReduce(const void* sendbuff, void* recvbuff, size_t count, ncclDataType_t datatype, ncclRedOp_t op, int root, ncclComm_t comm, cudaStream_t stream)
- N个设备参与的reduce ,root 是 函数中指定的 int root(上图中为2),初始状态下,N个设备上的send buffer 长度为 count,记为数组 in_0,in_1,…in_N-1。 运行结束后,rank 为 root (上图中为2)的设备的recv buffer长度为count,记为数组out 。其中 recv buffer的数据来自于N个的send buffer经op操作后的结果。
- 以op操作为 ncclSum为例,out[i] 为各个send buffer 中 in_X[i] 的和,即out[i] = sum(in_X[i])
AllGather

ncclResult_t ncclAllGather(const void* sendbuff, void* recvbuff, size_t sendcount, ncclDataType_t datatype, ncclComm_t comm, cudaStream_t stream)
N个设备参与AllGather,没有root,初始状态下,N个设备上的send buffer 长度为 sendcount,记为数组 in_0,int_1,…,in_N-1,运行结束后,N个设备上的recv buffer 内容均相同,长度均为 N ∗ s e n d c o u n t N*sendcount N∗sendcount,记为 数组out 。其中每个设备上的recv buffer中的 o u t [ Y ∗ s e n d c o u t + i ] out[Y*sendcout + i] out[Y∗sendcout+i]来自于rank为 Y 的设备的send buffer中的 in_Y[i] , 即 out[Y*count + i] = in_Y[i]
ReduceScatter

ncclResult_t ncclReduceScatter(const void* sendbuff, void* recvbuff, size_t recvcount, ncclDataType_t datatype, ncclRedOp_t op, ncclComm_t comm, cudaStream_t stream)
- N 个设备参与的ReduceScatter,没有root设备。初始状态下,N个设备的sendbuffer 长度均为 N*recvcount。运行结束后,N个设备的recv buffer长度为 recvcount,记为数组out_0,out_1,…,out_N-1。其中,N个 send buffer中数据经过op 操作得到 reduced result,将其散布在 N 个设备中,每个设备仅包含 reduced result中一部分。
- 以op操作为 ncclSum为例, rank为Y的设备中数据 out_Y[i] 为 reduced result 中 Yrecvcount+i 位置的数据,即 out_Y[i] = sum(in_X[Ycount + i])
边栏推荐
- [C language - zero foundation _ study _ review _ lesson 4] data types and operations
- What if the parameters in QT are structs or custom classes when sending signals?
- 巴比特 | 元宇宙每日必读:广州南沙发布“元宇宙九条”措施,平台最高可获得2亿元资金支持...
- [micro service ~sentinel] sentinel dashboard control panel
- QT uses SQLite to open multiple database files at the same time
- 【每日算法Day 96】腾讯面试题:合并两个有序数组
- D3.v3.js data visualization -- pictures and tips of force oriented diagram
- C language exercise 2
- Mangodb simple to use
- How to upload dynamic GIF map in blog
猜你喜欢
![[C language _ study _ exam _ review lesson 3] overview of ASCII code and C language](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[C language _ study _ exam _ review lesson 3] overview of ASCII code and C language

pollFirst(),pollLast(),peekFirst(),peekLast()

flex布局 (实战小米官网)

1344. 时钟指针的夹角

Restful

软件测试功能测试全套常见面试题【功能测试-零基础】必备4-1

js call和apply

【ACL2020】一种新颖的成分句法树序列化方法

CUDA programming-02: first knowledge of CUDA Programming

npm install报错 强制安装
随机推荐
罗克韦尔AB PLC 通过RSLinx Classic与PLC建立通信的具体方法步骤
The second day of learning C language
基于ArkUI eTS开发的坚果食谱(NutRecipes
ArkUI框架中的两个小技巧
[C language - zero foundation lesson 10] adventure of array Kingdom
The execution sequence of async/await, macro tasks and micro tasks
IDL MODIS generate lookup table
8 kinds of visual transformer finishing (Part 1)
【每日算法Day 96】腾讯面试题:合并两个有序数组
BOM的常用操作和有关获取页面/窗口高度、宽度及滚动的兼容性写法
How to optimize the deep learning model to improve the reasoning speed
ctfshow 终极考核
[leetcode -- the first day of introduction to programming ability] basic data type [statistics of odd numbers within the range / average wage after removing the minimum wage and maximum wage)
D3.v3.js data visualization -- pictures and tips of force oriented diagram
Nut joke based on arkui ETS
[C language - zero foundation lesson 9] love and hate in functions
CUDA programming-01: build CUDA Programming Environment
C language exercises
2068. 检查两个字符串是否几乎相等
Function anti chattering throttling