-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade tox test; create lint workflow (#349)
* update test workflow settings * upgrade install script, use py39 * add pandas version clause for py39 * add notest option to tox * upload lint workflow config * update cuda path, fix python version to base python, no need to use tox-go-actions * fix: specify runs-on * fix: pre-commit py38 clause; drop py312; fix RUN_SETTINGS names * fix python_version clause; fix py36 in ubuntu * fix: change order to prevent early overwritting * clean up unused * fix: tox py38 clause * fix: gha python version dict; pyg-lib * drop py36 * upgrade numpy and numba * downgrade numpy for compatibilty with numba * add py37 and py311 support in setup cfg * drop py37 * disable pyg-lib due to incompatibillity with windows * readme: installation versions * min require py38
- Loading branch information
Showing
8 changed files
with
119 additions
and
44 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run_lint_and_install_test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
pip install tox tox-gh-actions -U | ||
- name: Lint and test installation with tox | ||
run: tox | ||
env: | ||
RUN_SETTINGS: cpu-notest |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,8 +110,8 @@ as well as easily reproducible experiments by providing unified tools for | |
The full installation process might be a bit tedious and could involve some debugging when using CUDA enabled packages. | ||
Thus, we provide an `install.sh` script that simplifies the installation process, assuming the user have [conda](https://conda.io/projects/conda/en/latest/index.html) set up on their machines. | ||
The installation script creates a conda environment `dance` and install the DANCE package along with all its dependencies with a apseicifc CUDA version. | ||
Currently, two options are accepted: `cpu` and `cu117`. | ||
For example, to install the DANCE package using CUDA11.7 in a `dance-env` conda environment, simply run: | ||
Currently, two options are accepted: `cpu` and `cu118`. | ||
For example, to install the DANCE package using CUDA 11.8 in a `dance-env` conda environment, simply run: | ||
|
||
```bash | ||
# Clone the repository via SSH | ||
|
@@ -120,7 +120,7 @@ git clone [email protected]:OmicsML/dance.git && cd dance | |
# git clone https://github.com/OmicsML/dance.git && cd dance | ||
|
||
# Run the auto installation script to install DANCE and its dependencies in a conda environment | ||
source install.sh cu117 dance-env | ||
source install.sh cu118 dance-env | ||
``` | ||
|
||
**Note**: the first argument for cuda version is mandatory, while the second argument for conda environment name is optional (default is `dance`). | ||
|
@@ -140,17 +140,17 @@ conda create -n dance python=3.8 -y && conda activate dance-dev | |
Then, install CUDA enabled packages (PyTorch, PyG, DGL): | ||
|
||
```bash | ||
conda install pytorch=2.0.0 torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia -y | ||
conda install pyg=2.3.0 -c pyg -y | ||
conda install dgl=1.0.1 -c dglteam/label/cu117 -y | ||
conda install pytorch=2.0.1 torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia -y | ||
conda install pyg=2.3.1 -c pyg -y | ||
conda install dgl=1.1.2 -c dglteam/label/cu118 -y | ||
``` | ||
|
||
Alternatively, install these dependencies for CPU only: | ||
|
||
```bash | ||
conda install pytorch=2.0.0 torchvision torchaudio cpuonly -c pytorch -y | ||
conda install pyg=2.3.0 -c pyg -y | ||
conda install dgl -c dglteam -y | ||
conda install pytorch=2.0.1 torchvision torchaudio cpuonly -c pytorch -y | ||
conda install pyg=2.3.1 -c pyg -y | ||
conda install dgl=1.1.2 -c dglteam -y | ||
``` | ||
|
||
For more information about installation or other CUDA version options, check out the installation pages for the corresponding packages | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,66 @@ | ||
[tox] | ||
minversion = 3.8.0 | ||
envlist = python3.8-{osx,cpu,gpu} | ||
envlist = py3{7,8,9,10,11}-{cpu,osx,gpu}-{notest,test} | ||
isolated_build = true | ||
|
||
[gh-actions] | ||
python = | ||
3.8: py38 | ||
3.9: py39 | ||
3.10: py310 | ||
3.11: py311 | ||
|
||
[gh-actions:env] | ||
RUN_SETTINGS = | ||
cpu-test: cpu-test | ||
osx-test: osx-test | ||
gpu-test: gpu-test | ||
cpu-notest: cpu-notest | ||
osx-notest: osx-notest | ||
gpu-notest: gpu-notest | ||
|
||
[testenv] | ||
setenv = | ||
PYTHONPATH = {toxinidir} | ||
extras = | ||
dev | ||
commands = | ||
# First upgrade pip | ||
pip install -U pip | ||
|
||
# Install torch related dependencies with CUDA 10.2 | ||
gpu: pip install torch==1.12.1+cu102 torchvision==0.13.1+cu102 --extra-index-url https://download.pytorch.org/whl/cu102 | ||
cpu: pip install torch==1.12.1+cpu torchvision==0.13.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu | ||
osx: pip install torch==1.12.1 torchvision==0.13.1 | ||
# Install torch related dependencies with CUDA 11.8 | ||
gpu: pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118 | ||
cpu: pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cpu | ||
osx: pip install torch==2.0.1 torchvision==0.15.2 | ||
|
||
# Custom installation for PyG, cf. https://github.com/rusty1s/pytorch_scatter/pull/268 | ||
gpu: pip install torch-scatter torch-sparse torch-cluster torch-geometric -f https://data.pyg.org/whl/torch-1.12.1+cu102.html | ||
{cpu,osx}: pip install torch-geometric==2.1.0 torch-scatter torch-sparse torch-cluster -f https://data.pyg.org/whl/torch-1.12.1+cpu.html | ||
pip install torch_geometric==2.3.1 | ||
# gpu: pip install pyg-lib==0.2.0 -f https://data.pyg.org/whl/torch-2.0.0+cu118.html | ||
# {cpu,osx}: pip install pyg-lib==0.2.0 -f https://data.pyg.org/whl/torch-2.0.0+cpu.html | ||
|
||
# Custom installation for DGL | ||
gpu: pip install dgl-cu102 -f https://data.dgl.ai/wheels/repo.html | ||
{cpu,osx}: pip install dgl -f https://data.dgl.ai/wheels/repo.html | ||
gpu: pip install dgl==1.1.2 -f https://data.dgl.ai/wheels/cu118/repo.html | ||
{cpu,osx}: pip install dgl==1.1.2 -f https://data.dgl.ai/wheels/repo.html | ||
|
||
### PyTorch 1.12.1, PyG 2.1.0, DGL 1.0, CUDA 10.2 | ||
# gpu: pip install torch==1.12.1+cu102 torchvision==0.13.1+cu102 --extra-index-url https://download.pytorch.org/whl/cu102 | ||
# cpu: pip install torch==1.12.1+cpu torchvision==0.13.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu | ||
# osx: pip install torch==1.12.1 torchvision==0.13.1 | ||
# # Custom installation for PyG, cf. https://github.com/rusty1s/pytorch_scatter/pull/268 | ||
# gpu: pip install torch-scatter torch-sparse torch-cluster torch-geometric -f https://data.pyg.org/whl/torch-1.12.1+cu102.html | ||
# {cpu,osx}: pip install torch-geometric==2.1.0 torch-scatter torch-sparse torch-cluster -f https://data.pyg.org/whl/torch-1.12.1+cpu.html | ||
# # Custom installation for DGL | ||
# gpu: pip install dgl-cu102 -f https://data.dgl.ai/wheels/repo.html | ||
# {cpu,osx}: pip install dgl -f https://data.dgl.ai/wheels/repo.html | ||
|
||
# Install the rest of the dependencies | ||
pip install -r {toxinidir}/requirements.txt | ||
|
||
# Check installation | ||
python --version | ||
python -c "import torch; print(f'Successfully installed pytorch {torch.__version__}')" | ||
python -c "import torch_geometric, torch_geometric.nn; print(f'Successfully installed pyg {torch_geometric.__version__}')" | ||
python -c "import dgl; print(f'Successfully installed dgl {dgl.__version__}')" | ||
python -c "import dance; print(f'Successfully installed dance {dance.__version__}')" | ||
|
||
# Run tests | ||
pytest tests/ -v | ||
test: pytest tests/ -v |