version: 2.1 executors: linux-x86_64-cpu: docker: - image: continuumio/miniconda3 resource_class: large jobs: build_cmake: parameters: exec: type: executor opt_level: type: string default: generic executor: << parameters.exec >> environment: OMP_NUM_THREADS: 10 MKL_THREADING_LAYER: GNU steps: - checkout - run: name: Install conda command: | if [ -n "${CONDA_ARCH}" ] then curl https://repo.anaconda.com/miniconda/Miniconda3-latest-${CONDA_ARCH}.sh --output miniconda.sh bash miniconda.sh -b -p $HOME/miniconda ~/miniconda/bin/conda init fi - run: name: Set up environment command: | conda config --set solver libmamba conda update -y -q conda - run: name: Install env using main channel command: | conda install -y -q python=3.11 cmake make swig mkl=2023 mkl-devel=2023 numpy scipy pytest gxx_linux-64=11.2 sysroot_linux-64 - run: name: Build all targets no_output_timeout: 30m command: | eval "$(conda shell.bash hook)" conda activate cmake -B build \ -DBUILD_TESTING=ON \ -DBUILD_SHARED_LIBS=ON \ -DFAISS_ENABLE_GPU=OFF \ -DFAISS_ENABLE_RAFT=OFF \ -DFAISS_OPT_LEVEL=<< parameters.opt_level >> \ -DFAISS_ENABLE_C_API=ON \ -DPYTHON_EXECUTABLE=$(which python) \ -DCMAKE_BUILD_TYPE=Release \ -DBLA_VENDOR=Intel10_64_dyn \ -DCMAKE_CUDA_FLAGS="-gencode arch=compute_75,code=sm_75" \ . make -k -C build -j$(nproc) - run: name: C++ tests command: | export GTEST_OUTPUT="xml:$(realpath .)/test-results/googletest/" make -C build test - run: name: Install Python extension command: | cd build/faiss/python python setup.py install - run: name: Python tests (CPU only) command: | conda install -y -q pytorch -c pytorch pytest --junitxml=test-results/pytest/results.xml tests/test_*.py pytest --junitxml=test-results/pytest/results-torch.xml tests/torch_*.py - store_test_results: path: test-results workflows: version: 2 build: jobs: - build_cmake: name: Linux x86_64 AVX512 (cmake) exec: linux-x86_64-cpu opt_level: "avx512"