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

numpy.exp is not raising overflow error for large values #16

Open
tadeu opened this issue Sep 17, 2019 · 2 comments
Open

numpy.exp is not raising overflow error for large values #16

tadeu opened this issue Sep 17, 2019 · 2 comments

Comments

@tadeu
Copy link

tadeu commented Sep 17, 2019

Issue: numpy.exp is not raising overflow error for large values, only in the Anaconda distribution, present in the latest version and at least since version 1.14.2.

I've tested this in both Windows and Linux, with Anaconda, conda-forge and Intel packages, and I've attested that the problem is only present in Anaconda packages.

Here is how to reproduce it:

$ python -c "import numpy as np; np.seterr(all='raise'); np.exp(750.0)"

if the problem is present, it will print nothing. If everything is ok, it will print:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
FloatingPointError: overflow encountered in exp

I've reported it before in numpy/numpy#11117, but this seems to be an Anaconda-only problem.


Environment (conda list):
Linux:

$ conda list -n test_numpy_anaconda
# packages in environment at /home/jenkins/miniconda3/envs/test_numpy_anaconda:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
blas                      1.0                         mkl    defaults
ca-certificates           2019.5.15                     1    defaults
certifi                   2019.6.16                py37_1    defaults
intel-openmp              2019.4                      243    defaults
libedit                   3.1.20181209         hc058e9b_0    defaults
libffi                    3.2.1                hd88cf55_4    defaults
libgcc-ng                 9.1.0                hdf63c60_0    defaults
libgfortran-ng            7.3.0                hdf63c60_0    defaults
libstdcxx-ng              9.1.0                hdf63c60_0    defaults
mkl                       2019.4                      243    defaults
mkl-service               2.3.0            py37he904b0f_0    defaults
mkl_fft                   1.0.14           py37ha843d7b_0    defaults
mkl_random                1.0.2            py37hd81dba3_0    defaults
ncurses                   6.1                  he6710b0_1    defaults
numpy                     1.16.5           py37h7e9f1db_0    defaults
numpy-base                1.16.5           py37hde5b4d6_0    defaults
openssl                   1.1.1d               h7b6447c_1    defaults
pip                       19.2.2                   py37_0    defaults
python                    3.7.4                h265db76_1    defaults
readline                  7.0                  h7b6447c_5    defaults
setuptools                41.0.1                   py37_0    defaults
six                       1.12.0                   py37_0    defaults
sqlite                    3.29.0               h7b6447c_0    defaults
tk                        8.6.8                hbc83047_0    defaults
wheel                     0.33.4                   py37_0    defaults
xz                        5.2.4                h14c3975_4    defaults
zlib                      1.2.11               h7b6447c_3    defaults



Windows:

λ conda list -n test_numpy_anaconda
# packages in environment at W:\Miniconda3\envs\test_numpy_anaconda:
#
# Name                    Version                   Build  Channel
blas                      1.0                         mkl
ca-certificates           2019.5.15                     1
certifi                   2019.6.16                py37_1
icc_rt                    2019.0.0             h0cc432a_1
intel-openmp              2019.4                      245
mkl                       2019.4                      245
mkl-service               2.3.0            py37hb782905_0
mkl_fft                   1.0.14           py37h14836fe_0
mkl_random                1.0.2            py37h343c172_0
numpy                     1.16.5           py37h19fb1c0_0
numpy-base                1.16.5           py37hc3f5095_0
openssl                   1.1.1d               he774522_0
pip                       19.2.2                   py37_0
python                    3.7.4                h5263a28_0
setuptools                41.0.1                   py37_0
six                       1.12.0                   py37_0
sqlite                    3.29.0               he774522_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_0
wheel                     0.33.4                   py37_0
wincertstore              0.2                      py37_0

Details about conda and system ( conda info ):
Linux:

$ conda info

     active environment : None
            shell level : 0
       user config file : /home/jenkins/.condarc
 populated config files : /home/jenkins/miniconda3/.condarc
          conda version : 4.7.10
    conda-build version : 3.18.8
         python version : 3.7.3.final.0
       virtual packages : 
       base environment : /home/jenkins/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/jenkins/miniconda3/pkgs
                          /home/jenkins/.conda/pkgs
       envs directories : /home/jenkins/miniconda3/envs
                          /home/jenkins/.conda/envs
               platform : linux-64
             user-agent : conda/4.7.10 requests/2.22.0 CPython/3.7.3 Linux/4.4.0-21-generic ubuntu/16.04.5 glibc/2.23
                UID:GID : 1001:1001
             netrc file : None
           offline mode : False


Windows:

λ conda info

     active environment : None
            shell level : 0
       user config file : C:\Users\default\.condarc
 populated config files : W:\Miniconda3\.condarc
          conda version : 4.7.5
    conda-build version : 3.18.4
         python version : 3.7.3.final.0
       virtual packages : __cuda=9.2
       base environment : W:\Miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : W:\Miniconda3\pkgs
                          C:\Users\default\.conda\pkgs
                          C:\Users\default\AppData\Local\conda\conda\pkgs
       envs directories : W:\Miniconda3\envs
                          C:\Users\default\.conda\envs
                          C:\Users\default\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.7.5 requests/2.22.0 CPython/3.7.3 Windows/10 Windows/10.0.17763
          administrator : True
             netrc file : None
           offline mode : False
@tadeu
Copy link
Author

tadeu commented Sep 17, 2019

@jjhelmus
Copy link

I'm not seeing this issue with the NumPy 1.17.2 release:

$ conda list
# packages in environment at /home/jhelmus/conda/envs/np_mkl:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main    defaults
blas                      1.0                         mkl    defaults
ca-certificates           2019.8.28                     0    defaults
intel-openmp              2019.4                      243    defaults
libedit                   3.1.20181209         hc058e9b_0    defaults
libffi                    3.2.1                hd88cf55_4    defaults
libgcc-ng                 9.1.0                hdf63c60_0    defaults
libgfortran-ng            7.3.0                hdf63c60_0    defaults
libstdcxx-ng              9.1.0                hdf63c60_0    defaults
mkl                       2019.4                      243    defaults
mkl-service               2.3.0            py37he904b0f_0    defaults
mkl_fft                   1.0.14           py37ha843d7b_0    defaults
mkl_random                1.1.0            py37hd6b4f25_0    defaults
ncurses                   6.1                  he6710b0_1    defaults
numpy                     1.17.2           py37haad9e8e_0    defaults
numpy-base                1.17.2           py37hde5b4d6_0    defaults
openssl                   1.1.1d               h7b6447c_1    defaults
python                    3.7.4                h265db76_1    defaults
readline                  7.0                  h7b6447c_5    defaults
six                       1.12.0                   py37_0    defaults
sqlite                    3.29.0               h7b6447c_0    defaults
tk                        8.6.8                hbc83047_0    defaults
xz                        5.2.4                h14c3975_4    defaults
zlib                      1.2.11               h7b6447c_3    defaults
$ python -c "import numpy as np; np.seterr(all='raise'); np.exp(750.0)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
FloatingPointError: overflow encountered in exp

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

No branches or pull requests

2 participants