Skip to content

Commit d4be78c

Browse files
Michael Norrisfacebook-github-bot
authored andcommitted
Check errors in numpy >= 2 (facebookresearch#4523)
Summary: Rollback Plan: Differential Revision: D79900113
1 parent 8d9d3be commit d4be78c

File tree

8 files changed

+151
-153
lines changed

8 files changed

+151
-153
lines changed

.github/actions/build_cmake/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
conda update -y -q conda
4040
echo "$CONDA/bin" >> $GITHUB_PATH
4141
42-
conda install -y -q python=3.11 cmake=3.30.4 make=4.2 swig=4.0 "numpy<2" scipy=1.14 pytest=7.4 gflags=2.2
42+
conda install -y -q python=3.11 cmake=3.30.4 make=4.2 swig=4.0 "numpy>=2" scipy=1.14 pytest=7.4 gflags=2.2
4343
4444
# install base packages for ARM64
4545
if [ "${{ runner.arch }}" = "ARM64" ]; then

.github/workflows/build-pull-request.yml

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -30,107 +30,107 @@ jobs:
3030
git --no-pager diff --color
3131
exit 1
3232
fi
33-
linux-x86_64-cmake:
34-
name: Linux x86_64 (cmake)
35-
runs-on: ubuntu-latest
36-
steps:
37-
- name: Checkout
38-
uses: actions/checkout@v4
39-
- name: Build and Test (cmake)
40-
uses: ./.github/actions/build_cmake
41-
linux-x86_64-AVX2-cmake:
42-
name: Linux x86_64 AVX2 (cmake)
43-
needs: linux-x86_64-cmake
44-
runs-on: ubuntu-latest
45-
steps:
46-
- name: Checkout
47-
uses: actions/checkout@v4
48-
- name: Build and Test (cmake)
49-
uses: ./.github/actions/build_cmake
50-
with:
51-
opt_level: avx2
52-
linux-x86_64-AVX512-cmake:
53-
name: Linux x86_64 AVX512 (cmake)
54-
needs: linux-x86_64-cmake
55-
runs-on: faiss-aws-m7i.large
56-
steps:
57-
- name: Checkout
58-
uses: actions/checkout@v4
59-
- name: Build and Test (cmake)
60-
uses: ./.github/actions/build_cmake
61-
with:
62-
opt_level: avx512
63-
linux-x86_64-AVX512_SPR-cmake:
64-
name: Linux x86_64 AVX512_SPR (cmake)
65-
needs: linux-x86_64-cmake
66-
runs-on: faiss-aws-m7i.large
67-
steps:
68-
- name: Checkout
69-
uses: actions/checkout@v4
70-
- name: Build and Test (cmake)
71-
uses: ./.github/actions/build_cmake
72-
with:
73-
opt_level: avx512_spr
74-
linux-x86_64-GPU-cmake:
75-
name: Linux x86_64 GPU (cmake)
76-
needs: linux-x86_64-cmake
77-
runs-on: 4-core-ubuntu-gpu-t4
78-
steps:
79-
- name: Checkout
80-
uses: actions/checkout@v4
81-
- name: Build and Test (cmake)
82-
uses: ./.github/actions/build_cmake
83-
with:
84-
gpu: ON
85-
linux-x86_64-GPU-w-CUVS-cmake:
86-
name: Linux x86_64 GPU w/ cuVS (cmake)
87-
needs: linux-x86_64-cmake
88-
runs-on: 4-core-ubuntu-gpu-t4
89-
steps:
90-
- name: Checkout
91-
uses: actions/checkout@v4
92-
- name: Build and Test (cmake)
93-
uses: ./.github/actions/build_cmake
94-
with:
95-
gpu: ON
96-
cuvs: ON
97-
linux-x86_64-GPU-w-ROCm-cmake:
98-
name: Linux x86_64 GPU w/ ROCm (cmake)
99-
needs: linux-x86_64-cmake
100-
runs-on: faiss-amd-MI200
101-
container:
102-
image: ubuntu:22.04
103-
options: --device=/dev/kfd --device=/dev/dri --ipc=host --shm-size 16G --group-add video --cap-add=SYS_PTRACE --cap-add=SYS_ADMIN
104-
steps:
105-
- name: Container setup
106-
run: |
107-
if [ -f /.dockerenv ]; then
108-
apt-get update && apt-get install -y sudo && apt-get install -y git
109-
git config --global --add safe.directory '*'
110-
else
111-
echo 'Skipping. Current job is not running inside a container.'
112-
fi
113-
- name: Checkout
114-
uses: actions/checkout@v4
115-
- name: Build and Test (cmake)
116-
uses: ./.github/actions/build_cmake
117-
with:
118-
gpu: ON
119-
rocm: ON
120-
linux-arm64-SVE-cmake:
121-
name: Linux arm64 SVE (cmake)
122-
needs: linux-x86_64-cmake
123-
runs-on: faiss-aws-r8g.large
124-
steps:
125-
- name: Checkout
126-
uses: actions/checkout@v4
127-
- name: Build and Test (cmake)
128-
uses: ./.github/actions/build_cmake
129-
with:
130-
opt_level: sve
131-
env:
132-
# Context: https://github.com/facebookresearch/faiss/wiki/Troubleshooting#surprising-faiss-openmp-and-openblas-interaction
133-
OPENBLAS_NUM_THREADS: '1'
33+
# linux-x86_64-cmake:
34+
# name: Linux x86_64 (cmake)
35+
# runs-on: ubuntu-latest
36+
# steps:
37+
# - name: Checkout
38+
# uses: actions/checkout@v4
39+
# - name: Build and Test (cmake)
40+
# uses: ./.github/actions/build_cmake
41+
# linux-x86_64-AVX2-cmake:
42+
# name: Linux x86_64 AVX2 (cmake)
43+
# needs: linux-x86_64-cmake
44+
# runs-on: ubuntu-latest
45+
# steps:
46+
# - name: Checkout
47+
# uses: actions/checkout@v4
48+
# - name: Build and Test (cmake)
49+
# uses: ./.github/actions/build_cmake
50+
# with:
51+
# opt_level: avx2
52+
# linux-x86_64-AVX512-cmake:
53+
# name: Linux x86_64 AVX512 (cmake)
54+
# needs: linux-x86_64-cmake
55+
# runs-on: faiss-aws-m7i.large
56+
# steps:
57+
# - name: Checkout
58+
# uses: actions/checkout@v4
59+
# - name: Build and Test (cmake)
60+
# uses: ./.github/actions/build_cmake
61+
# with:
62+
# opt_level: avx512
63+
# linux-x86_64-AVX512_SPR-cmake:
64+
# name: Linux x86_64 AVX512_SPR (cmake)
65+
# needs: linux-x86_64-cmake
66+
# runs-on: faiss-aws-m7i.large
67+
# steps:
68+
# - name: Checkout
69+
# uses: actions/checkout@v4
70+
# - name: Build and Test (cmake)
71+
# uses: ./.github/actions/build_cmake
72+
# with:
73+
# opt_level: avx512_spr
74+
# linux-x86_64-GPU-cmake:
75+
# name: Linux x86_64 GPU (cmake)
76+
# needs: linux-x86_64-cmake
77+
# runs-on: 4-core-ubuntu-gpu-t4
78+
# steps:
79+
# - name: Checkout
80+
# uses: actions/checkout@v4
81+
# - name: Build and Test (cmake)
82+
# uses: ./.github/actions/build_cmake
83+
# with:
84+
# gpu: ON
85+
# linux-x86_64-GPU-w-CUVS-cmake:
86+
# name: Linux x86_64 GPU w/ cuVS (cmake)
87+
# needs: linux-x86_64-cmake
88+
# runs-on: 4-core-ubuntu-gpu-t4
89+
# steps:
90+
# - name: Checkout
91+
# uses: actions/checkout@v4
92+
# - name: Build and Test (cmake)
93+
# uses: ./.github/actions/build_cmake
94+
# with:
95+
# gpu: ON
96+
# cuvs: ON
97+
# linux-x86_64-GPU-w-ROCm-cmake:
98+
# name: Linux x86_64 GPU w/ ROCm (cmake)
99+
# needs: linux-x86_64-cmake
100+
# runs-on: faiss-amd-MI200
101+
# container:
102+
# image: ubuntu:22.04
103+
# options: --device=/dev/kfd --device=/dev/dri --ipc=host --shm-size 16G --group-add video --cap-add=SYS_PTRACE --cap-add=SYS_ADMIN
104+
# steps:
105+
# - name: Container setup
106+
# run: |
107+
# if [ -f /.dockerenv ]; then
108+
# apt-get update && apt-get install -y sudo && apt-get install -y git
109+
# git config --global --add safe.directory '*'
110+
# else
111+
# echo 'Skipping. Current job is not running inside a container.'
112+
# fi
113+
# - name: Checkout
114+
# uses: actions/checkout@v4
115+
# - name: Build and Test (cmake)
116+
# uses: ./.github/actions/build_cmake
117+
# with:
118+
# gpu: ON
119+
# rocm: ON
120+
# linux-arm64-SVE-cmake:
121+
# name: Linux arm64 SVE (cmake)
122+
# needs: linux-x86_64-cmake
123+
# runs-on: faiss-aws-r8g.large
124+
# steps:
125+
# - name: Checkout
126+
# uses: actions/checkout@v4
127+
# - name: Build and Test (cmake)
128+
# uses: ./.github/actions/build_cmake
129+
# with:
130+
# opt_level: sve
131+
# env:
132+
# # Context: https://github.com/facebookresearch/faiss/wiki/Troubleshooting#surprising-faiss-openmp-and-openblas-interaction
133+
# OPENBLAS_NUM_THREADS: '1'
134134
linux-x86_64-conda:
135135
name: Linux x86_64 (conda)
136136
needs: linux-x86_64-cmake

conda/conda_build_config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python:
2-
- 3.10
3-
- 3.11
4-
- 3.12 # [not aarch64]
2+
- 3.10 # [not win]
3+
- 3.11 # [not win]
4+
- 3.12

conda/faiss-gpu-cuvs/meta.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,20 @@ outputs:
101101
- mkl =2023.0 # [x86_64]
102102
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64]
103103
- python {{ python }}
104-
- numpy >=1.19,<2
104+
- numpy >=2
105105
- {{ pin_subpackage('libfaiss', exact=True) }}
106106
run:
107107
- mkl =2023.0 # [x86_64]
108108
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64]
109109
- python {{ python }}
110-
- numpy >=1.19,<2
110+
- numpy >=2
111111
- packaging
112112
- {{ pin_subpackage('libfaiss', exact=True) }}
113113
test:
114114
requires:
115-
- numpy >=1.19,<2
115+
- numpy >=2
116116
- scipy
117-
- pytorch <2.5
117+
- pytorch >=2.7
118118
- pytorch-cuda {{ cuda_constraints }}
119119
commands:
120120
- python -X faulthandler -m unittest discover -v -s tests/ -p "test_*"

conda/faiss-gpu/meta.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,20 @@ outputs:
9696
host:
9797
- mkl =2023.0 # [x86_64]
9898
- python {{ python }}
99-
- numpy >=1.19,<2
99+
- numpy >=2
100100
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
101101
- {{ pin_subpackage('libfaiss', exact=True) }}
102102
run:
103103
- mkl =2023.0 # [x86_64]
104104
- python {{ python }}
105-
- numpy >=1.19,<2
105+
- numpy >=2
106106
- packaging
107107
- {{ pin_subpackage('libfaiss', exact=True) }}
108108
test:
109109
requires:
110-
- numpy >=1.19,<2
110+
- numpy >=2
111111
- scipy
112-
- pytorch <2.5
112+
- pytorch >=2.7
113113
- pytorch-cuda {{ cuda_constraints }}
114114
commands:
115115
- python -X faulthandler -m unittest discover -v -s tests/ -p "test_*"

conda/faiss/meta.yaml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,33 @@ outputs:
4343
- cmake >=3.24.0
4444
- make =4.2 # [not win and not (osx and arm64)]
4545
- make =4.4 # [osx and arm64]
46-
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
47-
- mkl-devel =2023.0 # [x86_64]
46+
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
47+
- mkl-devel =2024.2.2 # [x86_64]
4848
- python_abi <3.12
4949
{% elif PY_VER == '3.12' %}
50-
- mkl-devel >=2023.2.0 # [x86_64 and not win]
51-
- mkl-devel =2023.1.0 # [x86_64 and win]
50+
- mkl-devel =2024.2.2 # [x86_64 and not win]
51+
- mkl-devel =2024.2.2 # [x86_64 and win]
5252
- python_abi =3.12
5353
{% endif %}
5454
host:
5555
- python {{ python }}
56-
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
57-
- mkl =2023.0 # [x86_64]
56+
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
57+
- mkl =2024.2.2 # [x86_64]
5858
- python_abi <3.12
5959
{% elif PY_VER == '3.12' %}
60-
- mkl >=2023.2.0 # [x86_64 and not win]
61-
- mkl =2023.1.0 # [x86_64 and win]
60+
- mkl =2024.2.2 # [x86_64 and not win]
61+
- mkl =2024.2.2 # [x86_64 and win]
6262
- python_abi =3.12
6363
{% endif %}
6464
- openblas =0.3.30 # [not x86_64]
6565
run:
6666
- python {{ python }}
67-
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
68-
- mkl =2023.0 # [x86_64]
67+
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
68+
- mkl =2024.2.2 # [x86_64]
6969
- python_abi <3.12
7070
{% elif PY_VER == '3.12' %}
71-
- mkl >=2023.2.0 # [x86_64 and not win]
72-
- mkl =2023.1.0 # [x86_64 and win]
71+
- mkl =2024.2.2 # [x86_64 and not win]
72+
- mkl =2024.2.2 # [x86_64 and win]
7373
- python_abi =3.12
7474
{% endif %}
7575
- openblas =0.3.30 # [not x86_64]
@@ -99,51 +99,51 @@ outputs:
9999
- make =4.2 # [not win and not (osx and arm64)]
100100
- make =4.4 # [osx and arm64]
101101
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
102-
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
103-
- mkl =2023.0 # [x86_64]
102+
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
103+
- mkl =2024.2.2 # [x86_64]
104104
- python_abi <3.12
105105
{% elif PY_VER == '3.12' %}
106-
- mkl >=2023.2.0 # [x86_64 and not win]
107-
- mkl =2023.1.0 # [x86_64 and win]
106+
- mkl =2024.2.2 # [x86_64 and not win]
107+
- mkl =2024.2.2 # [x86_64 and win]
108108
- python_abi =3.12
109109
{% endif %}
110110
host:
111111
- python {{ python }}
112-
- numpy >=1.19,<2
112+
- numpy >=2
113113
- {{ pin_subpackage('libfaiss', exact=True) }}
114114
- _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win]
115-
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
116-
- mkl =2023.0 # [x86_64]
115+
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
116+
- mkl =2024.2.2 # [x86_64]
117117
- python_abi <3.12
118118
{% elif PY_VER == '3.12' %}
119-
- mkl >=2023.2.0 # [x86_64 and not win]
120-
- mkl =2023.1.0 # [x86_64 and win]
119+
- mkl =2024.2.2 # [x86_64 and not win]
120+
- mkl =2024.2.2 # [x86_64 and win]
121121
- python_abi =3.12
122122
{% endif %}
123123
run:
124124
- python {{ python }}
125-
- numpy >=1.19,<2
125+
- numpy >=2
126126
- packaging
127127
- {{ pin_subpackage('libfaiss', exact=True) }}
128-
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
129-
- mkl =2023.0 # [x86_64]
128+
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
129+
- mkl =2024.2.2 # [x86_64]
130130
- python_abi <3.12
131131
{% elif PY_VER == '3.12' %}
132-
- mkl >=2023.2.0 # [x86_64 and not win]
133-
- mkl =2023.1.0 # [x86_64 and win]
132+
- mkl =2024.2.2 # [x86_64 and not win]
133+
- mkl =2024.2.2 # [x86_64 and win]
134134
- python_abi =3.12
135135
{% endif %}
136136
test:
137137
requires:
138-
- numpy >=1.19,<2
138+
- numpy >=2
139139
- scipy
140-
- pytorch <2.5
141-
{% if PY_VER == '3.9' or PY_VER == '3.10' or PY_VER == '3.11' %}
142-
- mkl =2023.0 # [x86_64]
140+
- pytorch-cpu >=2.7
141+
{% if PY_VER == '3.10' or PY_VER == '3.11' %}
142+
- mkl =2024.2.2 # [x86_64]
143143
- python_abi <3.12
144144
{% elif PY_VER == '3.12' %}
145-
- mkl >=2023.2.0 # [x86_64 and not win]
146-
- mkl =2023.1.0 # [x86_64 and win]
145+
- mkl =2024.2.2 # [x86_64 and not win]
146+
- mkl =2024.2.2 # [x86_64 and win]
147147
- python_abi =3.12
148148
{% endif %}
149149
commands:

0 commit comments

Comments
 (0)