Skip to content
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 DGESDD parameter number 10 had an illegal value on riscv64 #348

Open
olebole opened this issue Aug 17, 2022 · 2 comments
Labels

Comments

@olebole
Copy link
Contributor

olebole commented Aug 17, 2022

When testing sncosmo on a riscv64 machine (risc processor, 64 bit, little endian), I get the following failure:

_____________________ TestFitting.test_fitlc_arg_mutation ______________________

self = <sncosmo.tests.test_fitting.TestFitting object at 0x3fe802fb80>

    @pytest.mark.skipif('not HAS_IMINUIT')
    def test_fitlc_arg_mutation(self):
        """Test ``fit_lc`` does not mutate it's arguments"""
    
>       self._test_mutation(sncosmo.fit_lc)

sncosmo/tests/test_fitting.py:103: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
sncosmo/tests/test_fitting.py:86: in _test_mutation
    fit_func(test_data, test_model, test_vparams, bounds=test_bounds)
sncosmo/fitting.py:729: in fit_lc
    fitchisq = generate_chisq(fitdata, model, spectra, signature='iminuit',
sncosmo/fitting.py:37: in generate_chisq
    invcov = np.linalg.pinv(cov)
<__array_function__ internals>:5: in pinv
    ???
/usr/lib/python3/dist-packages/numpy/linalg/linalg.py:2002: in pinv
    u, s, vt = svd(a, full_matrices=False, hermitian=hermitian)
<__array_function__ internals>:5: in svd
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

a = array([[11987.55364268,     0.        ,     0.        , ...,
            0.        ,     0.        ,     0.        ],
...
       [    0.        ,     0.        ,     0.        , ...,
            0.        ,     0.        , 11987.55364268]])
full_matrices = False, compute_uv = True, hermitian = False

    @array_function_dispatch(_svd_dispatcher)
    def svd(a, full_matrices=True, compute_uv=True, hermitian=False):
        """…"""
        import numpy as _nx
        a, wrap = _makearray(a)
    
        if hermitian:
            […]
    
        _assert_stacked_2d(a)
        t, result_t = _commonType(a)
    
        extobj = get_linalg_error_extobj(_raise_linalgerror_svd_nonconvergence)
    
        m, n = a.shape[-2:]
        if compute_uv:
            if full_matrices:
                if m < n:
                    gufunc = _umath_linalg.svd_m_f
                else:
                    gufunc = _umath_linalg.svd_n_f
            else:
                if m < n:
                    gufunc = _umath_linalg.svd_m_s
                else:
                    gufunc = _umath_linalg.svd_n_s
    
            signature = 'D->DdD' if isComplexType(t) else 'd->ddd'
>           u, s, vh = gufunc(a, signature=signature, extobj=extobj)
E           ValueError: On entry to DGESDD parameter number 10 had an illegal value

/usr/lib/python3/dist-packages/numpy/linalg/linalg.py:1660: ValueError
----------------------------- Captured stderr call -----------------------------
init_dgesdd failed init

The same failure happens on TestFitting.test_mcmclc_arg_mutation, TestFitting.test_fit_lc, and TestFitting.test_flatten_result.
Full build/test log here.
On all other platforms, these tests pass.

Versions:

  • Python 3.10.6
  • sncosmo 2.8.0
  • astropy 5.1
  • numpy 1.21.5
@benjaminrose
Copy link
Member

Googling, this seems to be an SVD issue in scipy, likely associated with inverting a matrix. I think it might be because these tests use noise free simulations. That is my first theory at least.

@olebole
Copy link
Contributor Author

olebole commented Aug 22, 2022

OK, thanks. Since Riscv64 is not an official Debian architecture yet, I would just do nothing here; so, there is no Riscv64 package of sncosmo in the moment, and once scipy fixes this, I'd retrigger the build.
Scipy version used in the build was 1.8.1.
Just for reference: do you have the corresponding Scipy issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants