Buckets:
26.4 GB
104,200 files
Updated 9 months ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| DDP-script-torchrun.py | 7.33 kB xet | 7e30a318 | |
| DDP-script.py | 7.18 kB xet | 52c27b0d | |
| README.md | 1.23 kB xet | 11cd24e7 | |
| code-part1.ipynb | 33 kB xet | f87a779c | |
| code-part2.ipynb | 13.3 kB xet | 6682ffae | |
| exercise-solutions.ipynb | 5.3 kB xet | a2be8eb1 |
Appendix A: Introduction to PyTorch
Main Chapter Code
- code-part1.ipynb contains all the section A.1 to A.8 code as it appears in the chapter
- code-part2.ipynb contains all the section A.9 GPU code as it appears in the chapter
- DDP-script.py contains the script to demonstrate multi-GPU usage (note that Jupyter Notebooks only support single GPUs, so this is a script, not a notebook). You can run it as
python DDP-script.py. If your machine has more than 2 GPUs, run it asCUDA_VISIBLE_DEVIVES=0,1 python DDP-script.py. - exercise-solutions.ipynb contains the exercise solutions for this chapter
Optional Code
- DDP-script-torchrun.py is an optional version of the
DDP-script.pyscript that runs via the PyTorchtorchruncommand instead of spawning and managing multiple processes ourselves viamultiprocessing.spawn. Thetorchruncommand has the advantage of automatically handling distributed initialization, including multi-node coordination, which slightly simplifies the setup process. You can use this script viatorchrun --nproc_per_node=2 DDP-script-torchrun.py
- Total size
- 26.4 GB
- Files
- 104,200
- Last updated
- Mar 12
- Pre-warmed CDN
- US EU US EU