Skip to content

Commit

Permalink
Merge branch 'main' into amyachev/issue2979
Browse files Browse the repository at this point in the history
  • Loading branch information
pbchekin authored Dec 21, 2024
2 parents da4943e + 6abfacb commit 585dc1e
Show file tree
Hide file tree
Showing 39 changed files with 46 additions and 684 deletions.
18 changes: 0 additions & 18 deletions .github/actions/install-wheels/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,7 @@ runs:
echo "${{ inputs.workflow }}: $run_id"
echo "run_id=$run_id" >> $GITHUB_OUTPUT
- name: Load wheels from cache
id: wheels-cache
uses: ./.github/actions/load
env:
# Increase this value to reset cache
CACHE_NUMBER: "1"
with:
path: ~/wheels
key: wheels-py${{ inputs.python_version }}-${{ steps.run_id.outputs.run_id }}-$CACHE_NUMBER

- name: Download wheels from specified workflow run artifacts
if: ${{ steps.wheels-cache.outputs.status == 'miss' }}
shell: bash
env:
GH_TOKEN: ${{ inputs.gh_token }}
Expand All @@ -70,10 +59,3 @@ runs:
shopt -s extglob
cd ~/wheels/*-py${{ inputs.python_version }}*
${{ inputs.install_cmd }} ${{ inputs.wheels_pattern }}
- name: Save wheels to cache
if: ${{ steps.wheels-cache.outputs.status == 'miss' }}
uses: ./.github/actions/save
with:
path: ${{ steps.wheels-cache.outputs.path }}
dest: ${{ steps.wheels-cache.outputs.dest }}
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
6 changes: 5 additions & 1 deletion .github/actions/save/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ 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
if: ${{ inputs.enabled == 'true' }}
shell: bash
run: |
TEMP_ITEM=$(mktemp -d -p ${{ inputs.root }})
Expand Down
84 changes: 0 additions & 84 deletions .github/actions/setup-ipex/action.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/actions/setup-no-op-ipex/action.yml

This file was deleted.

21 changes: 7 additions & 14 deletions .github/actions/setup-pytorch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,24 @@ inputs:
default: /opt/intel/oneapi
repository:
description: Repository name with owner
default: Stonepia/pytorch
default: pytorch/pytorch
ref:
description: Branch, tag, commit id
default: ""
mode:
description: Source or wheels
default: source
cache:
description: Cache enabled or disabled
default: enabled
runs:
using: "composite"
steps:
- name: Set default commit id
if: inputs.ref == ''
shell: bash
run: |
if [[ "${{ inputs.repository }}" == "Stonepia/pytorch" ]]; then
PYTORCH_COMMIT_ID="$(<.github/pins/pytorch.txt)"
else
PYTORCH_COMMIT_ID="$(<.github/pins/pytorch-upstream.txt)"
fi
PYTORCH_COMMIT_ID="$(<.github/pins/pytorch.txt)"
echo "PYTORCH_REPO=${{ inputs.repository }}" | tee -a "$GITHUB_ENV"
echo "PYTORCH_COMMIT_ID=$PYTORCH_COMMIT_ID" | tee -a "$GITHUB_ENV"
Expand Down Expand Up @@ -58,7 +57,6 @@ runs:
fi
# PyTorch build process expects Intel oneAPI in /opt/intel/oneapi
# https://github.com/Stonepia/pytorch/blob/c9153c96f547f269581743e7443aa86d7e003505/cmake/Modules/FindMKL.cmake#L44
- name: Set up oneAPI
shell: bash
run: |
Expand Down Expand Up @@ -88,6 +86,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 All @@ -106,13 +105,6 @@ runs:
cd pytorch
../scripts/patch-pytorch.sh
# FIXME: Old PyTorch does not work with numpy==2.0.0
- name: Install numpy < 2.0.0
if: ${{ inputs.repository == 'Stonepia/pytorch' }}
shell: bash
run: |
pip install 'numpy<2.0.0'
- name: Build PyTorch
if: ${{ steps.pytorch-cache.outputs.status == 'miss' && inputs.mode == 'source' }}
shell: bash
Expand Down Expand Up @@ -150,3 +142,4 @@ runs:
with:
path: ${{ steps.pytorch-cache.outputs.path }}
dest: ${{ steps.pytorch-cache.outputs.dest }}
enabled: ${{ inputs.cache == 'enabled' }}
1 change: 0 additions & 1 deletion .github/pins/ipex.txt

This file was deleted.

1 change: 0 additions & 1 deletion .github/pins/pytorch-upstream.txt

This file was deleted.

2 changes: 1 addition & 1 deletion .github/pins/pytorch.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22ce6c6508d1d13b263d4c8b1fd6b98505983e92
61dc5e9c0a36d590adc47b4110efd94d9eb59306
2 changes: 0 additions & 2 deletions .github/workflows/auto-update-translator-cid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
- name: Setup PyTorch
if: ${{ env.TARGET_PRID == null }}
uses: ./.github/actions/setup-pytorch
with:
repository: pytorch/pytorch

- name: Install test dependencies
if: ${{ env.TARGET_PRID == null }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-test-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ jobs:
- name: Setup PyTorch
uses: ./.github/actions/setup-pytorch
with:
repository: pytorch/pytorch
ref: ${{ inputs.pytorch_ref }}
mode: ${{ inputs.pytorch_mode }}

Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/conda-test-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Load conda cache
id: conda-cache
uses: ./.github/actions/load
env:
CACHE_NUMBER: 7
with:
path: $HOME/miniforge3/envs/triton
key: conda-${{ inputs.env_manager }}-py${{ matrix.python }}-${{ hashFiles('scripts/triton.yml', 'python/pyproject.toml', 'python/setup.py') }}-${{ env.CACHE_NUMBER }}

- name: Install Manager Environment
shell: bash --noprofile --norc -eo pipefail {0}
run: |
Expand Down Expand Up @@ -143,13 +134,6 @@ jobs:
run: |
${{ env.TRITON_TEST_CMD }} --inductor --skip-pip-install
- name: Save conda cache
if: steps.conda-cache.outputs.status == 'miss'
uses: ./.github/actions/save
with:
path: ${{ steps.conda-cache.outputs.path }}
dest: ${{ steps.conda-cache.outputs.dest }}

- name: Pass rate
run: |
pip install defusedxml
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/e2e-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ jobs:
- name: Setup PyTorch
uses: ./.github/actions/setup-pytorch
with:
repository: pytorch/pytorch
ref: ${{ inputs.pytorch_ref }}

- name: Set benchmark repository
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/inductor-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Load pip cache
id: pip-cache
uses: ./.github/actions/load
with:
path: $HOME/.cache/pip
# pip cache per commit id just to minimize network traffic
key: pip-$PYTHON_VERSION-$GITHUB_SHA

- name: Install Python
uses: actions/setup-python@v5
with:
Expand All @@ -65,8 +57,8 @@ jobs:
- name: Setup PyTorch
uses: ./.github/actions/setup-pytorch
with:
repository: ${{ env.PYTORCH_REPO}}
ref: ${{ inputs.pytorch_ref }}
cache: disabled

- name: Setup Triton
uses: ./.github/actions/setup-triton
Expand Down Expand Up @@ -127,10 +119,3 @@ jobs:
name: logs-${{ env.PYTHON_VERSION }}
path: pytorch/test/test-reports
include-hidden-files: true

- name: Save pip cache
if: ${{ steps.pip-cache.outputs.status == 'miss' }}
uses: ./.github/actions/save
with:
path: ${{ steps.pip-cache.outputs.path }}
dest: ${{ steps.pip-cache.outputs.dest }}
Loading

0 comments on commit 585dc1e

Please sign in to comment.