test-ipu workflow (datamol-io/graphium)
The test-ipu workflow from datamol-io/graphium, explained and optimized by Latchkey.
CI health: B - good
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the test-ipu workflow from the datamol-io/graphium repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: test-ipu
on:
push:
branches: ["main"]
tags: ["*"]
pull_request:
branches:
- "*"
- "!gh-pages"
schedule:
- cron: "0 4 * * *"
jobs:
test-ipu:
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
pytorch-version: ["2.0"]
runs-on: "ubuntu-20.04"
timeout-minutes: 30
defaults:
run:
shell: bash -l {0}
name: |
poptorch_env -
python=${{ matrix.python-version }} -
pytorch=${{ matrix.pytorch-version }}
steps:
- name: Checkout the code
uses: actions/checkout@v3
- name: Activate SDK + Install Requirements
run: |
python3 -m pip install --upgrade pip
wget -q -O 'poplar_sdk-ubuntu_20_04-3.3.0-208993bbb7.tar.gz' 'https://downloads.graphcore.ai/direct?package=poplar-poplar_sdk_ubuntu_20_04_3.3.0_208993bbb7-3.3.0&file=poplar_sdk-ubuntu_20_04-3.3.0-208993bbb7.tar.gz'
tar -xzf poplar_sdk-ubuntu_20_04-3.3.0-208993bbb7.tar.gz
python3 -m pip install poplar_sdk-ubuntu_20_04-3.3.0+1403-208993bbb7/poptorch-3.3.0+113432_960e9c294b_ubuntu_20_04-cp38-cp38-linux_x86_64.whl
# Enable Poplar SDK (including Poplar and PopART)
source poplar_sdk-ubuntu_20_04-3.3.0+1403-208993bbb7/enable
python -c "import poptorch"
# Download the datafiles (Total ~ 10Mb - nothing compared to the libraries)
wget https://storage.valencelabs.com/graphium/datasets/neurips_2023/Small-dataset/ZINC12k.csv.gz
wget https://storage.valencelabs.com/graphium/datasets/neurips_2023/Small-dataset/Tox21-7k-12-labels.csv.gz
wget https://storage.valencelabs.com/graphium/datasets/neurips_2023/Small-dataset/qm9.csv.gz
# Install the IPU specific and graphium requirements
pip install -r requirements_ipu.txt
# Install Graphium in dev mode
python -m pip install --no-deps -e .
python3 -m pytest -m 'not skip_ipu'
- name: Codecov Upload
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: false
env_vars: ${{ matrix.python-version }},${{ matrix.pytorch-version }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: test-ipu on: push: branches: ["main"] tags: ["*"] pull_request: branches: - "*" - "!gh-pages" schedule: - cron: "0 4 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test-ipu: strategy: fail-fast: false matrix: python-version: ["3.8"] pytorch-version: ["2.0"] runs-on: "ubuntu-20.04" timeout-minutes: 30 defaults: run: shell: bash -l {0} name: | poptorch_env - python=${{ matrix.python-version }} - pytorch=${{ matrix.pytorch-version }} steps: - name: Checkout the code uses: actions/checkout@v3 - name: Activate SDK + Install Requirements run: | python3 -m pip install --upgrade pip wget -q -O 'poplar_sdk-ubuntu_20_04-3.3.0-208993bbb7.tar.gz' 'https://downloads.graphcore.ai/direct?package=poplar-poplar_sdk_ubuntu_20_04_3.3.0_208993bbb7-3.3.0&file=poplar_sdk-ubuntu_20_04-3.3.0-208993bbb7.tar.gz' tar -xzf poplar_sdk-ubuntu_20_04-3.3.0-208993bbb7.tar.gz python3 -m pip install poplar_sdk-ubuntu_20_04-3.3.0+1403-208993bbb7/poptorch-3.3.0+113432_960e9c294b_ubuntu_20_04-cp38-cp38-linux_x86_64.whl # Enable Poplar SDK (including Poplar and PopART) source poplar_sdk-ubuntu_20_04-3.3.0+1403-208993bbb7/enable python -c "import poptorch" # Download the datafiles (Total ~ 10Mb - nothing compared to the libraries) wget https://storage.valencelabs.com/graphium/datasets/neurips_2023/Small-dataset/ZINC12k.csv.gz wget https://storage.valencelabs.com/graphium/datasets/neurips_2023/Small-dataset/Tox21-7k-12-labels.csv.gz wget https://storage.valencelabs.com/graphium/datasets/neurips_2023/Small-dataset/qm9.csv.gz # Install the IPU specific and graphium requirements pip install -r requirements_ipu.txt # Install Graphium in dev mode python -m pip install --no-deps -e . python3 -m pytest -m 'not skip_ipu' - name: Codecov Upload uses: codecov/codecov-action@v3 with: files: ./coverage.xml flags: unittests name: codecov-umbrella fail_ci_if_error: false verbose: false env_vars: ${{ matrix.python-version }},${{ matrix.pytorch-version }}
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
- Network fetches
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.