Skip to content

Commit

Permalink
add GPU-based runner on cirun.io
Browse files Browse the repository at this point in the history
  • Loading branch information
leifdenby committed Jun 3, 2024
1 parent 4d78c68 commit 2f6a87a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .cirun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# setup for using github runners via https://cirun.io/
runners:
- name: "aws-runner"
# Cloud Provider: AWS
cloud: "aws"
# https://aws.amazon.com/ec2/instance-types/g4/
instance_type: "g4dn.xlarge"
# Ubuntu-20.4, ami image
machine_image: "ami-06fd8a495a537da8b"
preemptible: false
# Add this label in the "runs-on" param in .github/workflows/<workflow-name>.yml
# So that this runner is created for running the workflow
labels:
- "cirun-aws-runner"
27 changes: 27 additions & 0 deletions .github/workflows/ci-pip-install-and-test-gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# cicd workflow for running tests with pytest
# needs to first install pdm, then install torch cpu manually and then install the package
# then run the tests

name: test (pip install, gpu)

on: [push, pull_request]

jobs:
tests:
runs-on: "cirun-aws-runner--${{ github.run_id }}"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install torch (GPU CUDA 12.1)
run: |
python -m pip install torch --index-url https://download.pytorch.org/whl/cu121
- name: Install package (including dev dependencies)
run: |
python -m pip install .
python -m pip install pytest
- name: Run tests
run: |
python -m pytest

0 comments on commit 2f6a87a

Please sign in to comment.