Skip to content

Commit

Permalink
Do not use for inductor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pbchekin committed Dec 20, 2024
1 parent bb38d1f commit 6aee6ee
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/actions/load/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: load
description: Load a directory from a cache based on a shared directory
inputs:
root:
description:
description: Directory for cache
default: /cache
path:
description: A directory to load from a cache
Expand All @@ -12,8 +12,10 @@ inputs:
required: true
symlink:
description: Create a symlink instead of copying from cache
type: bool
default: true
default: "true"
enabled:
description: Enable cache
default: "true"
outputs:
path:
description: A directory to save to a cache
Expand All @@ -24,6 +26,7 @@ outputs:
dest:
description: Directory in cache
value: ${{ steps.load.outputs.dest }}

runs:
using: "composite"
steps:
Expand All @@ -37,7 +40,7 @@ runs:
echo "Directory ${{ inputs.path }} exists and will not be restored from cache"
exit 1
fi
if [[ -d $ITEM_PATH ]]; then
if [[ ${{ inputs.enabled == 'true' }} && -d $ITEM_PATH ]]; then
echo "Cache hit for ${{ inputs.key }}"
echo "status=hit" >> $GITHUB_OUTPUT
if [[ ${{ inputs.symlink }} == true ]]; then
Expand Down
8 changes: 7 additions & 1 deletion .github/actions/save/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@ name: save
description: Save a directory to a cache based on a shared directory
inputs:
root:
description:
description: Directory for cache
default: /cache
path:
description: Directory to save to a cache
required: true
dest:
description: Directory in cache
required: true
enabled:
description: Enable cache
default: "true"
runs:
using: "composite"
steps:
- name: Save ${{ inputs.path }} to cache
shell: bash
run: |
if [[ ${{ inputs.enabled != 'true' }} ]]; then
exit 0
fi
TEMP_ITEM=$(mktemp -d -p ${{ inputs.root }})
cp -rT ${{ inputs.path }} $TEMP_ITEM
# ignore error if other job created a cache with the same key already
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/setup-pytorch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ inputs:
mode:
description: Source or wheels
default: source
cache:
description: Cache enabled or disabled
default: enabled
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -88,6 +91,7 @@ runs:
with:
path: pytorch
key: pytorch-$PYTORCH_CACHE_KEY-$CACHE_NUMBER
enabled: ${{ inputs.cache == 'enabled' }}

- name: Clone PyTorch repository
if: ${{ steps.pytorch-cache.outputs.status == 'miss' }}
Expand Down Expand Up @@ -150,3 +154,4 @@ runs:
with:
path: ${{ steps.pytorch-cache.outputs.path }}
dest: ${{ steps.pytorch-cache.outputs.dest }}
enabled: ${{ inputs.cache == 'enabled' }}
1 change: 1 addition & 0 deletions .github/workflows/inductor-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
with:
repository: ${{ env.PYTORCH_REPO}}
ref: ${{ inputs.pytorch_ref }}
cache: disabled

- name: Setup Triton
uses: ./.github/actions/setup-triton
Expand Down

0 comments on commit 6aee6ee

Please sign in to comment.