-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DGESDD with nan exits with: On entry to DLASCL parameter number 4 had an illegal value #469
Comments
Which platform and compiler ? I doubt that the code in question changed between recent versions (or in almost a decade), perhaps you are at the mercy of undefined or implementation-defined behaviour regarding the comparisons of the (NaN) matrix norm that precede the DLASCL call at https://github.com/Reference-LAPACK/lapack/blob/master/SRC/dgesdd.f#L603. |
it happens on ubuntu 20.04 (gcc 9.3.0) here is a possible patch, as a nan value is always different than itself :
|
FWIW there is an auxiliary DISNAN() function in LAPACK (which also uses the self-inequality test under the hood). (And offhand I am not sure if doing an early return, reporting a non-convergence error here is the right thing to do, or if we should just enclose the subsequent IF block that wants to do the scaling in an "IF NOT DISNAN(ANRM)"..."ENDIF") |
yes, i should use the isnan fonctions |
Reopening for discussion as this change is causing problems in NumPy numpy/numpy#18914 , suggesting that there may be other high-profile codes that rely on the "time honored" behaviour. The documentations for xGESDD do not specifically mention |
@martin-frbg, this issue wasn't actually reopened. Maybe it's better to open a new issue for this regression? |
This is still milestoned for 3.9.1 - I think it'd be cleaner to open a new one, and would be happy to do it if that's welcome. |
in version 3.9.0 and master, dgesdd with a nan value calls exit(0) instead of returning an error code on a 3x3 diagonal matrix plus a nan value and with jobz=N
(xref http://www.netlib.org/lapack/explore-html/d1/d7e/group__double_g_esing_gad8e0f1c83a78d3d4858eaaa88a1c5ab1.html)
it seems to happen with gcc>=9 (confirmed with 9.3 and 10.2, but not 7.5)
full C code to reproduce:
possible xrefs:
statsmodels/statsmodels#3596
statsmodels/statsmodels#5396
https://pystatsmodels.narkive.com/2IKxOFVo/valueerror-on-entry-to-dlascl-parameter-number-4-had-an-illegal-value
https://forge.scilab.org/index.php/p/arpack-ng/issues/641/
https://www.ljll.math.upmc.fr/pipermail/freefempp/2015-November/004288.html
The text was updated successfully, but these errors were encountered: