Skip to content

Integrate checkpoint_schedules library #845

Integrate checkpoint_schedules library

Integrate checkpoint_schedules library #845

name: test-tlm_adjoint-firedrake
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-real:
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: firedrakeproject/firedrake:latest
options: --user root
env:
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'tlm_adjoint'
- name: Install dependencies
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m pip install jax[cpu] ruff pytest-timeout pytest-xdist
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
git clone --depth 1 https://github.com/jrmaddison/checkpoint_schedules -b jrmaddison/mixed_update
- name: Lint
run: |
. /home/firedrake/firedrake/bin/activate
cd tlm_adjoint
flake8
ruff check
- name: Run tests
run: |
. /home/firedrake/firedrake/bin/activate
export PYTHONPATH=$PWD/checkpoint_schedules:$PYTHONPATH
cd tlm_adjoint
pytest -v tests/base tests/checkpoint_schedules tests/firedrake -n 2 --timeout=300 --timeout-method=thread
test-complex:
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: firedrakeproject/firedrake-complex:latest
options: --user root
env:
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'tlm_adjoint'
- name: Install dependencies
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m pip install jax[cpu] ruff pytest-timeout pytest-xdist
python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu
git clone --depth 1 https://github.com/jrmaddison/checkpoint_schedules -b jrmaddison/mixed_update
- name: Lint
run: |
. /home/firedrake/firedrake/bin/activate
cd tlm_adjoint
flake8
ruff check
- name: Run tests
run: |
. /home/firedrake/firedrake/bin/activate
export PYTHONPATH=$PWD/checkpoint_schedules:$PYTHONPATH
cd tlm_adjoint
pytest -v tests/base tests/checkpoint_schedules tests/firedrake -n 2 --timeout=300 --timeout-method=thread