Index
collective operations in nccl¶
this is a collection of the main collective operations in nccl that i used for practice.
gather.py- each gpu has its own tensor
- all tensors are collected (concatenated) onto a single gpu (root)
- other gpus do not receive the full result
all_gather.py- here, instead of a single gpu having all the data copy, all the gpus have all the copies of each other.reduce.py- all gpus have some tensors
- a reduce op (sum, mean etc) is applied element wise
- result is stored on one GPU (root)
all_reduce.py- here, all the gpus have the reduced copyscatter.py- one gpu has a large tensor split into N chunks
- each gpu receives one chunk
- kinda opposite to gather
reduce_scatter.py- all gpus start with full tensors
- a reduce op is applied across gpus
- the result is split, and each gpu gets only its chunk
- same as reduce + scatter