Skip to content

Commit

Permalink
Add ARM64 build to build_cmake actions for SVE (facebookresearch#3653)
Browse files Browse the repository at this point in the history
Summary:
Add instructions to download arm64 specific conda dependencies and cmake command and run it on CI. This should prepare us to turn on CI with SVE optimization

Pull Request resolved: facebookresearch#3653

Reviewed By: ramilbakhshyiev

Differential Revision: D60043435

Pulled By: mengdilin

fbshipit-source-id: d81bb1c1022681c3da8f98bbf080d5e1d65d6b80
  • Loading branch information
mengdilin authored and facebook-github-bot committed Jul 27, 2024
1 parent 4cfa638 commit 34bbe5e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 16 deletions.
60 changes: 44 additions & 16 deletions .github/actions/build_cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,20 @@ runs:
conda update -y -q conda
echo "$CONDA/bin" >> $GITHUB_PATH
# install base packages
conda install -y -q -c conda-forge gxx_linux-64=11.2 sysroot_linux-64=2.28
conda install -y -q python=3.11 cmake make swig mkl=2023 mkl-devel=2023 numpy scipy pytest
conda install -y -q python=3.11 cmake make swig numpy scipy pytest
# install base packages for ARM64
if [ "${{ runner.arch }}" = "ARM64" ]; then
conda install -y -q -c conda-forge openblas gxx_linux-aarch64 sysroot_linux-aarch64
fi
# install base packages for X86_64
if [ "${{ runner.arch }}" = "X64" ]; then
# TODO: unpin versions for gxx_linux-64 and sysroot_linux-64 and merge it with ARM64 below
conda install -y -q -c conda-forge gxx_linux-64=11.2 sysroot_linux-64=2.28
conda install -y -q mkl=2023 mkl-devel=2023
fi
# install CUDA packages
if [ "${{ inputs.gpu }}" = "ON" ] && [ "${{ inputs.raft }}" = "OFF" ]; then
Expand All @@ -54,18 +65,35 @@ runs:
run: |
eval "$(conda shell.bash hook)"
conda activate
cmake -B build \
-DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS=ON \
-DFAISS_ENABLE_GPU=${{ inputs.gpu }} \
-DFAISS_ENABLE_RAFT=${{ inputs.raft }} \
-DFAISS_OPT_LEVEL=${{ inputs.opt_level }} \
-DFAISS_ENABLE_C_API=ON \
-DPYTHON_EXECUTABLE=$CONDA/bin/python \
-DCMAKE_BUILD_TYPE=Release \
-DBLA_VENDOR=Intel10_64_dyn \
-DCMAKE_CUDA_FLAGS="-gencode arch=compute_75,code=sm_75" \
.
if [ "${{ runner.arch }}" = "X64" ]; then
cmake -B build \
-DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS=ON \
-DFAISS_ENABLE_GPU=${{ inputs.gpu }} \
-DFAISS_ENABLE_RAFT=${{ inputs.raft }} \
-DFAISS_OPT_LEVEL=${{ inputs.opt_level }} \
-DFAISS_ENABLE_C_API=ON \
-DPYTHON_EXECUTABLE=$CONDA/bin/python \
-DCMAKE_BUILD_TYPE=Release \
-DBLA_VENDOR=Intel10_64_dyn \
-DCMAKE_CUDA_FLAGS="-gencode arch=compute_75,code=sm_75" \
.
elif [ "${{ runner.arch }}" = "ARM64" ]; then
cmake -B build \
-DBUILD_TESTING=ON \
-DBUILD_SHARED_LIBS=ON \
-DFAISS_ENABLE_GPU=${{ inputs.gpu }} \
-DFAISS_ENABLE_RAFT=${{ inputs.raft }} \
-DFAISS_OPT_LEVEL=${{ inputs.opt_level }} \
-DFAISS_ENABLE_C_API=ON \
-DPYTHON_EXECUTABLE=$CONDA/bin/python \
-DCMAKE_BUILD_TYPE=Release \
.
else
echo "Encountered unexpected platform ${{ runner.arch }}"
exit 1
fi
make -k -C build -j$(nproc)
- name: C++ tests
shell: bash
Expand Down Expand Up @@ -101,5 +129,5 @@ runs:
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ inputs.opt_level }}-${{ inputs.gpu }}-${{ inputs.raft }}
name: test-results-${{ runner.arch }}-${{ inputs.opt_level }}-${{ inputs.gpu }}-${{ inputs.raft }}
path: test-results
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ jobs:
with:
gpu: ON
raft: ON
linux-arm64-SVE-cmake:
name: Linux arm64 SVE (cmake)
runs-on: faiss-aws-r8g.large
continue-on-error: true # non-blocking mode for now
steps:
- name: Checkout
continue-on-error: true # non-blocking mode for now
uses: actions/checkout@v4
- uses: ./.github/actions/build_cmake
continue-on-error: true # non-blocking mode for now
# TODO(T197096427): uncomment this once SVE PR is merged
# with:
# opt_level: sve
linux-x86_64-conda:
name: Linux x86_64 (conda)
needs: linux-x86_64-cmake
Expand Down

0 comments on commit 34bbe5e

Please sign in to comment.