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
ValueError: On entry to SGESDD parameter number 12 had an illegal value #5401
Comments
(i) What is your LAPACK version? If older than 3.2.2, GESDD work space
query was known to have bugs.
(ii) What is the size of the matrix?
|
Hello, LAPACK version is 3.4.2 and the size of the matrix was 9537x46080. Now I tried using matrices with other dimensions and I'm getting the same error when I try with matrices of sizes 9537x20000, 9537x10000, 9537x9538, 9537x9537. If I use a matrix of size 9537x9536 it's working fine. |
LAPACK uses 32-bit integers and will start failing if the work space size becomes larger than INT_MAX. You can maybe check this via
n=9537 is however not yet so big it should be problematic, at least with lapack 3.5.0, but it is not very far from the limit either. Maybe it is different on 3.4.2? |
OK, I ran the code you wrote and got the same error: python test.py with n = 9536 it works. What do you suggest? Should I just try upgrading lapack, or is there something else I can try? Thank you! |
Just to update, I tried your code again with n=9538, n=9600 and with n=10000 and it worked each time. I also tried running with n=20000 and n=40000 and it seems to be working both times (I didn't wait until it finished). n=9537 still resulting in error (). Is there something special about 9537 or lwork being 272929856? |
These numbers come directly from LAPACK. What I think is happening is the following: LAPACK sgesdd lwork query returns the optimal lwork as a single-precision float value. However, the next possible float32 number bigger than 272929856 is actually 272929888. If the value of lwork LAPACK computed falls between these two, it gets rounded down when returned in a float32 variable and may end up being too small. So I think:
In the meantime, you can work around it by using the low-level |
Thank you very much for your replies! I will try to use your workaround. |
LAPACK bug report: http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4836 |
Appears to be fixed in the next lapack version http://www.netlib.org/lapack/Errata/index2.html#_strong_span_class_green_bug120_span_strong_workspace_query_return_too_small_value_for_xgesdd |
sgesdd by using nextfloat. Now with comments and test so this commit supersedes ad59ceb See http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4587&p=11036&hilit=sgesdd#p11036 and scipy/scipy#5401 Fixes #15784
sgesdd by using nextfloat. Now with comments and test so this commit supersedes ad59ceb See http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4587&p=11036&hilit=sgesdd#p11036 and scipy/scipy#5401 Fixes #15784
sgesdd by using nextfloat. Now with comments and test so this commit supersedes ad59ceb See http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4587&p=11036&hilit=sgesdd#p11036 and scipy/scipy#5401 Fixes #15784
sgesdd by using nextfloat. Now with comments and test so this commit supersedes ad59ceb See http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4587&p=11036&hilit=sgesdd#p11036 and scipy/scipy#5401 Fixes #15784 (cherry picked from commit b6988df) ref #15824
sgesdd by using nextfloat. Now with comments and test so this commit supersedes ad59ceb6398114b6ee49756ed14f493d9d28485c See http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4587&p=11036&hilit=sgesdd#p11036 and scipy/scipy#5401 Fixes #15784
Hello,
I'm getting a ValueError from scipy/linalg/decomp_svd.py, line 104 when tring to run sklearn's pca.fit() function.
Traceback:
File "train.py", line 269, in
pca.fit(X)
File "/homes/pp305/.local/lib/python2.7/site-packages/sklearn/decomposition/pca.py", line 221, in fit
self._fit(X)
File "/homes/pp305/.local/lib/python2.7/site-packages/sklearn/decomposition/pca.py", line 271, in _fit
U, S, V = linalg.svd(X, full_matrices=False)
File "/homes/pp305/.local/lib/python2.7/site-packages/scipy/linalg/decomp_svd.py", line 104, in svd
full_matrices=full_matrices, overwrite_a=overwrite_a)
ValueError: On entry to SGESDD parameter number 12 had an illegal value
Versions I'm using:
Python 2.7.5
scipy 0.16.0
sklearn 0.16.1
numpy 1.9.2
print scipy.config.show()
atlas_3_10_blas_threads_info:
libraries = ['tatlas']
library_dirs = ['/usr/lib64/atlas']
define_macros = [('HAVE_CBLAS', None), ('ATLAS_INFO', '""3.10.1""')]
language = c
include_dirs = ['/usr/include']
lapack_opt_info:
libraries = ['tatlas', 'tatlas', 'tatlas']
library_dirs = ['/usr/lib64/atlas']
define_macros = [('ATLAS_INFO', '""3.10.1""')]
language = f77
include_dirs = ['/usr/include']
blas_opt_info:
libraries = ['tatlas']
library_dirs = ['/usr/lib64/atlas']
define_macros = [('HAVE_CBLAS', None), ('ATLAS_INFO', '""3.10.1""')]
language = c
include_dirs = ['/usr/include']
openblas_info:
NOT AVAILABLE
openblas_lapack_info:
NOT AVAILABLE
atlas_3_10_threads_info:
libraries = ['tatlas', 'tatlas', 'tatlas']
library_dirs = ['/usr/lib64/atlas']
define_macros = [('ATLAS_INFO', '""3.10.1""')]
language = f77
include_dirs = ['/usr/include']
lapack_mkl_info:
NOT AVAILABLE
blas_mkl_info:
NOT AVAILABLE
mkl_info:
NOT AVAILABLE
None
I found an issue like this here already:
#3895
Could you let me know how I can go about getting this to work?
Thank you!
The text was updated successfully, but these errors were encountered: