Skip to content

numpy.linalg.linalg.LinAlgError: SVD did not converge during rmgpy.reaction.Reaction.reverse_arrhenius_rate #1833

@rwest

Description

@rwest

Bug Description

During calls to rmgpy.reaction.Reaction.reverse_arrhenius_rate I am now quite often getting numpy.linalg.linalg.LinAlgError: SVD did not converge in Linear Least Squares errors, that cause RMG to immediately crash.

One context was @ajuluc and I working on a tool to check collision limit violations.
Another was our chemkin mechanism importer script.

It might be that there are NAN values creeping in, but I don't see why that would happen in these contexts, and for the importer script it never used to be a problem, and it wasn't a problem when @ChrisBNEU ran the same input on his ubuntu machine on Wednesday, IIRC. So I suspect it might be an OS or compiler or hardware specific problem.
Based on some discussion at numpy/numpy#12941 etc.

Partly just sharing this here as a place for others to comment if they run into similar issues.

Here's some stack trace:

  File "rmgpy/reaction.py", line 791, in rmgpy.reaction.Reaction.generate_reverse_rate_coefficient
  File "rmgpy/reaction.py", line 872, in rmgpy.reaction.Reaction.generate_reverse_rate_coefficient
  File "rmgpy/reaction.py", line 854, in rmgpy.reaction.Reaction.generate_reverse_rate_coefficient
  File "rmgpy/reaction.py", line 829, in rmgpy.reaction.Reaction.generate_reverse_rate_coefficient
  File "rmgpy/reaction.py", line 788, in rmgpy.reaction.Reaction.reverse_arrhenius_rate
  File "rmgpy/kinetics/arrhenius.pyx", line 173, in rmgpy.kinetics.arrhenius.Arrhenius.fit_to_data
  File "/Users/rwest/anaconda/envs/rmg3/lib/python3.7/site-packages/numpy/linalg/linalg.py", line 2156, in lstsq
    x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
  File "/Users/rwest/anaconda/envs/rmg3/lib/python3.7/site-packages/numpy/linalg/linalg.py", line 101, in _raise_linalgerror_lstsq
    raise LinAlgError("SVD did not converge in Linear Least Squares")
numpy.linalg.linalg.LinAlgError: SVD did not converge in Linear Least Squares

And here's my numpy config

$ python
Python 3.7.4 (default, Aug 13 2019, 15:17:50) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.show_config()
mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/Users/rwest/anaconda/envs/rmg3/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/Users/rwest/anaconda/envs/rmg3/include']
blas_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/Users/rwest/anaconda/envs/rmg3/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/Users/rwest/anaconda/envs/rmg3/include']
blas_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/Users/rwest/anaconda/envs/rmg3/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/Users/rwest/anaconda/envs/rmg3/include']
lapack_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/Users/rwest/anaconda/envs/rmg3/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/Users/rwest/anaconda/envs/rmg3/include']
lapack_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/Users/rwest/anaconda/envs/rmg3/lib']
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
    include_dirs = ['/Users/rwest/anaconda/envs/rmg3/include']

Installation Information

Describe your installation method and system information.

  • OS: Mac OS 10.14.6
  • Installation method: from source in Anaconda environment
  • RMG version information:
    • RMG-Py: 2.4.1-866-g66b751b4c (on importer branch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions