New combination #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build xformers package | |
on: [workflow_dispatch, push] | |
env: | |
CONDA_DIR: /opt/conda | |
jobs: | |
example_matrix: | |
strategy: | |
matrix: | |
CUDA_MAJOR: ['11'] | |
CUDA_MINOR: ['3'] | |
CUDA_PATCH: ['1'] | |
PYTHON_MAJOR: ['3'] | |
PYTHON_MINOR: ['9'] | |
XFORMERS_VERSION: ['v0.0.19'] | |
PYTORCH_VERSION: ['1.12.1'] | |
runs-on: ubuntu-latest | |
container: nvidia/cuda:${{ matrix.CUDA_MAJOR }}.${{ matrix.CUDA_MINOR }}.${{ matrix.CUDA_PATCH}}-devel-ubuntu20.04 | |
steps: | |
- run: | | |
apt update && \ | |
apt install -y --no-install-recommends ca-certificates wget git | |
- run: | | |
git clone -b ${{ matrix.XFORMERS_VERSION }} https://github.com/facebookresearch/xformers.git | |
cd ./xformers | |
git submodule update --init --recursive | |
- name: Install miniconda | |
env: | |
CONDA_VERSION: py${{ matrix.PYTHON_MAJOR}}${{ matrix.PYTHON_MINOR }}_22.11.1-1 | |
run: | | |
wget -q -O ./miniconda.sh http://repo.continuum.io/miniconda/Miniconda3-${{ env.CONDA_VERSION}}-Linux-x86_64.sh | |
bash ./miniconda.sh -bfp ${{ env.CONDA_DIR }} | |
rm ./miniconda.sh | |
echo PATH=${{ env.CONDA_DIR}}/bin:$PATH >> $GITHUB_ENV | |
- name: Install torch | |
run: pip install twine ninja torch==${{ matrix.PYTORCH_VERSION }}+cu${{ matrix.CUDA_MAJOR}}${{ matrix.CUDA_MINOR }} torchvision==0.13.1+cu${{ matrix.CUDA_MAJOR}}${{ matrix.CUDA_MINOR }} --extra-index-url https://download.pytorch.org/whl/cu${{ matrix.CUDA_MAJOR}}${{ matrix.CUDA_MINOR }} | |
- name: Build | |
working-directory: ./xformers | |
env: | |
TORCH_CUDA_ARCH_LIST: "7.0;7.5;8.0;8.6+PTX" | |
FORCE_CUDA: '1' | |
CUDA_VERSION: ${{ matrix.CUDA_MAJOR}}.${{ matrix.CUDA_MINOR }} | |
run: python ./setup.py bdist_wheel | |
- name: Upload package | |
working-directory: ./xformers/dist | |
env: | |
TWINE_REPOSITORY_URL : ${{ secrets.PYPI_PROD_URL }} | |
TWINE_USERNAME : ${{ secrets.PYPI_USER }} | |
TWINE_PASSWORD : ${{ secrets.PYPI_PASS }} | |
run: twine upload --skip-existing --non-interactive ./*.whl | |