Skip to content

Commit

Permalink
Start migration off defaults to conda-forge channel (#4126)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #4126

Differential Revision: D68043874
  • Loading branch information
Michael Norris authored and facebook-github-bot committed Jan 11, 2025
1 parent 3d0ac32 commit 867c439
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 24 deletions.
40 changes: 30 additions & 10 deletions .github/actions/build_cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,69 @@ runs:
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge
conda-remove-defaults: 'true'
python-version: '3.11'
miniconda-version: latest
conda-solver: classic
- name: Configure build environment
shell: bash
run: |
# initialize Conda
conda config --set solver libmamba
conda update -y -q conda
echo "*****1*****"
conda config --show channels
echo "*****2*****"
conda config --show-sources
echo "*****2.1*****"
conda config --set solver classic
echo "*****2.2*****"
conda update -c conda-forge -y -q conda --override-channels
echo "$CONDA/bin" >> $GITHUB_PATH
echo "*****3*****"
conda config --show channels
# echo "*****4*****"
# conda install -c conda-forge --solver=classic conda-forge::conda-libmamba-solver conda-forge::libmamba conda-forge::libmambapy conda-forge::libarchive --override-channels
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
echo "*****4.1*****"
conda install -c conda-forge -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 --override-channels
echo "*****5*****"
conda config --show channels
echo "*****6*****"
# install base packages for ARM64
if [ "${{ runner.arch }}" = "ARM64" ]; then
conda install -y -q -c conda-forge openblas=0.3 gxx_linux-aarch64=14.2 sysroot_linux-aarch64=2.17
conda install -c conda-forge -y -q openblas=0.3 gxx_linux-aarch64=14.2 sysroot_linux-aarch64=2.17 --override-channels
fi
# install base packages for X86_64
if [ "${{ runner.arch }}" = "X64" ]; then
# TODO: merge this with ARM64
conda install -y -q -c conda-forge gxx_linux-64=14.2 sysroot_linux-64=2.17
conda install -y -q mkl=2023 mkl-devel=2023
conda install -c conda-forge -y -q gxx_linux-64=14.2 sysroot_linux-64=2.17 --override-channels
conda install -c conda-forge -y -q mkl=2023 mkl-devel=2023 --override-channels
fi
# no CUDA needed for ROCm so skip this
if [ "${{ inputs.rocm }}" = "ON" ]; then
:
# regular CUDA for GPU builds
elif [ "${{ inputs.gpu }}" = "ON" ] && [ "${{ inputs.cuvs }}" = "OFF" ]; then
conda install -y -q cuda-toolkit=12.4 -c "nvidia/label/cuda-12.4.0"
conda install -c conda-forge -y -q cuda-toolkit=12.4 -c "nvidia/label/cuda-12.4.0" --override-channels
# and CUDA from cuVS channel for cuVS builds
elif [ "${{ inputs.cuvs }}" = "ON" ]; then
conda install -y -q libcuvs=24.12 'cuda-version>=12.0,<=12.5' cuda-toolkit=12.4.1 gxx_linux-64=12.4 -c rapidsai -c conda-forge
conda install -c conda-forge -y -q libcuvs=24.12 'cuda-version>=12.0,<=12.5' cuda-toolkit=12.4.1 gxx_linux-64=12.4 -c rapidsai --override-channels
fi
# install test packages
if [ "${{ inputs.rocm }}" = "ON" ]; then
: # skip torch install via conda, we need to install via pip to get
# ROCm-enabled version until it's supported in conda by PyTorch
elif [ "${{ inputs.gpu }}" = "ON" ]; then
conda install -y -q "pytorch<2.5" pytorch-cuda=12.4 -c pytorch -c "nvidia/label/cuda-12.4.0"
conda install -c conda-forge -y -q "pytorch<2.5" pytorch-cuda=12.4 -c pytorch -c "nvidia/label/cuda-12.4.0" --override-channels
else
conda install -y -q "pytorch<2.5" -c pytorch
conda install -c conda-forge -y -q "pytorch<2.5" -c pytorch --override-channels
fi
echo "*****7*****"
conda config --show channels
- name: ROCm - Install dependencies
if: inputs.rocm == 'ON'
shell: bash
Expand Down
32 changes: 18 additions & 14 deletions .github/actions/build_conda/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ runs:
with:
python-version: '3.11'
miniconda-version: latest
channels: conda-forge
conda-remove-defaults: "true"
- name: Install conda build tools
shell: ${{ steps.choose_shell.outputs.shell }}
run: |
conda install -y -q "conda!=24.11.0"
conda install -y -q "conda-build!=24.11.0"
conda install -c conda-forge -y -q "conda!=24.11.0" --override-channels
conda install -c conda-forge -y -q "conda-build!=24.11.0" --override-channels
- name: Fix CI failure
shell: ${{ steps.choose_shell.outputs.shell }}
if: runner.os != 'Windows'
Expand All @@ -46,51 +48,53 @@ runs:
env:
PACKAGE_TYPE: ${{ inputs.label }}
run: |
conda install -y -q anaconda-client
conda config --set anaconda_upload yes
conda install -c conda-forge -y -q anaconda-client --override-channels
conda config -c conda-forge --set anaconda_upload yes --override-channels
- name: Conda build (CPU)
if: inputs.label == '' && inputs.cuda == ''
shell: ${{ steps.choose_shell.outputs.shell }}
working-directory: conda
run: |
conda build faiss --python 3.11 -c pytorch
conda build -c conda-forge faiss --python 3.11 -c pytorch --override-channels
- name: Conda build (CPU) w/ anaconda upload
if: inputs.label != '' && inputs.cuda == ''
shell: ${{ steps.choose_shell.outputs.shell }}
working-directory: conda
env:
PACKAGE_TYPE: ${{ inputs.label }}
run: |
conda build faiss --user pytorch --label ${{ inputs.label }} -c pytorch
conda build -c conda-forge faiss --user pytorch --label ${{ inputs.label }} -c pytorch --override-channels
- name: Conda build (GPU)
if: inputs.label == '' && inputs.cuda != '' && inputs.cuvs == ''
shell: ${{ steps.choose_shell.outputs.shell }}
working-directory: conda
run: |
conda build faiss-gpu --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \
-c pytorch -c nvidia/label/cuda-${{ inputs.cuda }} -c nvidia
conda build -c conda-forge faiss-gpu --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \
-c pytorch -c nvidia/label/cuda-${{ inputs.cuda }} -c nvidia --override-channels
- name: Conda build (GPU) w/ anaconda upload
if: inputs.label != '' && inputs.cuda != '' && inputs.cuvs == ''
shell: ${{ steps.choose_shell.outputs.shell }}
working-directory: conda
env:
PACKAGE_TYPE: ${{ inputs.label }}
run: |
conda build faiss-gpu --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \
--user pytorch --label ${{ inputs.label }} -c pytorch -c nvidia/label/cuda-${{ inputs.cuda }} -c nvidia
conda build -c conda-forge faiss-gpu --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \
--user pytorch --label ${{ inputs.label }} -c pytorch -c nvidia/label/cuda-${{ inputs.cuda }} \
-c nvidia --override-channels
- name: Conda build (GPU w/ cuVS)
if: inputs.label == '' && inputs.cuda != '' && inputs.cuvs != ''
shell: ${{ steps.choose_shell.outputs.shell }}
working-directory: conda
run: |
conda build faiss-gpu-cuvs --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \
-c pytorch -c rapidsai -c rapidsai-nightly -c conda-forge -c nvidia
conda build -c conda-forge faiss-gpu-cuvs --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \
-c pytorch -c rapidsai -c rapidsai-nightly -c nvidia --override-channels
- name: Conda build (GPU w/ cuVS) w/ anaconda upload
if: inputs.label != '' && inputs.cuda != '' && inputs.cuvs != ''
shell: ${{ steps.choose_shell.outputs.shell }}
working-directory: conda
env:
PACKAGE_TYPE: ${{ inputs.label }}
run: |
conda build faiss-gpu-cuvs --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \
--user pytorch --label ${{ inputs.label }} -c pytorch -c rapidsai -c rapidsai-nightly -c conda-forge -c nvidia
conda build -c conda-forge faiss-gpu-cuvs --variants '{ "cudatoolkit": "${{ inputs.cuda }}" }' \
--user pytorch --label ${{ inputs.label }} -c pytorch -c rapidsai -c rapidsai-nightly \
-c nvidia --override-channels

0 comments on commit 867c439

Please sign in to comment.