- Notifications
You must be signed in to change notification settings - Fork26.3k
Commitc770435
[dtensor][partial] redistributes _NormPartial to replicate for necessary pointwise_ops (#170035)
**Summary:** While linearities are correct for regular Partial tensors, they don't apply to NormPartial tensors. We fix this by redistributing for all ops necessary when the placement is NormPartial. The math showing that mul and div scalar ops don't need redistribution when the scalar value is non negative is shown below. The iterative process to arriving at this PR can be viewed in#167813.<img width="449" height="807" alt="image" src="https://github.com/user-attachments/assets/5e42d65d-d05f-43eb-9d69-9e663fb1f1eb" />**Test Cases**1. pytest test/distributed/tensor/test_pointwise_ops.py -k test_mul_div_scalar_norm_partial2. pytest test/distributed/tensor/test_pointwise_ops.py -k test_add_scalar_norm_partialPull Requestresolved:#170035Approved by:https://github.com/wconstabghstack dependencies:#1700301 parente270faa commitc770435
File tree
2 files changed
+59
-7
lines changed- test/distributed/tensor
- torch/distributed/tensor/_ops
2 files changed
+59
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
486 | 513 | | |
487 | 514 | | |
488 | 515 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
569 | 570 | | |
570 | 571 | | |
571 | 572 | | |
572 | | - | |
573 | | - | |
574 | | - | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
575 | 588 | | |
576 | 589 | | |
577 | 590 | | |
| |||
682 | 695 | | |
683 | 696 | | |
684 | 697 | | |
685 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
686 | 706 | | |
687 | 707 | | |
688 | | - | |
689 | | - | |
690 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
691 | 716 | | |
692 | 717 | | |
693 | 718 | | |
| |||
0 commit comments
Comments
(0)