conda-forge / onnxruntime-feedstock

A conda-smithy repository for onnxruntime.
BSD 3-Clause "New" or "Revised" License
1 stars 20 forks source link

onnxruntime 1.18.0 fails pip check #122

Closed jtilly closed 6 months ago

jtilly commented 6 months ago

Solution to issue cannot be found in the documentation.

Issue

micromamba create -p ./onnxruntime onnxruntime
micromamba activate ./onnxruntime
pip check

produces

onnxruntime 1.18.0 has requirement numpy>=2.0.0rc2, but you have numpy 1.26.4.

Installed packages

# packages in environment at /private/tmp/onnxruntime:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.8                h93a5062_5    conda-forge
ca-certificates           2024.2.2             hf0a4a13_0    conda-forge
coloredlogs               15.0.1             pyhd8ed1ab_3    conda-forge
gmp                       6.3.0                hebf3989_1    conda-forge
gmpy2                     2.1.5           py312hfa9fade_1    conda-forge
humanfriendly             10.0               pyhd8ed1ab_6    conda-forge
libabseil                 20240116.2      cxx17_hebf3989_0    conda-forge
libblas                   3.9.0           22_osxarm64_openblas    conda-forge
libcblas                  3.9.0           22_osxarm64_openblas    conda-forge
libcxx                    17.0.6               h5f092b4_0    conda-forge
libexpat                  2.6.2                hebf3989_0    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0           13_2_0_hd922786_3    conda-forge
libgfortran5              13.2.0               hf226fd6_3    conda-forge
liblapack                 3.9.0           22_osxarm64_openblas    conda-forge
libopenblas               0.3.27          openmp_h6c19121_0    conda-forge
libprotobuf               4.25.3               hbfab5d5_0    conda-forge
libsqlite                 3.45.3               h091b4b1_0    conda-forge
libzlib                   1.2.13               hfb2fe0b_6    conda-forge
llvm-openmp               18.1.6               hde57baf_0    conda-forge
mpc                       1.3.1                h91ba8db_0    conda-forge
mpfr                      4.2.1                h41d338b_1    conda-forge
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
ncurses                   6.5                  hb89a1cb_0    conda-forge
numpy                     1.26.4          py312h8442bc7_0    conda-forge
onnxruntime               1.18.0          py312h46e16bd_1_cpu    conda-forge
openssl                   3.3.0                hfb2fe0b_3    conda-forge
packaging                 24.0               pyhd8ed1ab_0    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
protobuf                  4.25.3          py312h1a610f3_0    conda-forge
python                    3.12.3          h4a7b5fc_0_cpython    conda-forge
python-flatbuffers        24.3.25            pyh59ac667_0    conda-forge
python_abi                3.12                    4_cp312    conda-forge
readline                  8.2                  h92ec313_1    conda-forge
setuptools                70.0.0             pyhd8ed1ab_0    conda-forge
sympy                     1.12            pypyh9d50eac_103    conda-forge
tk                        8.6.13               h5083fa2_1    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge

Environment info

-
hmaarrfk commented 6 months ago

I'm curious why this isn't a problem with their pypi package:

$ pip install onnxruntime==1.18.0
Collecting onnxruntime==1.18.0
  Downloading onnxruntime-1.18.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (4.3 kB)
Collecting coloredlogs (from onnxruntime==1.18.0)
  Downloading coloredlogs-15.0.1-py2.py3-none-any.whl.metadata (12 kB)
Collecting flatbuffers (from onnxruntime==1.18.0)
  Downloading flatbuffers-24.3.25-py2.py3-none-any.whl.metadata (850 bytes)
Collecting numpy>=1.26.0 (from onnxruntime==1.18.0)
  Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.0/61.0 kB 1.6 MB/s eta 0:00:00
Collecting packaging (from onnxruntime==1.18.0)
  Downloading packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
Collecting protobuf (from onnxruntime==1.18.0)
  Downloading protobuf-5.27.0-cp38-abi3-manylinux2014_x86_64.whl.metadata (592 bytes)
Collecting sympy (from onnxruntime==1.18.0)
  Downloading sympy-1.12-py3-none-any.whl.metadata (12 kB)
Collecting humanfriendly>=9.1 (from coloredlogs->onnxruntime==1.18.0)
  Downloading humanfriendly-10.0-py2.py3-none-any.whl.metadata (9.2 kB)
Collecting mpmath>=0.19 (from sympy->onnxruntime==1.18.0)
  Downloading mpmath-1.3.0-py3-none-any.whl.metadata (8.6 kB)
Downloading onnxruntime-1.18.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (6.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 10.3 MB/s eta 0:00:00
Downloading numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.0/18.0 MB 11.8 MB/s eta 0:00:00
Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 kB 11.0 MB/s eta 0:00:00
Downloading flatbuffers-24.3.25-py2.py3-none-any.whl (26 kB)
Downloading packaging-24.0-py3-none-any.whl (53 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.5/53.5 kB 9.4 MB/s eta 0:00:00
Downloading protobuf-5.27.0-cp38-abi3-manylinux2014_x86_64.whl (309 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 309.2/309.2 kB 13.3 MB/s eta 0:00:00
Downloading sympy-1.12-py3-none-any.whl (5.7 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 12.6 MB/s eta 0:00:00
Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 kB 15.4 MB/s eta 0:00:00
Downloading mpmath-1.3.0-py3-none-any.whl (536 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 536.2/536.2 kB 4.6 MB/s eta 0:00:00
Installing collected packages: mpmath, flatbuffers, sympy, protobuf, packaging, numpy, humanfriendly, coloredlogs, onnxruntime
Successfully installed coloredlogs-15.0.1 flatbuffers-24.3.25 humanfriendly-10.0 mpmath-1.3.0 numpy-1.26.4 onnxruntime-1.18.0 packaging-24.0 protobuf-5.27.0 sympy-1.12
(py312) ✔ ~
06:54 $ pip check
No broken requirements found.

$ mamba list
$ mamba list
# packages in environment at /home/mark/miniforge3/envs/py312:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
ca-certificates           2024.2.2             hbcca054_0    conda-forge
coloredlogs               15.0.1                   pypi_0    pypi
flatbuffers               24.3.25                  pypi_0    pypi
humanfriendly             10.0                     pypi_0    pypi
ld_impl_linux-64          2.40                 hf3520f5_1    conda-forge
libexpat                  2.6.2                h59595ed_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h77fa898_7    conda-forge
libgomp                   13.2.0               h77fa898_7    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libsqlite                 3.45.3               h2797004_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libzlib                   1.2.13               h4ab18f5_6    conda-forge
mpmath                    1.3.0                    pypi_0    pypi
ncurses                   6.5                  h59595ed_0    conda-forge
numpy                     1.26.4                   pypi_0    pypi
onnxruntime               1.18.0                   pypi_0    pypi
openssl                   3.3.0                h4ab18f5_3    conda-forge
packaging                 24.0                     pypi_0    pypi
pip                       24.0               pyhd8ed1ab_0    conda-forge
protobuf                  5.27.0                   pypi_0    pypi
python                    3.12.3          hab00c5b_0_cpython    conda-forge
readline                  8.2                  h8228510_1    conda-forge
setuptools                70.0.0             pyhd8ed1ab_0    conda-forge
sympy                     1.12                     pypi_0    pypi
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
cbourjau commented 6 months ago

I'm curious why this isn't a problem with their pypi package:

I believe upstream is not building PyPI's onnxruntime against NumPy 2.0

hmaarrfk commented 6 months ago

So similarly I might not be able to I stall it with bumpy 1.23 for example???

cbourjau commented 6 months ago

These might be the dependencies used to build on PyPI:

numpy==1.21.6 ; python_version < '3.11'
numpy==1.24.2 ; python_version == '3.11'
numpy==1.26.0 ; python_version >= '3.12'

Trying to run the following on Python 3.9 seems to confirm this:

$ pip install onnxruntime==1.18 numpy==1.20                                                                                                      ~/groundzero/foo
Collecting onnxruntime==1.18
  Downloading onnxruntime-1.18.0-cp39-cp39-macosx_11_0_universal2.whl.metadata (4.2 kB)
Collecting numpy==1.20
  Using cached numpy-1.20.0-cp39-cp39-macosx_11_0_arm64.whl
Collecting coloredlogs (from onnxruntime==1.18)
  Downloading coloredlogs-15.0.1-py2.py3-none-any.whl.metadata (12 kB)
Collecting flatbuffers (from onnxruntime==1.18)
  Downloading flatbuffers-24.3.25-py2.py3-none-any.whl.metadata (850 bytes)
INFO: pip is looking at multiple versions of onnxruntime to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install numpy==1.20 and onnxruntime==1.18.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested numpy==1.20
    onnxruntime 1.18.0 depends on numpy>=1.21.6
hmaarrfk commented 6 months ago

I think i get it. they are using the old style numpy build system in their builds where you are "forward" compatible with future numpy pins.

They have not built for numpy 2.0, so they have not yet seen this issue.