Skip to content

Commit

Permalink
Use oneAPI version in PyTorch cache key (#2597)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pbchekin authored Oct 30, 2024
1 parent 5d9774c commit 6db3b52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/actions/setup-pytorch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ runs:
- name: Generate PyTorch cache key
shell: bash
run: |
PYTORCH_CACHE_KEY=$(echo $PYTHON_VERSION $PYTORCH_COMMIT_ID ${{ hashFiles('scripts/patch-pytorch.sh') }} ${{ inputs.mode }} | sha256sum - | cut -d\ -f1)
ONEAPI_KEY=$(sha256sum /opt/intel/installed.txt 2> /dev/null | cut -d\ -f1 || true)
PYTORCH_CACHE_KEY=$(echo $PYTHON_VERSION $PYTORCH_COMMIT_ID ${{ hashFiles('scripts/patch-pytorch.sh') }} ${{ inputs.mode }}$ONEAPI_KEY | sha256sum - | cut -d\ -f1)
echo "PYTORCH_CACHE_KEY=$PYTORCH_CACHE_KEY" | tee -a "$GITHUB_ENV"
- name: Load PyTorch from a cache
Expand Down

0 comments on commit 6db3b52

Please sign in to comment.