Skip to content

Commit 0d6f048

Browse files
committed
Merge remote-tracking branch 'origin' into daisyden/distributed_2.8
2 parents 254ced6 + 34a9292 commit 0d6f048

20 files changed

+436
-304
lines changed

.github/actions/inductor-xpu-e2e-test/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,19 @@ runs:
6262
fi
6363
cd ../ && python -c "import torch, torchvision, torchaudio"
6464
rm -rf benchmark && git clone https://github.com/pytorch/benchmark.git
65-
cd benchmark && git checkout $TORCHBENCH_COMMIT_ID && pip install --no-deps -r requirements.txt
65+
cd benchmark && git checkout $TORCHBENCH_COMMIT_ID
66+
# remove deps which will reinstall torch
67+
pip install --no-deps accelerate
68+
pip install --no-deps $(cat requirements.txt |grep 'pytorch-image-models')
69+
timm_commit="$(grep 'pytorch-image-models' requirements.txt |awk -F '@' '{print $2}')"
70+
pip install $(curl -sSL https://raw.githubusercontent.com/huggingface/pytorch-image-models/${timm_commit:-"main"}/requirements.txt | grep -vE torch)
71+
sed -i 's+.*pytorch-image-models.*++g;s+^accelerate.*++g' requirements.txt
72+
pip install -r requirements.txt
6673
python install.py --continue_on_fail
6774
# deps for torchrec_dlrm
6875
pip install pyre_extensions
6976
pip install fbgemm-gpu --index-url https://download.pytorch.org/whl/nightly/cpu
70-
pip install torchmetrics==1.0.3
71-
pip install torchrec --no-deps --index-url https://download.pytorch.org/whl/nightly/cpu
77+
pip install --no-deps lightning-utilities==0.14.3 torchmetrics==1.0.3 tensordict torchrec
7278
fi
7379
if [[ ${{ inputs.suite }} == *"huggingface"* ]]; then
7480
pip install --force-reinstall git+https://github.com/huggingface/transformers@${TRANSFORMERS_VERSION}
@@ -127,7 +133,7 @@ runs:
127133
contains "accuracy,performance" $scenario
128134
$contains_status
129135
if [ "${MODEL_ONLY_NAME}" == "" ];then
130-
xpu_list=($(xpu-smi discovery |grep 'DRM Device: /dev/' |sed 's/.*card//;s/[^0-9].*//' |awk '{print $1 - 1":"NR - 1}'))
136+
xpu_list=($(xpu-smi discovery |grep 'DRM Device: /dev/' |sed 's/.*card//;s/[^0-9].*//' |awk '{if($1==0){print $1":"NR - 1}else{print $1 - 1":"NR - 1}}'))
131137
for xpu_id in ${xpu_list[*]}
132138
do
133139
bash inductor_xpu_test.sh ${suite} ${dt} ${mode} ${scenario} xpu ${xpu_id/:*} static ${#xpu_list[*]} ${xpu_id/*:} &

.github/scripts/apply_torch_pr.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
parser.add_argument('--pr-list', '-n', nargs='+',
1111
default=[
1212
# Fallback to CPU for XPU FP64
13-
"https://github.com/pytorch/pytorch/pull/126516",
13+
"https://github.com/pytorch/pytorch/pull/156456",
1414
# Modify the tolerance level in TIMM benchmark
1515
"https://github.com/pytorch/pytorch/pull/143739",
16-
# Allow XPU device for validating the arguments to sparse compressed tensor factory functions
17-
"https://github.com/pytorch/pytorch/pull/147306",
18-
"Enhance testing infrastructure to add half-precision support for histc on XPU"
16+
# "Enhance testing infrastructure to add half-precision support for histc on XPU"
1917
"https://github.com/pytorch/pytorch/pull/154339",
2018
]
2119
)

.github/workflows/_linux_accelerate.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ on:
3939
default: 'v4.51.3'
4040
description: Transformers version
4141

42-
permissions: read-all
4342
concurrency:
4443
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
4544
cancel-in-progress: true

.github/workflows/_linux_build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ on:
3838
description: The commit id of the torch build
3939
value: ${{ jobs.build.outputs.TORCH_COMMIT_ID }}
4040

41-
permissions:
42-
issues: write
43-
4441
jobs:
4542
build:
4643
runs-on: ${{ inputs.runner }}

.github/workflows/_linux_op_benchmark.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ on:
3434
default: 'rolling'
3535
description: Driver lts/rolling
3636

37-
permissions: read-all
38-
3937
jobs:
4038
op_benchmark_test:
4139
runs-on: ${{ inputs.runner }}
@@ -81,7 +79,6 @@ jobs:
8179
- name: Install Pytorch XPU
8280
run: |
8381
source activate xpu_op_${ZE_AFFINITY_MASK}
84-
source .github/scripts/env.sh ${{ inputs.pytorch }}
8582
if [ "${{ inputs.pytorch }}" != "nightly_wheel" ]; then
8683
cd ../pytorch
8784
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
@@ -96,7 +93,6 @@ jobs:
9693
- name: Torch Config
9794
run: |
9895
source activate xpu_op_${ZE_AFFINITY_MASK}
99-
source .github/scripts/env.sh ${{ inputs.pytorch }}
10096
python -c "import torch; print(torch.__config__.show())"
10197
python -c "import torch; print(torch.__config__.parallel_info())"
10298
python -c "import torch; print(torch.__config__.torch.xpu.device_count())"
@@ -108,7 +104,6 @@ jobs:
108104
- name: Run Torch XPU Op Benchmark
109105
if: ${{ inputs.driver == 'rolling' }}
110106
run: |
111-
source .github/scripts/env.sh ${{ inputs.pytorch }}
112107
source activate xpu_op_${ZE_AFFINITY_MASK}
113108
mkdir -p ${{ github.workspace }}/op_benchmark
114109
cd test/microbench

.github/workflows/_linux_transformers.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ on:
4444
default: 'v4.51.3'
4545
description: Transformers version
4646

47-
permissions: read-all
4847
concurrency:
4948
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5049
cancel-in-progress: true
@@ -314,7 +313,7 @@ jobs:
314313

315314
report:
316315
needs: tests
317-
if: "always()"
316+
if: ${{ always() }}
318317
runs-on: ${{ inputs.runner != '' && inputs.runner || 'linux.idc.xpu' }}
319318
steps:
320319
- name: Download reports

.github/workflows/_linux_ut.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ on:
4444
default: 'lts'
4545
description: Driver lts/rolling
4646

47-
permissions: read-all
48-
4947
jobs:
5048
ut_test:
5149
runs-on: ${{ inputs.runner }}
@@ -88,15 +86,16 @@ jobs:
8886
run: |
8987
source activate xpu_op_${ZE_AFFINITY_MASK}
9088
cd ../pytorch
91-
TRITON_REPO="https://github.com/intel/intel-xpu-backend-for-triton"
9289
if [ -z ${{ inputs.triton }} ]; then
9390
TRITON_COMMIT_ID="$(<.ci/docker/ci_commit_pins/triton-xpu.txt)"
9491
else
9592
TRITON_COMMIT_ID="${{ inputs.triton }}"
9693
fi
97-
echo ${TRITON_REPO}@${TRITON_COMMIT_ID}
9894
if [ "${{ inputs.pytorch }}" != "nightly_wheel" ]; then
99-
pip install --force-reinstall "git+${TRITON_REPO}@${TRITON_COMMIT_ID}#subdirectory=python"
95+
pip install cmake ninja pybind11
96+
rm -rf pytorch_triton_xpu-*.whl
97+
python .github/scripts/build_triton_wheel.py --device xpu --commit-hash ${TRITON_COMMIT_ID}
98+
pip install pytorch_triton_xpu-*.whl
10099
fi
101100
- name: Download Pytorch wheel
102101
if: ${{ inputs.pytorch != 'nightly_wheel' }}
@@ -415,15 +414,16 @@ jobs:
415414
run: |
416415
source activate xpu_op_${ZE_AFFINITY_MASK}
417416
cd ../pytorch
418-
TRITON_REPO="https://github.com/intel/intel-xpu-backend-for-triton"
419417
if [ -z ${{ inputs.triton }} ]; then
420418
TRITON_COMMIT_ID="$(<.ci/docker/ci_commit_pins/triton-xpu.txt)"
421419
else
422420
TRITON_COMMIT_ID="${{ inputs.triton }}"
423421
fi
424-
echo ${TRITON_REPO}@${TRITON_COMMIT_ID}
425422
if [ "${{ inputs.pytorch }}" != "nightly_wheel" ]; then
426-
pip install --force-reinstall "git+${TRITON_REPO}@${TRITON_COMMIT_ID}#subdirectory=python"
423+
pip install cmake ninja pybind11
424+
rm -rf pytorch_triton_xpu-*.whl
425+
python .github/scripts/build_triton_wheel.py --device xpu --commit-hash ${TRITON_COMMIT_ID}
426+
pip install pytorch_triton_xpu-*.whl
427427
fi
428428
- name: Download Pytorch wheel
429429
if: ${{ inputs.pytorch != 'nightly_wheel' }}

.github/workflows/_performance_comparison.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ on:
1414
default: ''
1515
description: Baseline run id
1616

17-
permissions: read-all
18-
1917
jobs:
2018
Performance-Comparison:
2119
env:

.github/workflows/_windows_ut.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ on:
4444
default: 'false'
4545
description: Check if labelled
4646

47-
permissions: read-all
48-
4947
env:
5048
USE_XPU: 1
5149

.github/workflows/nightly_ondemand.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,15 @@ on:
5959
default: '3.10'
6060
description: Python version
6161

62-
permissions: write-all
63-
6462
concurrency:
6563
group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }}
6664
cancel-in-progress: ${{ github.event_name != 'schedule' }}
6765

6866
jobs:
6967
Linux-Nightly-Ondemand-Build:
7068
if: ${{ github.repository_owner == 'intel' }}
71-
secrets: inherit
7269
name: linux-nightly-ondemand
73-
permissions:
74-
issues: write
70+
secrets: inherit
7571
uses: ./.github/workflows/_linux_build.yml
7672
with:
7773
pytorch: ${{ github.event_name == 'schedule' && 'main' || inputs.pytorch }}
@@ -177,9 +173,10 @@ jobs:
177173
run: |
178174
source activate e2e_ci
179175
cd ../pytorch
180-
TRITON_REPO="https://github.com/intel/intel-xpu-backend-for-triton"
181-
echo ${TRITON_REPO}@${TRITON_COMMIT_ID}
182-
pip install --force-reinstall "git+${TRITON_REPO}@${TRITON_COMMIT_ID}#subdirectory=python"
176+
pip install cmake ninja pybind11
177+
rm -rf pytorch_triton_xpu-*.whl
178+
python .github/scripts/build_triton_wheel.py --device xpu --commit-hash ${TRITON_COMMIT_ID}
179+
pip install pytorch_triton_xpu-*.whl
183180
- name: Download Pytorch wheel
184181
if: ${{ inputs.pytorch != 'nightly_wheel' }}
185182
uses: actions/download-artifact@v4
@@ -365,15 +362,13 @@ jobs:
365362
keep_torch_xpu_ops: ${{ github.event_name == 'schedule' && 'false' || inputs.keep_torch_xpu_ops }}
366363
ut: ${{ github.event_name == 'schedule' && 'op_extended,torch_xpu' || inputs.ut }}
367364
python: ${{ github.event_name == 'schedule' && '3.10' || inputs.python }}
368-
files-changed: false
369-
has-label: true
365+
src_changed: false
366+
has_label: true
370367
runner: Windows_CI
371368

372369
Tests-Failure-And-Report:
373370
if: ${{ ! cancelled() }}
374371
runs-on: [ self-hosted, Linux ]
375-
permissions:
376-
issues: write
377372
env:
378373
GH_TOKEN: ${{ github.token }}
379374
python: ${{ github.event_name == 'schedule' && '3.10' || inputs.python }}

.github/workflows/nightly_ondemand_rolling.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,15 @@ on:
5959
default: '3.10'
6060
description: Python version
6161

62-
permissions: write-all
63-
6462
concurrency:
6563
group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.keep_torch_xpu_ops }}-${{ inputs.ut }}-${{ inputs.triton }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }}
6664
cancel-in-progress: ${{ github.event_name != 'schedule' }}
6765

6866
jobs:
6967
Linux-Nightly-Ondemand-Build-Rolling:
7068
if: ${{ github.repository_owner == 'intel' }}
71-
secrets: inherit
7269
name: linux-nightly-ondemand-rolling
73-
permissions:
74-
issues: write
70+
secrets: inherit
7571
uses: ./.github/workflows/_linux_build.yml
7672
with:
7773
pytorch: ${{ github.event_name == 'schedule' && 'main' || inputs.pytorch }}
@@ -193,9 +189,10 @@ jobs:
193189
run: |
194190
source activate e2e_ci
195191
cd ../pytorch
196-
TRITON_REPO="https://github.com/intel/intel-xpu-backend-for-triton"
197-
echo ${TRITON_REPO}@${TRITON_COMMIT_ID}
198-
pip install --force-reinstall "git+${TRITON_REPO}@${TRITON_COMMIT_ID}#subdirectory=python"
192+
pip install cmake ninja pybind11
193+
rm -rf pytorch_triton_xpu-*.whl
194+
python .github/scripts/build_triton_wheel.py --device xpu --commit-hash ${TRITON_COMMIT_ID}
195+
pip install pytorch_triton_xpu-*.whl
199196
- name: Download Pytorch wheel
200197
if: ${{ inputs.pytorch != 'nightly_wheel' }}
201198
uses: actions/download-artifact@v4
@@ -385,8 +382,6 @@ jobs:
385382
Tests-Failure-And-Report:
386383
if: ${{ ! cancelled() }}
387384
runs-on: [ self-hosted, Linux ]
388-
permissions:
389-
issues: write
390385
env:
391386
GH_TOKEN: ${{ github.token }}
392387
python: ${{ github.event_name == 'schedule' && '3.10' || inputs.python }}

.github/workflows/nightly_ondemand_whl.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ on:
4949
default: '3.10'
5050
description: Python version
5151

52-
permissions: write-all
53-
5452
concurrency:
5553
group: ${{ github.workflow }}-${{ github.sha }}-${{ github.event_name }}-${{ inputs.pytorch }}-${{ inputs.ut }}-${{ inputs.suite }}-${{ inputs.dt }}-${{ inputs.mode }}-${{ inputs.scenario }}-${{ inputs.model }}-${{ inputs.python }}
5654
cancel-in-progress: ${{ github.event_name != 'schedule' }}
@@ -322,8 +320,6 @@ jobs:
322320
Tests-Failure-And-Report:
323321
if: ${{ ! cancelled() }}
324322
runs-on: [ self-hosted, Linux ]
325-
permissions:
326-
issues: write
327323
env:
328324
GH_TOKEN: ${{ github.token }}
329325
python: ${{ github.event_name == 'schedule' && '3.10' || inputs.python }}

.github/workflows/pull.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
1818
cancel-in-progress: true
1919

20-
permissions: read-all
21-
2220
jobs:
2321
preci-lint-check:
2422
name: preci-lint-check
@@ -98,8 +96,6 @@ jobs:
9896
if: ${{ !contains(needs.preci-conditions-filter.outputs.disabled_tests, 'disable_all')}}
9997
needs: [preci-conditions-filter]
10098
secrets: inherit
101-
permissions:
102-
issues: write
10399
uses: ./.github/workflows/_linux_build.yml
104100
with:
105101
pytorch: main
@@ -179,10 +175,10 @@ jobs:
179175
run: |
180176
source activate e2e_ci
181177
cd ../pytorch
182-
TRITON_REPO="https://github.com/intel/intel-xpu-backend-for-triton"
183-
TRITON_PINNED_COMMIT=$(cat .ci/docker/ci_commit_pins/triton-xpu.txt)
184-
echo ${TRITON_REPO}@${TRITON_PINNED_COMMIT}
185-
pip install --force-reinstall "git+${TRITON_REPO}@${TRITON_PINNED_COMMIT}#subdirectory=python"
178+
pip install cmake ninja pybind11
179+
rm -rf pytorch_triton_xpu-*.whl
180+
python .github/scripts/build_triton_wheel.py --device xpu
181+
pip install pytorch_triton_xpu-*.whl
186182
- name: Identify pinned versions
187183
run: |
188184
cd ../pytorch

src/ATen/native/xpu/SpectralOps.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#include <ATen/native/Resize.h>
2-
#include <ATen/ops/_fft_r2c_native.h>
31
#if defined(USE_ONEMKL_XPU)
42
#include <ATen/native/xpu/mkl/SpectralOps.h>
53
#else
4+
#include <ATen/native/Resize.h>
65
#include <ATen/ops/_fft_c2c_native.h>
76
#include <ATen/ops/_fft_c2r_native.h>
7+
#include <ATen/ops/_fft_r2c_native.h>
88
#endif // USE_ONEMKL_XPU
99

1010
namespace at::native {
@@ -87,9 +87,13 @@ Tensor _fft_r2c_xpu(
8787
bool onesided) {
8888
TORCH_CHECK(self.is_floating_point());
8989

90+
#if defined(USE_ONEMKL_XPU)
91+
return native::xpu::_fft_r2c_mkl(self, dim, normalization, onesided);
92+
#else
9093
Tensor out_cpu = native::_fft_r2c_mkl(
9194
self.to(Device(at::kCPU)), dim, normalization, onesided);
9295
return out_cpu.to(Device(at::kXPU));
96+
#endif // USE_ONEMKL_XPU
9397
}
9498

9599
Tensor& _fft_r2c_xpu_out(
@@ -100,11 +104,15 @@ Tensor& _fft_r2c_xpu_out(
100104
Tensor& out) {
101105
TORCH_CHECK(self.is_floating_point());
102106

107+
#if defined(USE_ONEMKL_XPU)
108+
return native::xpu::_fft_r2c_mkl_out(self, dim, normalization, onesided, out);
109+
#else
103110
Tensor out_cpu = native::_fft_r2c_mkl(
104111
self.to(Device(at::kCPU)), dim, normalization, onesided);
105112
at::native::resize_output(out, out_cpu.sizes());
106113
out.copy_(out_cpu);
107114
return out;
115+
#endif // USE_ONEMKL_XPU
108116
}
109117

110118
} // namespace at::native

0 commit comments

Comments
 (0)