PyTorch fixes MPS reduction failures with 2.15
Silent tensor reduction failures in PyTorch 2.13 caused silent data loss—now fixed in 2.15
According to the article, PyTorch's MPS backend had inconsistent reduction behavior: in torch 2.13, some reductions like max, min, and sum failed loudly, while others like argmax, argmin, any, and all silently returned wrong values. Then, in the 2.14 release window, reductions were moved from MPS Graph to metal kernels, which made all of them fail silently — something the author calls undesirable. The fix in PR #194082 makes large reductions fail loudly with a clear error: "tensors requiring 64-bit indexing are not supported on MPS." The post-fix output shown in 2.15.0a0+gitfd3c978 lists loud failures for max, min, argmax, argmin, sum
- PyTorch 2.13-2.14 silently failed on tensor reductions (sum, max/min) for tensors >INT_MAX, risking data corruption
- PyTorch 2.15 now fails *loudly* with clear errors for large tensors (e.g., `32GB+` buffers), preventing silent failures
- PR #194082 fixes the underlying issue by enforcing 64-bit indexing support in Metal kernels
Why It Matters
Prevents silent data corruption in ML workloads using PyTorch’s MPS backend on Apple Silicon