Metraipolis › archive › dc_b23decead762

Silent Failures Beyond the 32-Bit Index Range: A Differential Characterization of Large-Tensor Matrix Multiplication in PyTorch's MPS Backend — arXiv:2609.22991

Source
arXiv (en)
Original
https://arxiv.org/abs/2609.22991
License (as archived)
CC0-1.0
Archived
2026-10-09T06:53:00.684Z
SHA-256 of the archived text
54e0fa8347de52772726790d4e2edc1bb3f4cb3c02286db35cd1d9e0a227d0df
Stable URL of this page
https://metraipolis.com/documento/dc_b23decead762

How to cite

Silent Failures Beyond the 32-Bit Index Range: A Differential Characterization of Large-Tensor Matrix Multiplication in PyTorch's MPS Backend — arXiv:2609.22991 — arXiv (en), https://arxiv.org/abs/2609.22991 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_b23decead762 (Metraipolis archive dc_b23decead762, sha256 54e0fa8347de52772726790d4e2edc1bb3f4cb3c02286db35cd1d9e0a227d0df)
BibTeX
@misc{dcb23decead762,
  title = {Silent Failures Beyond the 32-Bit Index Range: A Differential Characterization of Large-Tensor Matrix Multiplication in PyTorch's MPS Backend — arXiv:2609.22991},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2609.22991},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_b23decead762; sha256 54e0fa8347de52772726790d4e2edc1bb3f4cb3c02286db35cd1d9e0a227d0df},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.22991. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Apple Silicon machines with large unified memory make it possible to hold large tensors on a desktop GPU. However, we found that PyTorch's Metal Performance Shaders (MPS) backend silently returns wrong results for batched matrix multiplication with more than $2^{32}$ elements. torch bmm, including its wrappers matmul and eager attention, returns relative errors above 1 without an exception or a warning in every PyTorch release tested (2.4.1 to 2.14.0). We sweep bmm over dtypes, memory layouts, shapes and batch sizes around $2^{31}$ and $2^{32}$ elements, and judge every result against a float64 computation on the CPU. Three rules account for every outcome on 2.14.0. When the output exceeds $2^{32}$ elements and an operand is a transposed view, the entire output is wrong and equals a computation that ignores that operand's strides. Otherwise, a view with at least $2^{31}$ elements raises an exception, and a contiguous input above $2^{32}$ elements makes exactly the batches beyond that point wrong, equal to a computation whose index wraps at $2^{32}$. A slightly larger problem can thus turn an explicit error into a silent failure. The rules extend to the backward pass, where a correct forward pass can return silently wrong gradients. A second machine with another chip, under two macOS versions, reproduces all 6156 results, including the wrong values, and the same sweeps on an NVIDIA A100 are correct in all 2530 runs. In a public sentiment classifier, one oversized batch corrupts a third of the outputs, which collapse onto one class. All findings come from observable behavior, without access to the backend's closed-source kernels; we release the harness, raw results and a guard that stops any MPS operation touching $2^{32}$ or more elements at jniimi/mps-silent-failures ( this https URL ).

Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-09-22 in cs.DC).
Categorie arXiv: Distributed, Parallel, and Cluster Computing (cs.DC) ; Machine Learning (cs.LG).
Pagina del lavoro: https://arxiv.org/abs/2609.22991 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-09T06:50:13.524Z dalla pagina https://arxiv.org/catchup/cs.DC/2026-09-22?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).