-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: added doc for reduce example (#56)
created readme file with steps to run the reduce example Co-authored-by: Rares Gaia <[email protected]>
- Loading branch information
1 parent
2de75bb
commit 9783c65
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Reduce | ||
|
||
This file provides an example of collective communication using reduce across single and multiple worlds. This exaplme will perform reduce 100 times on each rank from each world using a destination rank from a range from 0 to 2. | ||
|
||
`--worldinfo` argument is composed by the world index(1, 2) and the rank in that world (0, 1 or 2). | ||
|
||
## Running the Script in a Single World | ||
|
||
The single world example can be executed by opening 3 separate terminal windows to have 3 different processes and running the following commands in each terminal window: | ||
|
||
```bash | ||
# on terminal window 1 - will initialize 2 worlds (world1 and world2) with rank 0 | ||
python m8d.py --backend nccl --worldinfo 1,0 --worldinfo 2,0 | ||
# on terminal window 2 - will initialize world1 with rank 1 | ||
python m8d.py --backend nccl --worldinfo 1,1 | ||
# on terminal window 3 - will initialize world1 with rank 2 | ||
python m8d.py --backend nccl --worldinfo 1,2 | ||
``` | ||
|
||
## Running the Script in Multiple Worlds | ||
|
||
The multiple world examplecan be executed by opening 5 separate terminal windows to have 5 different processes and running the following commands in each terminal window: | ||
|
||
```bash | ||
# on terminal window 1 - will initialize 2 worlds (world1 and world2) with rank 0 | ||
python m8d.py --backend nccl --worldinfo 1,0 --worldinfo 2,0 | ||
# on terminal window 2 - will initialize world1 with rank 1 | ||
python m8d.py --backend nccl --worldinfo 1,1 | ||
# on terminal window 3 - will initialize world1 with rank 2 | ||
python m8d.py --backend nccl --worldinfo 1,2 | ||
# on terminal window 4 - will initialize world2 with rank 1 | ||
python m8d.py --backend nccl --worldinfo 2,1 | ||
# on terminal window 5 - will initialize world2 with rank 2 | ||
python m8d.py --backend nccl --worldinfo 2,2 | ||
``` | ||
|
||
To run processes on different hosts, `--addr` arugment can be used witn host's IP address. (`python m8d.py --backend nccl --worldinfo 1,0 --worldinfo 2,0 --addr 10.20.1.50`) |