microsoft / hummingbird

Hummingbird compiles trained ML models into tensor computation for faster inference.
MIT License
3.32k stars 274 forks source link

New numpy==2.0.0 breaks runners #779

Closed ksaur closed 1 week ago

ksaur commented 1 week ago

From broken workflow:

44 instances like this:

___________________ ERROR collecting tests/test_backends.py ____________________
tests/test_backends.py:13: in <module>
    from sklearn.ensemble import GradientBoostingClassifier
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sklearn/__init__.py:82: in <module>
    from .base import clone
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sklearn/base.py:17: in <module>
    from .utils import _IS_32BIT
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sklearn/utils/__init__.py:19: in <module>
    from .murmurhash import murmurhash3_32
sklearn/utils/murmurhash.pyx:1: in init sklearn.utils.murmurhash
    ???
E   ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

It seems other are having similar issues https://github.com/numpy/numpy/issues/26710 , https://github.com/pandas-dev/pandas/issues/59023 https://github.com/scikit-learn/scikit-learn/discussions/29290

ksaur commented 1 week ago

Ah. Ok, so reading https://github.com/scikit-learn/scikit-learn/discussions/29290 a bit more, maybe it is only because we have older SKL pinned for testing backwards compats

name: Test with older SKLearn on Linux with py3.9 to check backward compatibility
      if: ${{ matrix.python-version == '3.9' && startsWith(matrix.os, 'ubuntu') == true }}
      run: python -m pip install scikit-learn==1.2.1

So for this, we'd need to also now pin older numpy