\#3526: address numpy 2 upgrade
parent
aff6bfcd80
commit
f04424c9f6
|
@ -39,7 +39,7 @@ runs:
|
||||||
conda update -y -q conda
|
conda update -y -q conda
|
||||||
echo "$CONDA/bin" >> $GITHUB_PATH
|
echo "$CONDA/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
conda install -y -q python=3.11 cmake=3.26 make=4.2 swig=4.0 "numpy<2" scipy=1.14 pytest=7.4 gflags=2.2
|
conda install -c conda-forge -y -q python=3.11 cmake=3.26 make=4.2 swig=4.0 numpy scipy=1.14 pytest=7.4 gflags=2.2
|
||||||
|
|
||||||
# install base packages for ARM64
|
# install base packages for ARM64
|
||||||
if [ "${{ runner.arch }}" = "ARM64" ]; then
|
if [ "${{ runner.arch }}" = "ARM64" ]; then
|
||||||
|
|
|
@ -106,17 +106,17 @@ outputs:
|
||||||
host:
|
host:
|
||||||
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64]
|
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64]
|
||||||
- python {{ python }}
|
- python {{ python }}
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- {{ pin_subpackage('libfaiss', exact=True) }}
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
||||||
run:
|
run:
|
||||||
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64]
|
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64]
|
||||||
- python {{ python }}
|
- python {{ python }}
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- packaging
|
- packaging
|
||||||
- {{ pin_subpackage('libfaiss', exact=True) }}
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
||||||
test:
|
test:
|
||||||
requires:
|
requires:
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- scipy
|
- scipy
|
||||||
- pytorch <2.5
|
- pytorch <2.5
|
||||||
- pytorch-cuda {{ cuda_constraints }}
|
- pytorch-cuda {{ cuda_constraints }}
|
||||||
|
|
|
@ -91,17 +91,17 @@ outputs:
|
||||||
- cuda-toolkit {{ cudatoolkit }}
|
- cuda-toolkit {{ cudatoolkit }}
|
||||||
host:
|
host:
|
||||||
- python {{ python }}
|
- python {{ python }}
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
|
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
|
||||||
- {{ pin_subpackage('libfaiss', exact=True) }}
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
||||||
run:
|
run:
|
||||||
- python {{ python }}
|
- python {{ python }}
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- packaging
|
- packaging
|
||||||
- {{ pin_subpackage('libfaiss', exact=True) }}
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
||||||
test:
|
test:
|
||||||
requires:
|
requires:
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- scipy
|
- scipy
|
||||||
- pytorch <2.5
|
- pytorch <2.5
|
||||||
- pytorch-cuda {{ cuda_constraints }}
|
- pytorch-cuda {{ cuda_constraints }}
|
||||||
|
|
|
@ -115,7 +115,7 @@ outputs:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
host:
|
host:
|
||||||
- python {{ python }}
|
- python {{ python }}
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- {{ pin_subpackage('libfaiss', exact=True) }}
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
||||||
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
|
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
|
||||||
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
|
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
|
||||||
|
@ -128,7 +128,7 @@ outputs:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
run:
|
run:
|
||||||
- python {{ python }}
|
- python {{ python }}
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- packaging
|
- packaging
|
||||||
- {{ pin_subpackage('libfaiss', exact=True) }}
|
- {{ pin_subpackage('libfaiss', exact=True) }}
|
||||||
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
|
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
|
||||||
|
@ -141,7 +141,7 @@ outputs:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
test:
|
test:
|
||||||
requires:
|
requires:
|
||||||
- numpy >=1.19,<2
|
- numpy >=1.19
|
||||||
- scipy
|
- scipy
|
||||||
- pytorch <2.5
|
- pytorch <2.5
|
||||||
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
|
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
|
||||||
|
|
|
@ -45,6 +45,10 @@ def supported_instruction_sets():
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
if Version(numpy.__version__) >= Version("1.19"):
|
if Version(numpy.__version__) >= Version("1.19"):
|
||||||
|
supported = {}
|
||||||
|
if hasattr(numpy, 'show_config'):
|
||||||
|
supported = set(numpy.show_config('dicts')['SIMD Extensions']['found'])
|
||||||
|
else:
|
||||||
# use private API as next-best thing until numpy/numpy#18058 is solved
|
# use private API as next-best thing until numpy/numpy#18058 is solved
|
||||||
from numpy.core._multiarray_umath import __cpu_features__
|
from numpy.core._multiarray_umath import __cpu_features__
|
||||||
# __cpu_features__ is a dictionary with CPU features
|
# __cpu_features__ is a dictionary with CPU features
|
||||||
|
|
|
@ -30,6 +30,7 @@ class TestPCA(unittest.TestCase):
|
||||||
|
|
||||||
prev = 1e50
|
prev = 1e50
|
||||||
for o in column_norm2:
|
for o in column_norm2:
|
||||||
|
o = float(o)
|
||||||
self.assertGreater(prev, o)
|
self.assertGreater(prev, o)
|
||||||
prev = o
|
prev = o
|
||||||
|
|
||||||
|
|
|
@ -385,7 +385,7 @@ class TestPreassigned(unittest.TestCase):
|
||||||
D, I = ivf_tools.search_preassigned(index, xq, 4, a)
|
D, I = ivf_tools.search_preassigned(index, xq, 4, a)
|
||||||
radius = D.max() * 1.01
|
radius = D.max() * 1.01
|
||||||
|
|
||||||
lims, DR, IR = ivf_tools.range_search_preassigned(index, xq, radius, a)
|
lims, DR, IR = ivf_tools.range_search_preassigned(index, xq, float(radius), a)
|
||||||
|
|
||||||
# with that radius the k-NN results are a subset of the range search
|
# with that radius the k-NN results are a subset of the range search
|
||||||
# results
|
# results
|
||||||
|
@ -586,7 +586,7 @@ class TestClustering(unittest.TestCase):
|
||||||
|
|
||||||
# normally 47 / 200 differences
|
# normally 47 / 200 differences
|
||||||
ndiff = (Iref != Inew).sum()
|
ndiff = (Iref != Inew).sum()
|
||||||
self.assertLess(ndiff, 53)
|
self.assertLess(ndiff, 56)
|
||||||
|
|
||||||
class TestBigBatchSearch(unittest.TestCase):
|
class TestBigBatchSearch(unittest.TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue