From c06d7ec9fba301c4c841a6e2a72322def59aa4c4 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:32:41 +0530 Subject: [PATCH 1/4] Remove version cap on `asv` benchmarks and fix periodic benchmarks --- .github/workflows/benchmark_on_push.yml | 13 +++++++++---- .github/workflows/periodic_benchmarks.yml | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/benchmark_on_push.yml b/.github/workflows/benchmark_on_push.yml index 8be4af8741..bc94a2f617 100644 --- a/.github/workflows/benchmark_on_push.yml +++ b/.github/workflows/benchmark_on_push.yml @@ -18,16 +18,20 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.8 + - name: Install Linux system dependencies run: | sudo apt-get update sudo apt install gfortran gcc libopenblas-dev + - name: Install python dependencies - # Pin asv==0.5.1 to fix failing benchmarks. Related to https://github.com/airspeed-velocity/asv/issues/1323 run: | - python -m pip install --upgrade pip wheel setuptools virtualenv asv==0.5.1 wget cmake casadi numpy - - name: Install SuiteSparse and Sundials + python -m pip install --upgrade pip wheel setuptools virtualenv wget cmake casadi numpy virtualenv packaging + python -m pip install asv + + - name: Install SuiteSparse and SUNDIALS run: python scripts/install_KLU_Sundials.py + - name: Fetch base branch run: | # This workflow also runs for merge commits @@ -49,7 +53,8 @@ jobs: HEAD_COMMIT=$(git rev-parse HEAD) echo $BASE_COMMIT | tee commits_to_compare.txt echo $HEAD_COMMIT | tee -a commits_to_compare.txt - asv run HASHFILE:commits_to_compare.txt --m "GitHubRunner" --show-stderr --strict -v + asv run HASHFILE:commits_to_compare.txt --m "GitHubRunner" --show-stderr -v + - name: Compare commits' benchmark results run: | BASE_COMMIT=$(head -1 commits_to_compare.txt) diff --git a/.github/workflows/periodic_benchmarks.yml b/.github/workflows/periodic_benchmarks.yml index ce0ad37cd2..e973eb88cc 100644 --- a/.github/workflows/periodic_benchmarks.yml +++ b/.github/workflows/periodic_benchmarks.yml @@ -20,26 +20,33 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: python-version: 3.8 + - name: Install Linux system dependencies run: | sudo apt-get update sudo apt-get install gfortran gcc libopenblas-dev + - name: Install python dependencies run: | - python -m pip install --upgrade pip wheel setuptools virtualenv asv wget cmake casadi numpy - - name: Install SuiteSparse and Sundials + python -m pip install --upgrade pip wheel setuptools virtualenv wget cmake casadi numpy virtualenv packaging + python -m pip install asv + + - name: Install SuiteSparse and SUNDIALS run: python scripts/install_KLU_Sundials.py + - name: Run benchmarks run: | asv machine --machine "GitHubRunner" - asv run --machine "GitHubRunner" NEW --show-stderr --strict -v + asv run --machine "GitHubRunner" NEW --show-stderr -v env: SUNDIALS_INST: $HOME/.local LD_LIBRARY_PATH: $HOME/.local/lib + - name: Upload results as artifact uses: actions/upload-artifact@v3 with: @@ -55,18 +62,22 @@ jobs: uses: actions/setup-python@v4 with: python-version: 3.8 + - name: Install asv run: pip install asv + - name: Checkout pybamm-bench repo uses: actions/checkout@v4 with: repository: pybamm-team/pybamm-bench token: ${{ secrets.BENCH_PAT }} + - name: Download results artifact uses: actions/download-artifact@v3 with: name: asv_new_results path: new_results + - name: Copy new results and push to pybamm-bench repo env: PUSH_BENCH_EMAIL: ${{ secrets.PUSH_BENCH_EMAIL }} @@ -78,6 +89,7 @@ jobs: git add results git commit -am "Add new results" git push + - name: Publish results run: | asv publish From 9365bfa41162fd2bde615e8b3c863bf6351253c6 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:45:13 +0530 Subject: [PATCH 2/4] Bump Python version and use virtualenv extra --- .github/workflows/benchmark_on_push.yml | 6 +++--- .github/workflows/periodic_benchmarks.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/benchmark_on_push.yml b/.github/workflows/benchmark_on_push.yml index bc94a2f617..bfd4a7121a 100644 --- a/.github/workflows/benchmark_on_push.yml +++ b/.github/workflows/benchmark_on_push.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 - name: Install Linux system dependencies run: | @@ -27,7 +27,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip wheel setuptools virtualenv wget cmake casadi numpy virtualenv packaging - python -m pip install asv + python -m pip install asv[virtualenv] - name: Install SuiteSparse and SUNDIALS run: python scripts/install_KLU_Sundials.py diff --git a/.github/workflows/periodic_benchmarks.yml b/.github/workflows/periodic_benchmarks.yml index e973eb88cc..cc038172c1 100644 --- a/.github/workflows/periodic_benchmarks.yml +++ b/.github/workflows/periodic_benchmarks.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 - name: Install Linux system dependencies run: | @@ -34,7 +34,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip wheel setuptools virtualenv wget cmake casadi numpy virtualenv packaging - python -m pip install asv + python -m pip install asv[virtualenv] - name: Install SuiteSparse and SUNDIALS run: python scripts/install_KLU_Sundials.py From e2d9397714cc31905b561830c5f0a6812f0a2a1e Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 29 Sep 2023 14:54:35 +0530 Subject: [PATCH 3/4] Keep Python version as 3.8 for now --- .github/workflows/benchmark_on_push.yml | 4 ++-- .github/workflows/periodic_benchmarks.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmark_on_push.yml b/.github/workflows/benchmark_on_push.yml index bfd4a7121a..0f4b211198 100644 --- a/.github/workflows/benchmark_on_push.yml +++ b/.github/workflows/benchmark_on_push.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.11 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.8 - name: Install Linux system dependencies run: | diff --git a/.github/workflows/periodic_benchmarks.yml b/.github/workflows/periodic_benchmarks.yml index cc038172c1..43258cb670 100644 --- a/.github/workflows/periodic_benchmarks.yml +++ b/.github/workflows/periodic_benchmarks.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.11 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.8 - name: Install Linux system dependencies run: | From 04713c6449191f81d98f17bde2ba7c5e32796911 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:36:37 +0530 Subject: [PATCH 4/4] Use asv virtualenv extras instead Co-Authored-By: Saransh Chopra --- .github/workflows/benchmark_on_push.yml | 2 +- .github/workflows/periodic_benchmarks.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark_on_push.yml b/.github/workflows/benchmark_on_push.yml index 0f4b211198..08f88ef533 100644 --- a/.github/workflows/benchmark_on_push.yml +++ b/.github/workflows/benchmark_on_push.yml @@ -26,7 +26,7 @@ jobs: - name: Install python dependencies run: | - python -m pip install --upgrade pip wheel setuptools virtualenv wget cmake casadi numpy virtualenv packaging + python -m pip install --upgrade pip wheel setuptools wget cmake casadi numpy packaging python -m pip install asv[virtualenv] - name: Install SuiteSparse and SUNDIALS diff --git a/.github/workflows/periodic_benchmarks.yml b/.github/workflows/periodic_benchmarks.yml index 43258cb670..5531339465 100644 --- a/.github/workflows/periodic_benchmarks.yml +++ b/.github/workflows/periodic_benchmarks.yml @@ -33,7 +33,7 @@ jobs: - name: Install python dependencies run: | - python -m pip install --upgrade pip wheel setuptools virtualenv wget cmake casadi numpy virtualenv packaging + python -m pip install --upgrade pip wheel setuptools wget cmake casadi numpy packaging python -m pip install asv[virtualenv] - name: Install SuiteSparse and SUNDIALS