← 返回事件
持续讨论AI发版0.7783+0.0038j

viable/strict/1791919581: [MPS] Fix precision loss in complex sqrt (#200736)

发生了什么

The Metal complex sqrt computed the imaginary part as sqrt((|z| - re) / 2) , which suffers catastrophic cancellation when |im| (and the real part likewise via |z| + re when re ). E.g. on MPS sqrt(1+1e-4j) returned 1+0j instead of 1+5e-5j for complex64, and chalf sqrt(0.7783+0.0038j) had a 3.4x error in the imaginary part, which made test_sqrt fail once its explicit seed was removed. Fix by adding a c10::metal::sqrt…

摘要按规则整理自下方来源原文

为什么在扩散

来源