|
a |
|
b/.github/actions/setup/action.yaml |
|
|
1 |
name: Setup |
|
|
2 |
|
|
|
3 |
inputs: |
|
|
4 |
python-version: |
|
|
5 |
required: false |
|
|
6 |
default: '3.9' |
|
|
7 |
torch-version: |
|
|
8 |
required: false |
|
|
9 |
default: '2.0.0' |
|
|
10 |
cuda-version: |
|
|
11 |
required: false |
|
|
12 |
default: cpu |
|
|
13 |
full_install: |
|
|
14 |
required: false |
|
|
15 |
default: true |
|
|
16 |
|
|
|
17 |
runs: |
|
|
18 |
using: composite |
|
|
19 |
|
|
|
20 |
steps: |
|
|
21 |
- name: Set up Python ${{ inputs.python-version }} |
|
|
22 |
uses: actions/setup-python@v4.3.0 |
|
|
23 |
with: |
|
|
24 |
python-version: ${{ inputs.python-version }} |
|
|
25 |
check-latest: true |
|
|
26 |
cache: pip |
|
|
27 |
cache-dependency-path: | |
|
|
28 |
pyproject.toml |
|
|
29 |
|
|
|
30 |
- name: Install PyTorch ${{ inputs.torch-version }}+${{ inputs.cuda-version }} |
|
|
31 |
run: | |
|
|
32 |
pip install torch==${{ inputs.torch-version }} --extra-index-url https://download.pytorch.org/whl/${{ inputs.cuda-version }} |
|
|
33 |
python -c "import torch; print('PyTorch:', torch.__version__)" |
|
|
34 |
python -c "import torch; print('CUDA available:', torch.cuda.is_available())" |
|
|
35 |
python -c "import torch; print('CUDA:', torch.version.cuda)" |
|
|
36 |
shell: bash |
|
|
37 |
|
|
|
38 |
- name: Install extension packages |
|
|
39 |
if: ${{ inputs.full_install == 'true' }} |
|
|
40 |
run: | |
|
|
41 |
pip install scipy |
|
|
42 |
pip install --no-index --upgrade torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-${{ inputs.torch-version }}+${{ inputs.cuda-version }}.html |
|
|
43 |
shell: bash |