Debian Codegraph @

.github/workflows/building.yml

raw symbols SCIP
1 name: Building Wheels
2
3 on: [workflow_dispatch]
4
5 jobs:
6
7 wheel:
8 runs-on: ${{ matrix.os }}
9
10 strategy:
11 fail-fast: false
12 matrix:
13 os: [ubuntu-20.04, macos-11, windows-2019]
14 python-version: ['3.8', '3.9', '3.10', '3.11']
15 torch-version: [2.0.0, 2.1.0]
16 cuda-version: ['cpu', 'cu117', 'cu118', 'cu121']
17 exclude:
18 - torch-version: 2.0.0
19 cuda-version: 'cu121'
20 - torch-version: 2.1.0
21 cuda-version: 'cu117'
22 - os: macos-11
23 cuda-version: 'cu117'
24 - os: macos-11
25 cuda-version: 'cu118'
26 - os: macos-11
27 cuda-version: 'cu121'
28
29 steps:
30 - uses: actions/checkout@v2
31 - name: Set up Python ${{ matrix.python-version }}
32 uses: actions/setup-python@v2
33 with:
34 python-version: ${{ matrix.python-version }}
35
36 - name: Upgrade pip
37 run: |
38 pip install --upgrade setuptools
39 pip install scipy==1.10.1 # Python 3.8 support
40 pip list
41
42 - name: Free Disk Space (Ubuntu)
43 if: ${{ runner.os == 'Linux' }}
44 uses: jlumbroso/free-disk-space@main
45
46 - name: Install CUDA ${{ matrix.cuda-version }}
47 if: ${{ matrix.cuda-version != 'cpu' }}
48 run: |
49 bash .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}.sh
50
51 - name: Install PyTorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }}
52 run: |
53 pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ matrix.cuda-version }}
54 python -c "import torch; print('PyTorch:', torch.__version__)"
55 python -c "import torch; print('CUDA:', torch.version.cuda)"
56
57 - name: Set version
58 if: ${{ runner.os != 'macOS' }}
59 run: |
60 VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" torch_cluster/__init__.py`
61 TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
62 CUDA_VERSION=`echo ${{ matrix.cuda-version }}`
63 echo "New version name: $VERSION+$TORCH_VERSION$CUDA_VERSION"
64 sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" setup.py
65 sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" torch_cluster/__init__.py
66 shell:
67 bash
68
69 - name: Install main package for CPU
70 if: ${{ matrix.cuda-version == 'cpu' }}
71 run: |
72 FORCE_ONLY_CPU=1 python setup.py develop
73 shell:
74 bash
75
76 - name: Install main package for GPU
77 if: ${{ matrix.cuda-version != 'cpu' }}
78 run: |
79 source .github/workflows/cuda/${{ matrix.cuda-version }}-${{ runner.os }}-env.sh
80 python setup.py develop
81 shell:
82 bash
83
84 - name: Test installation
85 run: |
86 python -c "import torch_cluster; print('torch-cluster:', torch_cluster.__version__)"
87
88 - name: Build wheel
89 run: |
90 pip install wheel
91 python setup.py bdist_wheel --dist-dir=dist
92
93 - name: Configure AWS
94 uses: aws-actions/configure-aws-credentials@v1
95 with:
96 aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
97 aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
98 aws-region: us-west-1
99
100 - name: Upload wheel
101 run: |
102 aws s3 sync dist s3://data.pyg.org/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers