Benchmark Collection #10580
This file contains hidden or 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
| name: Benchmark Collection | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'release*' | |
| pull_request: | |
| branches: | |
| - main | |
| merge_group: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '48 4 * * *' | |
| jobs: | |
| cpp: | |
| name: Benchmark Collection CPP | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ "3.14" ] | |
| extract_subexpressions: ["true", "false"] | |
| env: | |
| AMICI_EXTRACT_CSE: ${{ matrix.extract_subexpressions }} | |
| steps: | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 20 | |
| - name: Install apt dependencies | |
| uses: ./.github/actions/install-apt-dependencies | |
| - run: echo "${HOME}/.local/bin/" >> $GITHUB_PATH | |
| # install AMICI | |
| - name: Create AMICI sdist | |
| run: pip3 install build && cd python/sdist && python3 -m build --sdist | |
| - name: Install AMICI sdist | |
| run: | | |
| pip3 install --user petab[vis] && \ | |
| AMICI_PARALLEL_COMPILE="" pip3 install -v --user \ | |
| $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,test,vis,jax] | |
| - name: Install test dependencies | |
| run: | | |
| python3 -m pip uninstall -y petab && python3 -m pip install git+https://github.com/petab-dev/libpetab-python.git@main \ | |
| && python3 -m pip install -U sympy \ | |
| && python3 -m pip install git+https://github.com/ICB-DCM/fiddy.git@main | |
| - name: Download benchmark collection | |
| run: | | |
| pip install git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python | |
| - name: Run tests | |
| env: | |
| AMICI_PARALLEL_COMPILE: "" | |
| run: | | |
| pytest tests/benchmark_models/test_petab_benchmark.py \ | |
| --durations=10 \ | |
| --cov=amici \ | |
| --cov-report=xml:"coverage_py.xml" \ | |
| --cov-append \ | |
| - name: Codecov Python | |
| if: (github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev') && github.actor != 'dependabot[bot]' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage_py.xml | |
| flags: python | |
| fail_ci_if_error: true | |
| verbose: true | |
| # collect & upload results | |
| - name: Aggregate results | |
| run: | | |
| python3 tests/benchmark_models/evaluate_benchmark.py | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: computation-times-${{ matrix.python-version }}-${{ matrix.extract_subexpressions }} | |
| path: | | |
| tests/benchmark_models/computation_times.csv | |
| tests/benchmark_models/computation_times.png | |
| jax: | |
| name: Benchmark Collection JAX | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [ "3.14" ] | |
| extract_subexpressions: ["false"] | |
| env: | |
| AMICI_EXTRACT_CSE: ${{ matrix.extract_subexpressions }} | |
| steps: | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 20 | |
| - name: Install apt dependencies | |
| uses: ./.github/actions/install-apt-dependencies | |
| - run: echo "${HOME}/.local/bin/" >> $GITHUB_PATH | |
| - name: Create AMICI sdist | |
| run: pip3 install build && cd python/sdist && python3 -m build --sdist | |
| - name: Install AMICI sdist | |
| run: | | |
| pip3 install --user petab[vis] && \ | |
| pip3 install -v --user \ | |
| $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,test,vis,jax] | |
| - name: Install test dependencies | |
| run: | | |
| python3 -m pip uninstall -y petab && python3 -m pip install git+https://github.com/petab-dev/libpetab-python.git@main \ | |
| && python3 -m pip install -U sympy \ | |
| && python3 -m pip install git+https://github.com/ICB-DCM/fiddy.git@amici100 | |
| - run: pip uninstall -y diffrax && pip install git+https://github.com/patrick-kidger/diffrax@dev # TODO FIXME https://github.com/patrick-kidger/diffrax/issues/654 + event dirs | |
| - name: Download benchmark collection | |
| run: | | |
| pip install git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python | |
| - name: Run JAX tests | |
| env: | |
| AMICI_PARALLEL_COMPILE: "" | |
| run: | | |
| pytest tests/benchmark_models/test_petab_benchmark_jax.py \ | |
| --durations=10 \ | |
| --cov=amici \ | |
| --cov-report=xml:"coverage_py.xml" \ | |
| --cov-append | |
| - name: Codecov Python | |
| if: (github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev') && github.actor != 'dependabot[bot]' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage_py.xml | |
| flags: python | |
| fail_ci_if_error: true | |
| verbose: true |