Commit 8db370d
Add Acelerator API to ddp_tutorial (pytorch#3508)
## Motivation
- Refine the DDP tutorial to make it device-agnostic by using the
Accelerator API.
## Description
- Integrate the Accelerator API into the DDP tutorial to support
multiple accelerators and improve backend initialization.
- Align the implementation with [this
example](https://github.com/pytorch/examples/blob/main/distributed/ddp/example.py)
from the PyTorch examples repository.
## Checklist
<!--- Make sure to add `x` to all items in the following checklist: -->
- [ ] The issue that is being fixed is referred in the description (see
above "Fixes #ISSUE_NUMBER")
- [ ] Only one issue is addressed in this pull request
- [ ] Labels from the issue that this PR is fixing are added to this
pull request
- [ ] No unnecessary issues are included into this pull request.
CC: @gujinghui
cc @wconstab @osalpekar @H-Huang @kwen2501
Signed-off-by: jafraustro <jaime.fraustro.valdez@intel.com>
Co-authored-by: Chien-Chin Huang <fegins@gmail.com>1 parent 48fbf4f commit 8db370d
1 file changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | | - | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
219 | 226 | | |
220 | | - | |
| 227 | + | |
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
| |||
295 | 302 | | |
296 | 303 | | |
297 | 304 | | |
298 | | - | |
| 305 | + | |
299 | 306 | | |
300 | 307 | | |
301 | 308 | | |
| |||
331 | 338 | | |
332 | 339 | | |
333 | 340 | | |
334 | | - | |
335 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
336 | 345 | | |
337 | 346 | | |
338 | 347 | | |
339 | | - | |
| 348 | + | |
340 | 349 | | |
341 | 350 | | |
342 | 351 | | |
| |||
0 commit comments