Torch SVD computation on mps has a large error compared to cpu

gauss: <p>I’ve tested running singular value decomposition on a large random matrix on both mps and cpu. I used the frobenius norm of the original matrix subtracted from the matrix assembled from the SVD components  and discovered that when the device is mps the norm is much much larger than the norm for cpu</p>
<p>CPU<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/6/063d5af67955fc43af529f42608fdd7a29d04aa1.png" data-download-href="https://discuss.pytorch.org/uploads/default/063d5af67955fc43af529f42608fdd7a29d04aa1" title="Screen Shot 2022-05-22 at 11.40.14 PM"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/0/6/063d5af67955fc43af529f42608fdd7a29d04aa1_2_690x463.png" alt="Screen Shot 2022-05-22 at 11.40.14 PM" data-base62-sha1="TcjInxJ4OlTWYZNguOH5NPtM41" width="690" height="463" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/0/6/063d5af67955fc43af529f42608fdd7a29d04aa1_2_690x463.png, https://discuss.pytorch.org/uploads/default/optimized/3X/0/6/063d5af67955fc43af529f42608fdd7a29d04aa1_2_1035x694.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/0/6/063d5af67955fc43af529f42608fdd7a29d04aa1_2_1380x926.png 2x" data-dominant-color="F4F3F3"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screen Shot 2022-05-22 at 11.40.14 PM</span><span class="informations">2134×1434 341 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>MPS<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/0/9/09d2f9dda315173667d0ed0841b4f72f491ac149.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/09d2f9dda315173667d0ed0841b4f72f491ac149" title="Screen Shot 2022-05-22 at 11.39.35 PM"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/0/9/09d2f9dda315173667d0ed0841b4f72f491ac149_2_671x500.jpeg" alt="Screen Shot 2022-05-22 at 11.39.35 PM" data-base62-sha1="1oUjiG9Zfy7SDeUHK58NtA4fpk5" width="671" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/0/9/09d2f9dda315173667d0ed0841b4f72f491ac149_2_671x500.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/0/9/09d2f9dda315173667d0ed0841b4f72f491ac149_2_1006x750.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/0/9/09d2f9dda315173667d0ed0841b4f72f491ac149_2_1342x1000.jpeg 2x" data-dominant-color="F1EEEE"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screen Shot 2022-05-22 at 11.39.35 PM</span><span class="informations">1920×1429 174 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

albanD: <p>Hi,</p>
<p>Thanks for the report. I’m not sure why this warning is not an error right now…<br>
Could you open an issue on github with these code samples please?</p>

gauss: <p><a class="mention" href="/u/alband">@albanD</a> opened an issue here: <a href="https://github.com/pytorch/pytorch/issues/78099" class="inline-onebox" rel="noopener nofollow ugc">Torch SVD computation on mps has a large error compared to cpu · Issue #78099 · pytorch/pytorch · GitHub</a></p>