fflas-ffpack
fflas-ffpack copied to clipboard
Specialize fgemm checkers for large precision to check modulo some random primes
The fgemm checkers are designed to check FFLAS matrix multiplication using the Freivalds technique : to check C=AB, one can choose a vector v at random and check Cv = A (Bv).
This is of course appropriate when the Freivalds certification is computed with an exact calculation.
However, using ZRing
This issue appeared within the rns-double code that uses fgemm over ZRing
I do not understand. The checkers are generic they call fgemm or fgemv to perform the product, If there is a problem it comes from the fgemm or the fgemv ...
I know that the checkers are generic but they are designed to work only for exact computation. Then if you perform a matrix product over double floating points, the product can be correct (e.g. less than 2^53) but applying Freivalds certificate may lead to overflow the mantissa and introduce roundoff errors. This causes the checkers to fail, this appeared with RNS code that uses this kind of matrix product.
OK, this is not a bug, checkers indeed are made for correctness checking. For this, and also, say, for arbitrary precision checking, an idea would be to design specific checkers that perform the check modulo a random prime. I therefore relabelled to "enhancement"