Commit ddeb0c1
Fix patch for parameter partitioning in zero.Init() (#6388)
This PR fixes an issue addressed in #5921.
With this change, we only apply the patch for parameter partitioning to
classes that have `__init__` so that we can avoid applying the patch
multiple times.
The class that does not have `__init__` now uses its superclass's one.
So this PR also applies the patch to the root class,
`torch.nn.modules.module.Module`.
Thanks @VeryLazyBoy for the report and initial solution.
---------
Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>1 parent 9d17116 commit ddeb0c1
1 file changed
+18
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
| 265 | + | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
276 | 279 | | |
277 | 280 | | |
278 | 281 | | |
| |||
465 | 468 | | |
466 | 469 | | |
467 | 470 | | |
468 | | - | |
469 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
470 | 474 | | |
471 | 475 | | |
472 | | - | |
| 476 | + | |
| 477 | + | |
473 | 478 | | |
474 | 479 | | |
475 | 480 | | |
| |||
522 | 527 | | |
523 | 528 | | |
524 | 529 | | |
525 | | - | |
526 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
527 | 533 | | |
528 | 534 | | |
529 | | - | |
530 | | - | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
531 | 538 | | |
532 | 539 | | |
533 | 540 | | |
| |||
567 | 574 | | |
568 | 575 | | |
569 | 576 | | |
570 | | - | |
| 577 | + | |
| 578 | + | |
571 | 579 | | |
572 | 580 | | |
573 | 581 | | |
| |||
0 commit comments