-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GPU-enabled CI #170
Merged
Merged
Add GPU-enabled CI #170
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c428d42
Add GPU-enabled CI
mattwthompson 7f5caaf
Update file reference
mattwthompson ac1d711
Remove other CI
mattwthompson dbf95db
Bump runner version
mattwthompson 92f87da
Merge remote-tracking branch 'upstream/main' into gpu-ci
mattwthompson ec635c2
Try allocating 10 GB
mattwthompson 4264306
Debug
mattwthompson efdc5c3
Debug
mattwthompson 4952631
Sync CUDA environment with DGL environment
mattwthompson d166fcd
Debug Torch/CUDA interaction
mattwthompson 5572bc9
Try adding `pytorch-gpu`
mattwthompson 37a4ee8
Debug
mattwthompson 6c5f42c
tmp add print and trial test
lilyminium a9b0925
check dgl
lilyminium a74c187
add torchdata package
lilyminium 7539846
add other torch packages required
lilyminium 8d15964
Try bumping to newer DGL channel targeting PyTorch 2.1
mattwthompson b14930d
Add back `pytorch-gpu`?
mattwthompson f439845
Revert "tmp add print and trial test"
lilyminium d4456db
Revert more temporary changes, fix coverage
mattwthompson 1a4bdb5
Syntax
mattwthompson 2cf2218
Debug
mattwthompson 0711c62
Debug
mattwthompson a6340d8
Fix
mattwthompson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,98 @@ | ||
name: GPU-enabled CI | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- "main" | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
start-aws-runner: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
outputs: | ||
mapping: ${{ steps.aws-start.outputs.mapping }} | ||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role | ||
aws-region: us-east-1 | ||
- name: Create cloud runner | ||
id: aws-start | ||
uses: omsf-eco-infra/[email protected] | ||
with: | ||
provider: "aws" | ||
action: "start" | ||
aws_image_id: ami-0d5079d9be06933e5 | ||
aws_instance_type: g4dn.xlarge | ||
# IAM default might be 5 GB? | ||
aws_root_device_size: 125 | ||
aws_region_name: us-east-1 | ||
aws_home_dir: /home/ubuntu | ||
env: | ||
GH_PAT: ${{ secrets.GH_PAT }} | ||
self-hosted-test: | ||
runs-on: self-hosted | ||
needs: | ||
- start-aws-runner | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Print disk usage | ||
run: "df -h" | ||
|
||
- name: Print Docker details | ||
run: "docker version || true" | ||
|
||
- name: Setup Conda Environment | ||
uses: mamba-org/setup-micromamba@v2 | ||
with: | ||
environment-file: devtools/conda-envs/test_cuda_env.yaml | ||
|
||
- name: Install Package | ||
run: python -m pip install . --no-deps | ||
|
||
- name: Double-check local installation | ||
run: python -c "from openff.nagl import __version__; print(__version__)" | ||
|
||
- name: Check that PyTorch can see CUDA | ||
run: python -c "import torch; assert torch.cuda.is_available()" | ||
|
||
- name: Check we can see DGL | ||
run: python -c "import dgl; print(dgl.__version__)" | ||
|
||
- name: Run tests | ||
run: python -m pytest -n 4 -v --cov=openff/nagl --cov-config=pyproject.toml --cov-append --cov-report=xml --color=yes openff/nagl/ | ||
|
||
stop-aws-runner: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
needs: | ||
- start-aws-runner | ||
- self-hosted-test | ||
if: ${{ always() }} | ||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role | ||
aws-region: us-east-1 | ||
- name: Stop instances | ||
uses: omsf-eco-infra/[email protected] | ||
with: | ||
provider: "aws" | ||
action: "stop" | ||
instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }} | ||
aws_region_name: us-east-1 | ||
env: | ||
GH_PAT: ${{ secrets.GH_PAT }} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small quirk: since
setup.cfg
exists, this won't throw an error (until that changes, anyway) but it won't pick up any actual configs as they're inpyproject.toml
. A leftover detail from #169