Skip to content

Commit a5a2623

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into llvmspirv_pulldown
2 parents 3ab7444 + 99e3894 commit a5a2623

File tree

517 files changed

+6503
-23089
lines changed

Some content is hidden

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

517 files changed

+6503
-23089
lines changed

.github/workflows/sycl-linux-build.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ on:
7575
e2e_binaries_preview_artifact:
7676
type: string
7777
required: false
78+
e2e_binaries_new_offload_model_artifact:
79+
type: string
80+
required: false
7881

7982
outputs:
8083
build_conclusion:
@@ -260,10 +263,6 @@ jobs:
260263
if: ${{ !cancelled() && contains(inputs.changes, 'libclc') }}
261264
run: |
262265
cmake --build $GITHUB_WORKSPACE/build --target check-libclc
263-
- name: check-libdevice
264-
if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }}
265-
run: |
266-
cmake --build $GITHUB_WORKSPACE/build --target check-libdevice
267266
- name: Check E2E test requirements
268267
if: ${{ !cancelled() && !contains(inputs.changes, 'sycl') }}
269268
run: |
@@ -339,6 +338,21 @@ jobs:
339338
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
340339
extra_lit_opts: --param sycl_build_targets="spir;nvidia;amd"
341340

341+
- name: Build E2E tests with NewOffloadModel
342+
if: |
343+
inputs.e2e_binaries_new_offload_model_artifact &&
344+
!cancelled()
345+
&& steps.build.conclusion == 'success' &&
346+
contains(github.event.pull_request.labels.*.name, 'new-offload-model')
347+
uses: ./devops/actions/run-tests/e2e
348+
with:
349+
ref: ${{ inputs.ref || github.sha }}
350+
testing_mode: build-only
351+
target_devices: all
352+
binaries_artifact: ${{ inputs.e2e_binaries_new_offload_model_artifact }}
353+
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
354+
extra_lit_opts: --param sycl_build_targets="spir;nvidia;amd" --param enable_new_offload_model=True
355+
342356
- name: Build E2E tests with SPIR-V Backend
343357
if: ${{ inputs.e2e_binaries_spirv_backend_artifact && !cancelled() && steps.build.conclusion == 'success' }}
344358
uses: ./devops/actions/run-tests/e2e

.github/workflows/sycl-linux-precommit.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
toolchain_artifact: sycl_linux_default
6767
e2e_binaries_artifact: e2e_bin
6868
e2e_binaries_preview_artifact: e2e_bin_preview
69+
e2e_binaries_new_offload_model_artifact: e2e_bin_new_offload_model
6970

7071
# Build and run native cpu e2e tests separately as cannot currently
7172
# build all the e2e tests
@@ -236,6 +237,57 @@ jobs:
236237
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || matrix.skip_run || 'false'}}
237238
env: ${{ matrix.env || (contains(needs.detect_changes.outputs.filters, 'esimd') && '{}' || '{"LIT_FILTER_OUT":"ESIMD/"}') }}
238239

240+
E2E-with-new-offload-model:
241+
needs: [build, detect_changes, compat_read_exclude]
242+
if: |
243+
!cancelled() &&
244+
needs.build.outputs.build_conclusion == 'success' &&
245+
contains(github.event.pull_request.labels.*.name, 'new-offload-model')
246+
permissions:
247+
contents: write
248+
packages: read
249+
strategy:
250+
fail-fast: false
251+
matrix:
252+
include:
253+
- name: Intel / GEN 12 Integrated
254+
runner: '["Linux", "gen12"]'
255+
target_devices: opencl:cpu;opencl:gpu
256+
- name: Intel / Arc A-Series Graphics
257+
runner: '["Linux", "arc"]'
258+
target_devices: level_zero:gpu
259+
- name: Intel / Ponte Vecchio GPU
260+
runner: '["Linux", "pvc"]'
261+
target_devices: level_zero:gpu
262+
- name: Intel / Battlemage Graphics
263+
runner: '["Linux", "bmg"]'
264+
target_devices: level_zero_v2:gpu
265+
- name: NVIDIA/CUDA
266+
runner: '["Linux", "cuda"]'
267+
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN
268+
target_devices: cuda:gpu
269+
- name: AMD/HIP
270+
runner: '["Linux", "amdgpu"]'
271+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
272+
target_devices: hip:gpu
273+
extra_lit_opts: -j 1
274+
275+
uses: ./.github/workflows/sycl-linux-run-tests.yml
276+
with:
277+
name: ${{ matrix.name }} with NewOffloadModel
278+
runner: ${{ matrix.runner }}
279+
image: ${{ matrix.image }}
280+
image_options: ${{ matrix.image_options || '-u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN' }}
281+
target_devices: ${{ matrix.target_devices }}
282+
extra_lit_opts: ${{ matrix.extra_lit_opts }} --param enable_new_offload_model=True
283+
repo_ref: ${{ github.sha }}
284+
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
285+
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
286+
toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }}
287+
binaries_artifact: 'e2e_bin_new_offload_model'
288+
testing_mode: 'run-only'
289+
290+
239291
test-perf:
240292
needs: [build, detect_changes]
241293
permissions:

.github/workflows/sycl-nightly.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
toolchain_artifact_filename: sycl_linux_libcxx.tar.zst
9393

9494
ubuntu2204_test:
95+
name: ubuntu2204_test
9596
needs: [ubuntu2204_build]
9697
permissions:
9798
contents: write
@@ -100,6 +101,7 @@ jobs:
100101
strategy:
101102
fail-fast: false
102103
matrix:
104+
enable_new_offload_model: ['False', 'True']
103105
include:
104106
- name: AMD/HIP
105107
runner: '["Linux", "amdgpu"]'
@@ -111,6 +113,7 @@ jobs:
111113
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
112114
target_devices: hip:gpu
113115
extra_lit_opts: --param test-preview-mode=True
116+
enable_new_offload_model: 'False'
114117

115118
- name: NVIDIA/CUDA
116119
runner: '["Linux", "cuda"]'
@@ -122,6 +125,7 @@ jobs:
122125
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN
123126
target_devices: cuda:gpu
124127
extra_lit_opts: --param test-preview-mode=True
128+
enable_new_offload_model: 'False'
125129

126130
- name: Intel L0 Gen12 GPU
127131
runner: '["Linux", "gen12"]'
@@ -139,6 +143,7 @@ jobs:
139143
runner: '["Linux", "bmg"]'
140144
target_devices: level_zero:gpu
141145
extra_lit_opts: --param test-preview-mode=True
146+
enable_new_offload_model: 'False'
142147

143148
- name: Intel L0 Arc A-Series GPU
144149
runner: '["Linux", "arc"]'
@@ -167,15 +172,16 @@ jobs:
167172
runner: '["Linux", "pvc"]'
168173
target_devices: level_zero:gpu
169174
extra_lit_opts: --param test-preview-mode=True
175+
enable_new_offload_model: 'False'
170176

171177
uses: ./.github/workflows/sycl-linux-run-tests.yml
172178
with:
173-
name: ${{ matrix.name }}
179+
name: ${{ matrix.name }} with ${{ matrix.enable_new_offload_model == 'True' && 'New Offload Model' || 'Old Offload Model' }}
174180
runner: ${{ matrix.runner }}
175181
image_options: ${{ matrix.image_options || '-u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN' }}
176182
target_devices: ${{ matrix.target_devices }}
177183
tests_selector: e2e
178-
extra_lit_opts: "--param 'cxx_flags=-D_GLIBCXX_USE_CXX11_ABI=0' ${{ matrix.extra_lit_opts }}"
184+
extra_lit_opts: "--param 'cxx_flags=-D_GLIBCXX_USE_CXX11_ABI=0' ${{ matrix.extra_lit_opts }} --param enable_new_offload_model=${{ matrix.enable_new_offload_model }}"
179185
repo_ref: ${{ github.sha }}
180186
toolchain_artifact: ${{ needs.ubuntu2204_build.outputs.toolchain_artifact }}
181187
toolchain_artifact_filename: ${{ needs.ubuntu2204_build.outputs.toolchain_artifact_filename }}
@@ -214,13 +220,15 @@ jobs:
214220

215221
e2e-win:
216222
needs: build-win
223+
name: E2E win with ${{ matrix.enable_new_offload_model == 'True' && 'New Offload Model' || 'Old Offload Model' }}
217224
# Continue if build was successful.
218225
if: |
219226
!cancelled()
220227
&& needs.build-win.outputs.build_conclusion == 'success'
221228
strategy:
222229
fail-fast: false
223230
matrix:
231+
enable_new_offload_model: ['False', 'True']
224232
include:
225233
- name: Intel Gen12 GPU
226234
runner: '["Windows", "gen12"]'
@@ -237,6 +245,7 @@ jobs:
237245
runner: ${{ matrix.runner }}
238246
target_devices: level_zero:gpu
239247
toolchain_artifact_filename: ${{ needs.build-win.outputs.toolchain_artifact_filename }}
248+
extra_lit_opts: --param enable_new_offload_model=${{ matrix.enable_new_offload_model }}
240249

241250
cuda-aws-start:
242251
needs: [ubuntu2204_build]

.github/workflows/sycl-ur-perf-benchmarking.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,9 @@ on:
5656
description: Save and upload results (to https://intel.github.io/llvm/benchmarks)
5757
type: choice
5858
options:
59-
- false
60-
- true
61-
default: true
62-
exit_on_failure:
63-
description: Fail benchmark script on any error. Limit number of iterations to just test correctness.
64-
type: choice
65-
options:
66-
- false
67-
- true
68-
default: false
59+
- 'false'
60+
- 'true'
61+
default: 'true'
6962
runner:
7063
description: Self-hosted runner to use for the benchmarks
7164
type: choice
@@ -78,6 +71,21 @@ on:
7871
options:
7972
- 'level_zero:gpu'
8073
- 'level_zero_v2:gpu'
74+
exit_on_failure:
75+
description: Fail benchmark script on any error. If true, limit number of iterations to just test correctness.
76+
type: choice
77+
options:
78+
- 'false'
79+
- 'true'
80+
default: 'false'
81+
# Special input to trigger nightly benchmarking; rest of inputs are ignored in that case.
82+
trigger_nightly:
83+
description: Trigger nightly benchmarking (run and save Baseline)
84+
type: choice
85+
options:
86+
- 'false'
87+
- 'true'
88+
default: 'false'
8189

8290
concurrency:
8391
# Cancel a currently running workflow for:
@@ -96,7 +104,7 @@ jobs:
96104
# Manual trigger (dispatch) path:
97105
sanitize_inputs_dispatch:
98106
name: '[Dispatch] Sanitize inputs'
99-
if: github.event_name == 'workflow_dispatch'
107+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.trigger_nightly == 'false' }}
100108
runs-on: ubuntu-latest
101109
env:
102110
COMMIT_HASH: ${{ inputs.commit_hash }}
@@ -194,7 +202,7 @@ jobs:
194202
# Nightly benchmarking path:
195203
build_nightly:
196204
name: '[Nightly] Build SYCL'
197-
if: github.repository == 'intel/llvm' && github.event_name == 'schedule'
205+
if: ${{ github.repository == 'intel/llvm' && (github.event_name == 'schedule' || inputs.trigger_nightly == 'true') }}
198206
uses: ./.github/workflows/sycl-linux-build.yml
199207
secrets: inherit
200208
with:

.github/workflows/sycl-windows-build.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ on:
5050
type: string
5151
required: false
5252

53+
e2e_binaries_new_offload_model_artifact:
54+
type: string
55+
required: false
56+
5357
outputs:
5458
build_conclusion:
5559
value: ${{ jobs.build.outputs.build_conclusion }}
@@ -186,10 +190,6 @@ jobs:
186190
if: ${{ !cancelled() && contains(inputs.changes, 'xptifw') }}
187191
run: |
188192
cmake --build build --target check-xptifw
189-
- name: check-libdevice
190-
if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }}
191-
run: |
192-
cmake --build build --target check-libdevice
193193
- name: Generate/diff new ABI symbols
194194
if: ${{ !cancelled() && contains(inputs.changes, 'sycl') }}
195195
shell: bash
@@ -255,6 +255,21 @@ jobs:
255255
extra_lit_opts: --param sycl_build_targets="spir"
256256
cxx: ${{ inputs.cxx }}
257257

258+
- name: Build E2E tests with New Offload Model
259+
if: |
260+
inputs.e2e_binaries_artifact &&
261+
!cancelled() &&
262+
steps.build.conclusion == 'success' &&
263+
contains(github.event.pull_request.labels.*.name, 'new-offload-model')
264+
uses: ./devops/actions/run-tests/windows/e2e
265+
with:
266+
ref: ${{ inputs.ref || github.sha }}
267+
testing_mode: build-only
268+
target_devices: all
269+
binaries_artifact: ${{ inputs.e2e_binaries_new_offload_model_artifact }}
270+
extra_lit_opts: --param sycl_build_targets="spir" --param enable_new_offload_model=True
271+
cxx: ${{ inputs.cxx }}
272+
258273
- name: Detect hung tests
259274
if: always()
260275
shell: powershell

.github/workflows/sycl-windows-precommit.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
with:
5858
changes: ${{ needs.detect_changes.outputs.filters }}
5959
e2e_binaries_artifact: sycl_windows_e2ebin
60+
e2e_binaries_new_offload_model_artifact: sycl_windows_e2ebin_with_new_offload_model
6061

6162
run_prebuilt_e2e_tests:
6263
needs: build
@@ -82,3 +83,30 @@ jobs:
8283
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
8384
testing_mode: run-only
8485
binaries_artifact: sycl_windows_e2ebin
86+
87+
run_prebuilt_e2e_with_new_offload_model_tests:
88+
needs: build
89+
# Continue if build was successful.
90+
if: |
91+
!cancelled() &&
92+
needs.build.outputs.build_conclusion == 'success' &&
93+
contains(github.event.pull_request.labels.*.name, 'new-offload-model')
94+
strategy:
95+
fail-fast: false
96+
matrix:
97+
include:
98+
- name: Intel GEN12 Graphics with Level Zero
99+
runner: '["Windows","gen12"]'
100+
- name: Intel Arc Graphics with Level Zero
101+
runner: '["Windows","arc"]'
102+
- name: Intel Battlemage Graphics with Level Zero
103+
runner: '["Windows","bmg"]'
104+
uses: ./.github/workflows/sycl-windows-run-tests.yml
105+
with:
106+
name: ${{ matrix.name }}
107+
runner: ${{ matrix.runner }}
108+
target_devices: "level_zero:gpu"
109+
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
110+
testing_mode: run-only
111+
binaries_artifact: sycl_windows_e2ebin_with_new_offload_model
112+
extra_lit_opts: --param enable_new_offload_model=True

clang/include/clang/Basic/OffloadArch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ enum class OffloadArch {
170170
LNL_M,
171171
LAST,
172172

173-
CudaDefault = OffloadArch::SM_52,
173+
CudaDefault = OffloadArch::SM_75,
174174
HIPDefault = OffloadArch::GFX906,
175175
};
176176

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
11041104
// configure the pipeline.
11051105
OptimizationLevel Level = mapToLevel(CodeGenOpts);
11061106

1107-
if (LangOpts.SYCLIsDevice)
1107+
if (LangOpts.SYCLIsDevice) {
11081108
PB.registerPipelineStartEPCallback([&](ModulePassManager &MPM,
11091109
OptimizationLevel Level) {
11101110
MPM.addPass(SYCLVirtualFunctionsAnalysisPass());
@@ -1118,17 +1118,23 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
11181118
/*FP64ConvEmu=*/CodeGenOpts.FP64ConvEmu,
11191119
/*ExcludeAspects=*/{"fp64"}));
11201120
MPM.addPass(SYCLPropagateJointMatrixUsagePass());
1121-
// Lowers static/dynamic local memory builtin calls.
1122-
MPM.addPass(SYCLLowerWGLocalMemoryPass());
11231121
// Compile-time properties pass must create standard metadata as early
11241122
// as possible to make them available for other passes.
11251123
MPM.addPass(CompileTimePropertiesPass());
11261124
});
1127-
else if (LangOpts.SYCLIsHost && !LangOpts.SYCLESIMDBuildHostCode)
1125+
PB.registerOptimizerEarlyEPCallback(
1126+
[](ModulePassManager &MPM, OptimizationLevel, ThinOrFullLTOPhase) {
1127+
// Allocate static local memory in SYCL kernel scope for each
1128+
// allocation call. This pass must run after AlwaysInline pass due
1129+
// to current implementation restriction.
1130+
MPM.addPass(SYCLLowerWGLocalMemoryPass());
1131+
});
1132+
} else if (LangOpts.SYCLIsHost && !LangOpts.SYCLESIMDBuildHostCode) {
11281133
PB.registerPipelineStartEPCallback(
11291134
[&](ModulePassManager &MPM, OptimizationLevel Level) {
11301135
MPM.addPass(ESIMDRemoveHostCodePass());
11311136
});
1137+
}
11321138

11331139
// Add the InferAddressSpaces and SYCLOptimizeBarriers passes for all
11341140
// the SPIR[V] targets

0 commit comments

Comments
 (0)