Skip to content

Commit 87e7af1

Browse files
authored
Merge branch 'main' into fast-sub-group-transpose
2 parents 7a268e6 + 8d5374a commit 87e7af1

File tree

166 files changed

+7061
-1376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+7061
-1376
lines changed

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

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ inputs:
1616
ref:
1717
description: Branch, tag, commit id
1818
default: ""
19+
mode:
20+
description: Source or wheels
21+
default: source
1922
runs:
2023
using: "composite"
2124
steps:
@@ -71,7 +74,7 @@ runs:
7174
- name: Generate PyTorch cache key
7275
shell: bash
7376
run: |
74-
PYTORCH_CACHE_KEY=$(echo $PYTHON_VERSION $PYTORCH_COMMIT_ID ${{ hashFiles('scripts/patch-pytorch.sh') }} | sha256sum - | cut -d\ -f1)
77+
PYTORCH_CACHE_KEY=$(echo $PYTHON_VERSION $PYTORCH_COMMIT_ID ${{ hashFiles('scripts/patch-pytorch.sh') }} ${{ inputs.mode }} | sha256sum - | cut -d\ -f1)
7578
echo "PYTORCH_CACHE_KEY=$PYTORCH_CACHE_KEY" | tee -a "$GITHUB_ENV"
7679
7780
- name: Load PyTorch from a cache
@@ -90,11 +93,12 @@ runs:
9093
with:
9194
repository: ${{ env.PYTORCH_REPO }}
9295
ref: ${{ env.PYTORCH_COMMIT_ID }}
93-
submodules: recursive
96+
# To build PyTorch from source we need all submodules, they are not required for benchmarks
97+
submodules: ${{ inputs.mode == 'source' && 'recursive' || 'false' }}
9498
path: pytorch
9599

96100
- name: Apply additional PR patches
97-
if: ${{ steps.pytorch-cache.outputs.status == 'miss' && inputs.repository == 'pytorch/pytorch' }}
101+
if: ${{ steps.pytorch-cache.outputs.status == 'miss' && inputs.repository == 'pytorch/pytorch' && inputs.mode == 'source' }}
98102
shell: bash
99103
run: |
100104
cd pytorch
@@ -108,7 +112,7 @@ runs:
108112
pip install 'numpy<2.0.0'
109113
110114
- name: Build PyTorch
111-
if: ${{ steps.pytorch-cache.outputs.status == 'miss' }}
115+
if: ${{ steps.pytorch-cache.outputs.status == 'miss' && inputs.mode == 'source' }}
112116
shell: bash
113117
run: |
114118
source ${{ inputs.oneapi }}/setvars.sh
@@ -117,11 +121,24 @@ runs:
117121
pip install -r requirements.txt
118122
python setup.py bdist_wheel
119123
120-
- name: Install PyTorch
124+
- name: Install PyTorch (built from source)
125+
if: ${{ inputs.mode == 'source' }}
121126
shell: bash
122127
run: |
123128
source ${{ inputs.oneapi }}/setvars.sh
124129
pip install pytorch/dist/*.whl
130+
131+
- name: Install PyTorch (from wheels)
132+
if: ${{ inputs.mode == 'wheels' }}
133+
shell: bash
134+
run: |
135+
source ${{ inputs.oneapi }}/setvars.sh
136+
pip install torch --index-url https://download.pytorch.org/whl/nightly/xpu
137+
138+
- name: Get PyTorch version
139+
shell: bash
140+
run: |
141+
source ${{ inputs.oneapi }}/setvars.sh
125142
PYTORCH_VERSION="$(python -c 'import torch;print(torch.__version__)')"
126143
echo "PYTORCH_VERSION=$PYTORCH_VERSION" | tee -a "$GITHUB_ENV"
127144
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
BlenderbotSmallForCausalLM
2+
CamemBert
3+
DistilBertForMaskedLM
4+
ElectraForCausalLM
5+
GPT2ForSequenceClassification
6+
MobileBertForMaskedLM
7+
MobileBertForQuestionAnswering
8+
Speech2Text2ForCausalLM
9+
T5ForConditionalGeneration
10+
XLNetLMHeadModel
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
beit_base_patch16_224
2+
fbnetv3_b
3+
gmixer_24_224
4+
mobilenetv3_large_100
5+
nfnet_l0
6+
tnt_s_patch16_224
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
resnet50
2+
hf_T5
3+
densenet121
4+
mobilenet_v2

.github/workflows/auto-update-translator-cid.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
uses: actions/checkout@v4
2525
with:
2626
fetch-depth: 0
27+
token: ${{ secrets.BOT_TOKEN }}
2728

2829
# search the opened PR that has branch "bot/update_translator_cid", no new PR as long as the target PR is open
2930
- name: Search the opened PR that has branch ${{ env.PR_BRANCH }}
@@ -98,8 +99,8 @@ jobs:
9899
env:
99100
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
100101
run: |
101-
git config --global user.name 'github-actions[bot]'
102-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
102+
git config --global user.name 'glados-intel'
103+
git config --global user.email 'glados@intel.com'
103104
104105
if git show-ref --verify --quiet "refs/remotes/origin/${PR_BRANCH}"; then
105106
echo "${PR_BRANCH} already exist, deleting..."

.github/workflows/build-test-gpu.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ on:
1212
description: PyTorch ref, keep empty for default
1313
type: string
1414
default: ""
15+
pytorch_mode:
16+
description: PyTorch mode, source or wheels
17+
type: choice
18+
options:
19+
- source
20+
- wheels
21+
default: source
1522
upload_test_reports:
1623
description: Upload test reports
1724
type: boolean
@@ -46,6 +53,7 @@ jobs:
4653
device: ${{ inputs.runner_label }}
4754
runner_label: ${{ inputs.runner_label }}
4855
pytorch_ref: ${{ inputs.pytorch_ref }}
56+
pytorch_mode: ${{ inputs.pytorch_mode || 'source' }}
4957
python_version: ${{ matrix.python }}
5058
upload_test_reports: ${{ inputs.upload_test_reports }}
5159
ignore_errors: ${{ inputs.ignore_errors }}

.github/workflows/build-test-reusable.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ on:
2020
description: PyTorch ref, keep empty for default
2121
type: string
2222
default: ""
23+
pytorch_mode:
24+
description: PyTorch mode, source or wheels
25+
type: string
26+
default: "source"
2327
python_version:
2428
description: Python version
2529
type: string
@@ -96,6 +100,7 @@ jobs:
96100
with:
97101
repository: pytorch/pytorch
98102
ref: ${{ inputs.pytorch_ref }}
103+
mode: ${{ inputs.pytorch_mode }}
99104

100105
- name: Install pass_rate dependencies
101106
run: |
@@ -154,7 +159,6 @@ jobs:
154159
echo "TRANSFORMERS_VERSION=$TRANSFORMERS_VERSION" | tee -a $GITHUB_ENV
155160
156161
- name: Install transformers
157-
if: ${{ inputs.python_version != '3.12' }}
158162
uses: ./.github/actions/install-dependency
159163
with:
160164
package: transformers
@@ -163,7 +167,6 @@ jobs:
163167
try-tag-prefix: v
164168

165169
- name: Run E2E test
166-
if: ${{ inputs.python_version != '3.12' }}
167170
run: |
168171
# Set WORKSPACE for inductor_xpu_test.sh to make sure it creates "inductor_log" outside of pytorch cloned directory
169172
export WORKSPACE=$GITHUB_WORKSPACE

.github/workflows/build-test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ on:
1212
description: PyTorch ref, keep empty for default
1313
type: string
1414
default: ""
15+
pytorch_mode:
16+
description: PyTorch mode, source or wheels
17+
type: choice
18+
options:
19+
- source
20+
- wheels
21+
default: source
1522
upload_test_reports:
1623
description: Upload test reports
1724
type: boolean
@@ -120,6 +127,7 @@ jobs:
120127
driver_version: ${{ matrix.driver }}
121128
runner_label: ${{ inputs.runner_label }}
122129
pytorch_ref: ${{ inputs.pytorch_ref }}
130+
pytorch_mode: ${{ inputs.pytorch_mode || 'source' }}
123131
python_version: ${{ matrix.python }}
124132
upload_test_reports: ${{ inputs.upload_test_reports || false }}
125133
ignore_errors: ${{ inputs.ignore_errors || false }}

.github/workflows/e2e-reusable.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,15 @@ jobs:
218218
cd pytorch
219219
220220
# if "only_one_model" is set, then test this model
221-
# if "models" == "subset", then test the models from .github/models/performance/{suite}.txt
221+
# if "models" == "subset", then test the models from .github/models/{accuracy,performance}/{suite}.txt
222222
# otherwise test all models.
223223
224224
if [[ "${{ inputs.only_one_model }}" ]]; then
225225
bash -e $GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh ${{ inputs.suite }} ${{ inputs.dtype }} ${{ inputs.mode }} ${{ inputs.test_mode }} xpu 0 static 1 0 ${{ inputs.only_one_model }}
226226
elif [[ "${{ inputs.models }}" == "subset" ]]; then
227227
while read model; do
228228
bash -e $GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh ${{ inputs.suite }} ${{ inputs.dtype }} ${{ inputs.mode }} ${{ inputs.test_mode }} xpu 0 static 1 0 $model
229-
done < $GITHUB_WORKSPACE/.github/models/performance/${{ inputs.suite }}.txt
229+
done < $GITHUB_WORKSPACE/.github/models/${{ inputs.test_mode }}/${{ inputs.suite }}.txt
230230
else
231231
bash -e $GITHUB_WORKSPACE/scripts/inductor_xpu_test.sh ${{ inputs.suite }} ${{ inputs.dtype }} ${{ inputs.mode }} ${{ inputs.test_mode }} xpu 0 static 1 0
232232
fi

.github/workflows/integration-tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ jobs:
226226
- name: Install pip dependencies
227227
run: |
228228
python3 -m pip install --upgrade pip
229-
python3 -m pip install wheel cmake==3.24 ninja pytest-xdist lit
229+
python3 -m pip install cython setuptools wheel cmake==3.24 ninja pytest-forked pytest-xdist lit
230230
- name: Install Triton
231231
env:
232232
TRITON_BUILD_WITH_CCACHE: "true"
@@ -250,8 +250,9 @@ jobs:
250250
echo "Coult not find '${SHARED_LIB_DIR}'" ; exit -1
251251
fi
252252
cd python/test/unit
253-
python3 -m pytest -s -n 8 --ignore=hopper/test_flashattention.py --ignore=language/test_line_info.py --ignore=language/test_subprocess.py
253+
python3 -m pytest -s -n 8 --ignore=hopper/test_flashattention.py --ignore=language/test_line_info.py --ignore=language/test_subprocess.py --ignore=test_debug.py
254254
python3 -m pytest -s -n 8 language/test_subprocess.py
255+
python3 -m pytest -s -n 8 test_debug.py --forked
255256
# Run test_line_info.py separately with TRITON_DISABLE_LINE_INFO=0
256257
TRITON_DISABLE_LINE_INFO=0 python3 -m pytest -s language/test_line_info.py
257258
# Run hopper/test_flashattention.py separately to avoid out of gpu memory
@@ -407,7 +408,10 @@ jobs:
407408
pytest --capture=tee-sys -rfs python/tutorials/06-fused-attention.py
408409
cd python/test/unit
409410
pytest --capture=tee-sys -rfs -n 16 language runtime \
410-
--ignore=language/test_line_info.py
411+
--ignore=language/test_line_info.py \
412+
--ignore=test_debug.py
413+
# TODO: uncomment
414+
# pytest --capture=tee-sys -rfs test_debug.py
411415
TRITON_ALWAYS_COMPILE=1 TRITON_DISABLE_LINE_INFO=0 LLVM_PASS_PLUGIN_PATH=${SHARED_LIB_DIR}/libGPUHello.so \
412416
pytest --capture=tee-sys -rfs -vvv instrumentation/test_gpuhello.py
413417

0 commit comments

Comments
 (0)