scipy: BUG: Got error log like "** On entry to XXXXparameter number xxx had an illegal value" on RISCV platform
Describe your issue.
Hi I am running a pmdarima example (https://github.com/alkaline-ml/pmdarima/blob/master/examples/arima/example_auto_arima.py )on my RISCV platform , It has the calltree like below:
** On entry to DGELSD parameter number 7 had an illegal value
File "/home/example_auto_arima.py", line 13, in <module>
modl = pm.auto_arima(train, start_p=1, start_q=1, start_P=1, start_Q=1,max_p=5, max_q=5, max_P=5, max_Q=5, seasonal=True,stepwise=True, suppress_warnings=True, D=10, max_D=10,error_action='ignore')
File "/usr/local/lib/python3.10/dist-packages/pmdarima/arima/auto.py", line 547, in auto_arima
d = ndiffs(
File "/usr/local/lib/python3.10/dist-packages/pmdarima/arima/utils.py", line 189, in ndiffs
pval, dodiff = testfunc(x)
File "/usr/local/lib/python3.10/dist-packages/pmdarima/arima/stationarity.py", line 186, in should_diff
lm = LinearRegression().fit(t, x)
File "/usr/local/lib/python3.10/dist-packages/sklearn/base.py", line 1474, in wrapper
return fit_method(estimator, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/sklearn/linear_model/_base.py", line 653, in fit
self.coef_, _, self.rank_, self.singular_ = linalg.lstsq(X, y)
File "/usr/local/lib/python3.10/dist-packages/scipy/linalg/_basic.py", line 1212, in lstsq
lwork, iwork = _compute_lwork(lapack_lwork, m, n, nrhs, cond)
File "/usr/local/lib/python3.10/dist-packages/scipy/linalg/lapack.py", line 1004, in _compute_lwork
raise ValueError("Internal work array size computation failed: -7
But this example run well on x86_linux platfrom with the same packeage version. When i debug into the script, I find at last it call lapack.py _compute_lwork function and enter below code, and got -7 ret value.
----
dtype = getattr(routine, 'dtype', None)
int_dtype = getattr(routine, 'int_dtype', None)
ret = routine(*args, **kwargs)
if ret[-1] != 0:
raise ValueError("Internal work array size computation failed: "
"%d" % (ret[-1],))
-----
Here i print out the value of *args, they are: 90 1 1 2.220446049250313e-16
Looks like it call the _flapack.cpython-310-riscv64-linux-gnu.so list functions like DGELSD ,then got error, With the same action it works well in x86 linux platform.
Can anyone indicate how can i continue debug such “On enrty to xxxxx parameter number xx had an illegal value” error?
Reproducing Code Example
Find a RSICV plaform and build a riscv64/ubuntu22.04 docker image. Build below list reuqirments:
pip3 install Cython==3.0.9
pip3 install et-xmlfile==1.1.0
pip3 install joblib==1.3.2
pip3 install numpy==1.26.4
pip3 install openpyxl==3.1.2
pip3 install packaging==24.0
pip3 install patsy==0.5.6
pip3 install pefile==2023.2.7
pip3 install pyinstaller==6.5.0
pip3 install pyinstaller-hooks-contrib==2024.3
pip3 install python-dateutil==2.9.0.post0
pip3 install pytz==2024.1
pip3 install scipy==1.12.0
pip3 install six==1.16.0
pip3 install some-package==0.1
pip3 install threadpoolctl==3.4.0
pip3 install tzdata==2024.1
pip3 install urllib3==2.2.1
pip3 install xgboost==2.0.3
pip3 install pandas==2.2.1
pip3 install scikit-learn==1.4.1.post1
pip3 install statsmodels==0.14.1
pip3 install lightgbm==4.3.0
pip3 install pmdarima==2.0.4
Then run the pmdarima example in https://github.com/alkaline-ml/pmdarima/blob/master/examples/arima/example_auto_arima.py
Error message
File "/home/example_auto_arima.py", line 13, in <module>
modl = pm.auto_arima(train, start_p=1, start_q=1, start_P=1, start_Q=1,max_p=5, max_q=5, max_P=5, max_Q=5, seasonal=True,stepwise=True, suppress_warnings=True, D=10, max_D=10,error_action='ignore')
File "/usr/local/lib/python3.10/dist-packages/pmdarima/arima/auto.py", line 547, in auto_arima
d = ndiffs(
File "/usr/local/lib/python3.10/dist-packages/pmdarima/arima/utils.py", line 189, in ndiffs
pval, dodiff = testfunc(x)
File "/usr/local/lib/python3.10/dist-packages/pmdarima/arima/stationarity.py", line 186, in should_diff
lm = LinearRegression().fit(t, x)
File "/usr/local/lib/python3.10/dist-packages/sklearn/base.py", line 1474, in wrapper
return fit_method(estimator, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/sklearn/linear_model/_base.py", line 653, in fit
self.coef_, _, self.rank_, self.singular_ = linalg.lstsq(X, y)
File "/usr/local/lib/python3.10/dist-packages/scipy/linalg/_basic.py", line 1212, in lstsq
lwork, iwork = _compute_lwork(lapack_lwork, m, n, nrhs, cond)
File "/usr/local/lib/python3.10/dist-packages/scipy/linalg/lapack.py", line 1004, in _compute_lwork
raise ValueError("Internal work array size computation failed: -7
SciPy/NumPy/Python version and system information
scipy==1.12.0
pip3 install numpy==1.26.4
python3 =3.10.11
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (9 by maintainers)
The point is, RISC-V is currently supported on a best-effort basis. Meaning, we are happy to accept patches which do not break our supported set of platforms (e.g., do not break our CI). We are also happy to offer advice and otherwise discuss problems which arise for “non-standard” platform like RISC-V. But in the end of the day somebody needs to provide a patch, to either SciPy or OpenBLAS, depending on where the problem is. ATM it’s not even clear this is a scipy issue.