question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Schur decomposition solver error" on aarch64

See original GitHub issue

Describe the bug

I’m using PmdArima, which uses statsmodels underneath the hood.

However, I’m noticing a difference between running the same code on x64 vs aarch64 architecture

Version of statsmodel: 0.13.1 Version of pmdarima: 1.8.4

Code Sample, a copy-pastable example if possible

import pmdarima as pm
import numpy as np

model = pm.arima.ARIMA(order=(1, 0, 0), seasonal_order=(2, 1, 0, 7))
data = np.array([ 0.0, 0.0, 0.0, 0.0, 0.0, 9.85040379
, 9.54116535, 9.32663155, 9.2234745,  9.565238, 8.71925259, 9.76801205
, 9.69493675, 9.79889011, 9.49398804, 8.66767883, 9.33772945, 8.71925259
, 9.15603161, 8.45924664, 8.7293129,  9.48911667, 10.19035053, 9.22128391
, 9.01288033, 8.12544632, 9.57633972, 8.85050488, 9.03771114, 9.09411049
, 8.72431564, 8.64025211, 8.89891052, 9.55954933, 8.9926033,  8.79051018
, 9.06884098, 8.56023407, 8.63816166, 9.47813416, 10.32632923, 9.49745369], dtype=float)
model.fit(data)

Excepton on aarch64:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/env/lib/python3.9/site-packages/pmdarima/arima/arima.py", line 597, in fit
    self._fit(y, X, **fit_args)
  File "/env/lib/python3.9/site-packages/pmdarima/arima/arima.py", line 520, in _fit
    fit, self.arima_res_ = _fit_wrapper()
  File "/env/lib/python3.9/site-packages/pmdarima/arima/arima.py", line 508, in _fit_wrapper
    return arima, arima.fit(start_params=start_params,
  File "/env/lib/python3.9/site-packages/statsmodels/tsa/statespace/mlemodel.py", line 704, in fit
    mlefit = super(MLEModel, self).fit(start_params, method=method,
  File "/env/lib/python3.9/site-packages/statsmodels/base/model.py", line 563, in fit
    xopt, retvals, optim_settings = optimizer._fit(f, score, start_params,
  File "/env/lib/python3.9/site-packages/statsmodels/base/optimizer.py", line 241, in _fit
    xopt, retvals = func(objective, gradient, start_params, fargs, kwargs,
  File "/env/lib/python3.9/site-packages/statsmodels/base/optimizer.py", line 651, in _fit_lbfgs
    retvals = optimize.fmin_l_bfgs_b(func, start_params, maxiter=maxiter,
  File "/env/lib/python3.9/site-packages/scipy/optimize/lbfgsb.py", line 197, in fmin_l_bfgs_b
    res = _minimize_lbfgsb(fun, x0, args=args, jac=jac, bounds=bounds,
  File "/env/lib/python3.9/site-packages/scipy/optimize/lbfgsb.py", line 360, in _minimize_lbfgsb
    f, g = func_and_grad(x)
  File "/env/lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py", line 260, in fun_and_grad
    self._update_fun()
  File "/env/lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py", line 226, in _update_fun
    self._update_fun_impl()
  File "/env/lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py", line 133, in update_fun
    self.f = fun_wrapped(self.x)
  File "/env/lib/python3.9/site-packages/scipy/optimize/_differentiable_functions.py", line 130, in fun_wrapped
    return fun(x, *args)
  File "/env/lib/python3.9/site-packages/statsmodels/base/model.py", line 531, in f
    return -self.loglike(params, *args) / nobs
  File "/env/lib/python3.9/site-packages/statsmodels/tsa/statespace/mlemodel.py", line 939, in loglike
    loglike = self.ssm.loglike(complex_step=complex_step, **kwargs)
  File "/env/lib/python3.9/site-packages/statsmodels/tsa/statespace/kalman_filter.py", line 983, in loglike
    kfilter = self._filter(**kwargs)
  File "/env/lib/python3.9/site-packages/statsmodels/tsa/statespace/kalman_filter.py", line 903, in _filter
    self._initialize_state(prefix=prefix, complex_step=complex_step)
  File "/env/lib/python3.9/site-packages/statsmodels/tsa/statespace/representation.py", line 983, in _initialize_state
    self._statespaces[prefix].initialize(self.initialization,
  File "statsmodels/tsa/statespace/_representation.pyx", line 1373, in statsmodels.tsa.statespace._representation.dStatespace.initialize
  File "statsmodels/tsa/statespace/_representation.pyx", line 1362, in statsmodels.tsa.statespace._representation.dStatespace.initialize
  File "statsmodels/tsa/statespace/_initialization.pyx", line 288, in statsmodels.tsa.statespace._initialization.dInitialization.initialize
  File "statsmodels/tsa/statespace/_initialization.pyx", line 406, in statsmodels.tsa.statespace._initialization.dInitialization.initialize_stationary_stationary_cov
  File "statsmodels/tsa/statespace/_tools.pyx", line 1284, in statsmodels.tsa.statespace._tools._dsolve_discrete_lyapunov
numpy.linalg.LinAlgError: Schur decomposition solver error.

If the issue has not been resolved, please file it in the issue tracker.

Expected Output

No error. Intel version doesn’t cause the issue

Output of import statsmodels.api as sm; sm.show_versions()

import statsmodels.api as sm; sm.show_versions()

INSTALLED VERSIONS

Python: 3.9.7.final.0 OS: Linux 4.14.232-177.418.amzn2.aarch64 #1 SMP Tue Jun 15 20:58:11 UTC 2021 aarch64 byteorder: little LC_ALL: None LANG: C.UTF-8

statsmodels

Installed: 0.13.1 (/env/lib/python3.9/site-packages/statsmodels)

Required Dependencies

cython: Not installed numpy: 1.22.0 (/env/lib/python3.9/site-packages/numpy) scipy: 1.6.1 (/env/lib/python3.9/site-packages/scipy) pandas: 1.3.5 (/env/lib/python3.9/site-packages/pandas) dateutil: 2.8.2 (/env/lib/python3.9/site-packages/dateutil) patsy: 0.5.2 (/env/lib/python3.9/site-packages/patsy)

Optional Dependencies

matplotlib: Not installed cvxopt: Not installed joblib: 1.1.0 (/env/lib/python3.9/site-packages/joblib)

Developer Tools

IPython: Not installed jinja2: Not installed sphinx: Not installed pygments: Not installed pytest: Not installed virtualenv: Not installed

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
snadampalcommented, Jan 25, 2022

scipy version 1.7.2 is the first version with this bug fixed. Looks like very few fixes went into v1.7.2, but the OpenBLAS version was upgraded from v0.3.9 to v0.3.17. I believe it is the newer openBLAS version fixing this particular issue. There have been multiple precision/data correctness fixes went into OpenBLAS from v0.3.9 to v0.3.17.

0reactions
bashtagecommented, Jan 24, 2022

This is good to hear. Could be OpenBLAS, or could be a change in the optimizer avoids a problematic value. Closing since sounds like no issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Notebook Error: Schur decomposition solver error
Jupyter Notebook Error: Schur decomposition solver error ... I am getting an error while using SARIMA Model for Energy Consumption Project.
Read more >
Diff - platform/external/ceres-solver - Google Git
Update ceres to the latest version in g3 Please pay special attention to the changes in Android.mk. They are the only real changes...
Read more >
FreeFEM-documentation.pdf
FreeFEM is a partial differential equation solver for non-linear multi-physics systems in 1D, 2D, 3D and 3D border.
Read more >
MPLAPACK version 2.0.1 user manual - arXiv
Numerical linear algebra aims to solve mathematical problems, ... the matrix of Schur vectors Z. This gives the Schur factorization A = ZTZt ......
Read more >
ChangeLog - Eigen - TuxFamily
Issue 2011: Remove error counting in OpenMP parallel section in ... Issue #1557: Fix RealSchur and EigenSolver for matrices with only zeros ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found