Closed swan2818 closed 3 months ago
Hi @swan2818, thanks for reporting this issue. The loss of accuracy seems to come mainly for the use of not-precise-enough numerical constants with fp64
data types (In my tests accuracy of warp svd with fp32
is in the same ballpark as numpy and torch). We'll push a fix shortly
Fix has been merged
Bug Description
warp showed the largest error in the following example:
The result is given as:
The error in matrix decomposition using Warp is 100 times ~ 100,000 times larger than the one in Numpy, Taichi and Pytorch.
Singular value decomposition in Warp refers to the numerical method described in "Computing the Singular Value Decomposition of 3x3 matrices with minimal branching and elementary floating point operations", and especially the algorithm of Fast 3x3 SVD by Ericjang. (https://github.com/ericjang/svd3)
Recently, There was an issue reported about the incorrect Givens rotation in the special case. A manual that can make this algorithm more robust is also suggested. (https://github.com/ericjang/svd3/issues/10)
Using numerically unstable matrix decomposition could ruin the results of physical simulation. I think this problem is fundamental in all kinds of physical simulations since most of them use matrix decomposition and accumulated error could ruin the results.
System Information
No response