Commit d9ef101
[PP] Optimize memory usage by releasing output memory earlier (pytorch#153383)
Considering `output_chunks` is only used for last stage, we should not keep the outputs of each stage in memory; this will allow memory to be freed earlier.
Pull Request resolved: pytorch#153383
Approved by: https://github.com/Skylion007, https://github.com/kwen25011 parent f1de3f9 commit d9ef101
File tree
2 files changed
+62
-5
lines changed- test/distributed/pipelining
- torch/distributed/pipelining
2 files changed
+62
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
323 | 381 | | |
324 | 382 | | |
325 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
| 436 | + | |
440 | 437 | | |
441 | 438 | | |
442 | 439 | | |
| |||
719 | 716 | | |
720 | 717 | | |
721 | 718 | | |
722 | | - | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
723 | 722 | | |
724 | 723 | | |
725 | 724 | | |
| |||
0 commit comments