diff --git a/.github/workflows/conda-python-tests.yaml b/.github/workflows/conda-python-tests.yaml index 1e151503..605ae26e 100644 --- a/.github/workflows/conda-python-tests.yaml +++ b/.github/workflows/conda-python-tests.yaml @@ -77,6 +77,14 @@ on: When this is non-empty, that secret's value is used in place of the default repo-level token anywhere that environment variable GH_TOKEN is set. This is especially useful for downloading artifacts from other private repos, which repo tokens do not have access to. + numba-cache-key-prefix: + type: string + required: false + default: "" + description: | + When non-empty, restore and save Numba's CUDA compilation cache under this key prefix. + The workflow adds the Python, CUDA, architecture, Linux, and GPU matrix values so cached + device code is only reused in a compatible test environment. secrets: script-env-secret-1-key: description: | @@ -206,6 +214,19 @@ jobs: with: enable-apt: true + - name: Restore Numba CUDA cache + if: inputs.numba-cache-key-prefix != '' + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ github.workspace }}/.cache/numba + key: ${{ inputs.numba-cache-key-prefix }}-cuda${{ matrix.CUDA_VER }}-py${{ matrix.PY_VER }}-${{ matrix.ARCH }}-${{ matrix.LINUX_VER }}-${{ matrix.GPU }}-${{ hashFiles('**/*.py', 'dependencies.yaml') }} + restore-keys: | + ${{ inputs.numba-cache-key-prefix }}-cuda${{ matrix.CUDA_VER }}-py${{ matrix.PY_VER }}-${{ matrix.ARCH }}-${{ matrix.LINUX_VER }}-${{ matrix.GPU }}- + + - name: Configure Numba CUDA cache + if: inputs.numba-cache-key-prefix != '' + run: echo "NUMBA_CACHE_DIR=${GITHUB_WORKSPACE}/.cache/numba" >> "${GITHUB_ENV}" + # Install latest rapidsai/sccache client and configure sccache-dist - name: Setup sccache-dist uses: rapidsai/shared-actions/setup-sccache-dist@main diff --git a/.github/workflows/wheels-test.yaml b/.github/workflows/wheels-test.yaml index 0c9ac9d0..1b62b071 100644 --- a/.github/workflows/wheels-test.yaml +++ b/.github/workflows/wheels-test.yaml @@ -93,6 +93,14 @@ on: type: boolean required: false default: false + numba-cache-key-prefix: + type: string + required: false + default: "" + description: | + When non-empty, restore and save Numba's CUDA compilation cache under this key prefix. + The workflow adds the Python, CUDA, architecture, Linux, and GPU matrix values so cached + device code is only reused in a compatible test environment. secrets: script-env-secret-1-key: description: | @@ -212,6 +220,19 @@ jobs: with: enable-apt: true + - name: Restore Numba CUDA cache + if: inputs.numba-cache-key-prefix != '' + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ github.workspace }}/.cache/numba + key: ${{ inputs.numba-cache-key-prefix }}-cuda${{ matrix.CUDA_VER }}-py${{ matrix.PY_VER }}-${{ matrix.ARCH }}-${{ matrix.LINUX_VER }}-${{ matrix.GPU }}-${{ hashFiles('**/*.py', 'dependencies.yaml') }} + restore-keys: | + ${{ inputs.numba-cache-key-prefix }}-cuda${{ matrix.CUDA_VER }}-py${{ matrix.PY_VER }}-${{ matrix.ARCH }}-${{ matrix.LINUX_VER }}-${{ matrix.GPU }}- + + - name: Configure Numba CUDA cache + if: inputs.numba-cache-key-prefix != '' + run: echo "NUMBA_CACHE_DIR=${GITHUB_WORKSPACE}/.cache/numba" >> "${GITHUB_ENV}" + # Install latest rapidsai/sccache client and configure sccache-dist - name: Setup sccache-dist uses: rapidsai/shared-actions/setup-sccache-dist@main