From cf32f75ddb8084463c3bbade0eef998623b03a4f Mon Sep 17 00:00:00 2001 From: Ramil Bakhshyiev Date: Mon, 29 Jul 2024 18:04:42 -0700 Subject: [PATCH] Merge cmake command in the cmake build action (#3702) Summary: Simplify the cmake command in the cmake build action Differential Revision: D60427830 --- .github/actions/build_cmake/action.yml | 42 ++++++++------------------ .github/workflows/build.yml | 1 - 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/.github/actions/build_cmake/action.yml b/.github/actions/build_cmake/action.yml index 873daacc1e..419dbbf691 100644 --- a/.github/actions/build_cmake/action.yml +++ b/.github/actions/build_cmake/action.yml @@ -64,36 +64,20 @@ runs: shell: bash run: | eval "$(conda shell.bash hook)" + echo "${{ runner.arch }}" conda activate - - 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 + 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=${{ runner.arch == 'ARM64' && '' || 'Intel10_64_dyn' }} \ + -DCMAKE_CUDA_FLAGS=${{ runner.arch == 'ARM64' && '' || '"-gencode arch=compute_75,code=sm_75"' }} \ + . make -k -C build -j$(nproc) - name: C++ tests shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b10ddd6fae..c0eca51393 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,6 @@ jobs: raft: ON linux-arm64-SVE-cmake: name: Linux arm64 SVE (cmake) - needs: linux-x86_64-cmake runs-on: faiss-aws-r8g.large continue-on-error: true # non-blocking mode for now steps: