conda-forge / jax-feedstock

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

missing jaxlib minimum version requirement in conda meta.yaml #81

Closed pdemarti closed 2 years ago

pdemarti commented 2 years ago

Solution to issue cannot be found in the documentation.

Issue

Overview

After updating jax to the current latest on conda-forge (0.3.0), we get a RuntimeError during import. Indeed, jax=0.3.3 depends on jaxlib>=0.3.0 but this feedstock doesn't say so in the conda requirements.

Steps to reproduce:

# check that jaxlib is unconstrained
conda search -c conda-forge jax --info | grep jaxlib | sort -u
  - jaxlib

# simulate a previous install
conda create -y -n test --force python=3.9
conda activate test
conda install -y -c conda-forge jax=0.3.0 'jaxlib>=0.1.74'
python -c 'import jax'
# no problem

But now:

# update jax
conda install -y -c conda-forge jax
python -c 'import jax'
(...)
RuntimeError: jaxlib is version 0.1.75, but this version of jax requires version >= 0.3.0.

Post-scriptum

It looks like a similar situation existed in previous versions. As far as conda search -c conda-forge jax --info can tell, there was never a minimum version imposed on jaxlib. Case in point, when I just try to install jax=0.3.0 on a fresh python3.9 miniconda environment, I get jaxlib=0.1.69, which is below the required 0.1.74 for that version.

Installed packages

# packages in environment at /home/pierred/packages/miniconda3/envs/test:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                      1_llvm    conda-forge
absl-py                   1.0.0              pyhd8ed1ab_0    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
certifi                   2021.10.8        py39hf3d152e_1    conda-forge
jax                       0.3.3              pyhd8ed1ab_0    conda-forge
jaxlib                    0.1.75           py39hde0f152_0    conda-forge
ld_impl_linux-64          2.35.1               h7274673_9  
libblas                   3.9.0           13_linux64_openblas    conda-forge
libcblas                  3.9.0           13_linux64_openblas    conda-forge
libffi                    3.3                  he6710b0_2  
libgcc-ng                 11.2.0              h1d223b6_14    conda-forge
libgfortran-ng            11.2.0              h69a702a_14    conda-forge
libgfortran5              11.2.0              h5c6108e_14    conda-forge
liblapack                 3.9.0           13_linux64_openblas    conda-forge
libopenblas               0.3.18          pthreads_h8fe5266_0    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_14    conda-forge
llvm-openmp               12.0.1               h4bd325d_1    conda-forge
ncurses                   6.3                  h7f8727e_2  
numpy                     1.22.3           py39h18676bf_0    conda-forge
openssl                   1.1.1l               h7f98852_0    conda-forge
opt_einsum                3.3.0              pyhd8ed1ab_1    conda-forge
pip                       21.2.4           py39h06a4308_0  
python                    3.9.7                h12debd9_1  
python-flatbuffers        2.0                pyhd8ed1ab_0    conda-forge
python_abi                3.9                      2_cp39    conda-forge
readline                  8.1.2                h7f8727e_1  
scipy                     1.8.0            py39hee8e79c_1    conda-forge
setuptools                58.0.4           py39h06a4308_0  
six                       1.16.0             pyh6c4a22f_0    conda-forge
sqlite                    3.38.0               hc218d9a_0  
tk                        8.6.11               h1ccaba5_0  
typing_extensions         4.1.1              pyha770c72_0    conda-forge
tzdata                    2021e                hda174b7_0  
wheel                     0.37.1             pyhd3eb1b0_0  
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7f8727e_4

Environment info

active environment : test
    active env location : /home/myself/packages/miniconda3/envs/test
            shell level : 2
       user config file : /home/myself/.condarc
 populated config files : /home/myself/.condarc
          conda version : 4.12.0
    conda-build version : 3.21.6
         python version : 3.9.7.final.0
       virtual packages : __cuda=11.4=0
                          __linux=5.13.0=0
                          __glibc=2.31=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/myself/packages/miniconda3  (writable)
      conda av data dir : /home/myself/packages/miniconda3/etc/conda
  conda av metadata url : None
           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/myself/packages/miniconda3/pkgs
                          /home/myself/.conda/pkgs
       envs directories : /home/myself/packages/miniconda3/envs
                          /home/myself/.conda/envs
               platform : linux-64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.7 Linux/5.13.0-35-generic ubuntu/20.04.4 glibc/2.31
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False
jakevdp commented 2 years ago

There is some info on jax/jaxlib version compatibility here: https://jax.readthedocs.io/en/latest/design_notes/jax_versioning.html#how-are-jax-and-jaxlib-versioned. A new policy was implemented recently.

Starting with version 0.3.0 of both packages the requirements are as follows:

ocefpaf commented 2 years ago

Done in https://github.com/conda-forge/jaxlib-feedstock/pull/93