Skip to content

Commit 9d3d726

Browse files
[MNT] Comments on numba caching and release CI fix (#2916)
* release CI jank * comment * swap
1 parent 1a002f1 commit 9d3d726

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

.github/actions/numba_cache/action.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,23 @@ runs:
2424
run: echo "NUMBA_CACHE_DIR=${{ github.workspace }}/.numba_cache" >> $GITHUB_ENV
2525
shell: bash
2626

27-
# Sets the cpu name for numba to use
28-
- name: Set numba cpu env
27+
# Sets the CPU name for numba to use
28+
# This is required for reusing the cache across different runners of the same
29+
# architecture and OS
30+
- name: Set numba CPU env
2931
run: echo "NUMBA_CPU_NAME=generic" >> $GITHUB_ENV
3032
shell: bash
3133

32-
# Sets the cpu features for numba to use
33-
- name: Set numba cpu features env
34+
# Sets the CPU features for numba to use
35+
# Found through a bit of trial and error to run on different CPUs found in GitHub
36+
# runners
37+
- name: Set numba CPU features env
3438
run: echo "NUMBA_CPU_FEATURES=+64bit +adx +aes +avx +avx2 -avx512bf16 -avx512bitalg -avx512bw -avx512cd -avx512dq -avx512er -avx512f -avx512ifma -avx512pf -avx512vbmi -avx512vbmi2 -avx512vl -avx512vnni -avx512vpopcntdq +bmi +bmi2 -cldemote -clflushopt -clwb -clzero +cmov +cx16 +cx8 -enqcmd +f16c +fma -fma4 +fsgsbase +fxsr -gfni +invpcid -lwp +lzcnt +mmx +movbe -movdir64b -movdiri -mwaitx +pclmul -pconfig -pku +popcnt -prefetchwt1 +prfchw -ptwrite -rdpid +rdrnd +rdseed +rtm +sahf -sgx -sha -shstk +sse +sse2 +sse3 +sse4.1 +sse4.2 -sse4a +ssse3 -tbm -vaes -vpclmulqdq -waitpkg -wbnoinvd -xop +xsave -xsavec +xsaveopt -xsaves" >> $GITHUB_ENV
3539
shell: bash
3640

37-
# Set the CICD_RUNNING env so that numba knows it is running in a CI environment
38-
- name: Set CICD_RUNNING env
39-
run: echo "CICD_RUNNING=1" >> $GITHUB_ENV
41+
# Set the CACHING_CICD_RUNNING env so we know to use custom numba caching
42+
- name: Set CACHING_CICD_RUNNING env
43+
run: echo "CACHING_CICD_RUNNING=1" >> $GITHUB_ENV
4044
shell: bash
4145

4246
# Get current date for cache restore

.github/workflows/periodic_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
if: runner.os == 'Linux'
179179
uses: pierotofy/set-swap-space@v1.0
180180
with:
181-
swap-size-gb: 4
181+
swap-size-gb: 6
182182

183183
- name: Use numba cache to set env variables but not restore cache
184184
uses: ./.github/actions/numba_cache

.github/workflows/pr_pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
if: runner.os == 'Linux'
7777
uses: pierotofy/set-swap-space@v1.0
7878
with:
79-
swap-size-gb: 4
79+
swap-size-gb: 6
8080

8181
- if: ${{ github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'no numba cache') }}
8282
name: Restore numba cache

.github/workflows/release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
if: runner.os == 'Linux'
7070
uses: pierotofy/set-swap-space@v1.0
7171
with:
72-
swap-size-gb: 4
72+
swap-size-gb: 6
7373

7474
- uses: actions/download-artifact@v4
7575
with:
@@ -83,6 +83,14 @@ jobs:
8383
name: Unix wheel filename
8484
run: echo "WHEELNAME=$(ls ./dist/aeon-*-none-any.whl)" >> $GITHUB_ENV
8585

86+
- name: Use numba cache to set env variables but not restore cache
87+
uses: ./.github/actions/numba_cache
88+
with:
89+
cache_name: "release"
90+
runner_os: ${{ runner.os }}
91+
python_version: ${{ matrix.python-version }}
92+
restore_cache: "false"
93+
8694
- if: runner.os == 'Windows'
8795
name: Windows install
8896
uses: nick-fields/retry@v3

aeon/testing/_cicd_numba_caching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import numba.core.caching
88

9-
if os.environ.get("CICD_RUNNING") == "1": # pragma: no cover
9+
if os.environ.get("CACHING_CICD_RUNNING") == "1": # pragma: no cover
1010

1111
def get_invalid_numba_files():
1212
"""Get the files that have been changed since the last commit.

0 commit comments

Comments
 (0)