Files
Anshul Sinha 452abac61c [dtensor][partial] fixes unnecessary redistributions when subtracting two partial tensors (#170040)
**Summary:** Currently, whenever we subtract two partial dtensors, we redistribute since linearity is -1 for aten.sub.tensor. However, this is an unnecessary redistribution that can be avoided in similar ways to its add counterpart. I moved the op to linear_ops and ensured subtracting a scalar from a partial dtensor continues to redistribute.

**Test Cases:**
1. pytest test/distributed/tensor/test_pointwise_ops.py -k test_add_sub_scalar_norm_partial
2. pytest test/distributed/tensor/test_pointwise_ops.py -k test_add_sub_scalar_partial

Pull Request resolved: https://github.com/pytorch/pytorch/pull/170040
Approved by: https://github.com/wconstab
ghstack dependencies: #170030, #170035
2025-12-31 23:52:03 +00:00
..
2025-11-28 08:00:09 +00:00
2025-11-28 08:00:09 +00:00