Skip to content

Commit 6db3b52

Browse files
authored
Use oneAPI version in PyTorch cache key (#2597)
In new runners `/opt/intel/installed.txt` will contain a list of installed packages. Use this file, if exists, to calculate a composite cache key for PyTorch. The key should be the same for the existing runners (with PTDB), and a new PyTorch build should be triggered on the new runners (with DLE). Fixes #2596.
1 parent 5d9774c commit 6db3b52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/actions/setup-pytorch/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ runs:
7474
- name: Generate PyTorch cache key
7575
shell: bash
7676
run: |
77-
PYTORCH_CACHE_KEY=$(echo $PYTHON_VERSION $PYTORCH_COMMIT_ID ${{ hashFiles('scripts/patch-pytorch.sh') }} ${{ inputs.mode }} | sha256sum - | cut -d\ -f1)
77+
ONEAPI_KEY=$(sha256sum /opt/intel/installed.txt 2> /dev/null | cut -d\ -f1 || true)
78+
PYTORCH_CACHE_KEY=$(echo $PYTHON_VERSION $PYTORCH_COMMIT_ID ${{ hashFiles('scripts/patch-pytorch.sh') }} ${{ inputs.mode }}$ONEAPI_KEY | sha256sum - | cut -d\ -f1)
7879
echo "PYTORCH_CACHE_KEY=$PYTORCH_CACHE_KEY" | tee -a "$GITHUB_ENV"
7980
8081
- name: Load PyTorch from a cache

0 commit comments

Comments
 (0)