Skip to content

Commit 6c73e2a

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into xfail_fix
2 parents 1c2ce41 + 864038a commit 6c73e2a

File tree

90 files changed

+2208
-1364
lines changed

Some content is hidden

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

90 files changed

+2208
-1364
lines changed

.github/workflows/sycl-containers-igc-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
imagefile: ubuntu2404_intel_drivers
3434
tag: devigc
3535
build_args: |
36-
"use_latest=false"
36+
"use_unstable_driver=false"
3737
"use_igc_dev=true"
3838
steps:
3939
- name: Checkout

.github/workflows/sycl-containers.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,37 @@ jobs:
4343
file: ubuntu2404_base
4444
tag: latest
4545
build_args: ""
46-
- name: Build Ubuntu Docker image
46+
- name: Build Ubuntu 22.04 Docker image
4747
file: ubuntu2204_build
4848
tag: latest
4949
build_args: ""
50+
- name: Build Ubuntu 24.04 Docker image
51+
file: ubuntu2404_build
52+
tag: latest
53+
build_args: ""
5054
- name: Build Ubuntu 24.04 oneAPI Docker image
5155
file: ubuntu2404_build_oneapi
5256
tag: latest
5357
build_args: ""
5458
- name: Intel Drivers Ubuntu 22.04 Docker image
5559
file: ubuntu2204_intel_drivers
5660
tag: latest
57-
build_args: "use_latest=false"
61+
build_args: "use_unstable_driver=false"
5862
- name: Intel Drivers Ubuntu 24.04 Docker image
5963
file: ubuntu2404_intel_drivers
6064
tag: latest
61-
build_args: "use_latest=false"
65+
build_args: "use_unstable_driver=false"
6266
- name: Intel Drivers (unstable) Ubuntu 24.04 Docker image
6367
file: ubuntu2404_intel_drivers
6468
tag: unstable
65-
build_args: "use_latest=true"
69+
build_args: "use_unstable_driver=true"
6670
- name: Build + Intel Drivers Ubuntu 22.04 Docker image
6771
file: ubuntu2204_intel_drivers
6872
tag: alldeps
6973
build_args: |
7074
base_image=ghcr.io/intel/llvm/ubuntu2204_build
7175
base_tag=latest
72-
use_latest=false
76+
use_unstable_driver=false
7377
steps:
7478
- name: Checkout
7579
uses: actions/checkout@v4

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

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,53 @@ jobs:
7272
else
7373
echo 'arc_tests="Matrix/"' >> "$GITHUB_OUTPUT"
7474
fi
75+
76+
build_e2e_tests:
77+
needs: [build]
78+
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
79+
uses: ./.github/workflows/sycl-linux-run-tests.yml
80+
with:
81+
name: Build e2e tests
82+
runner: '["Linux", "build"]'
83+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
84+
image_options: -u 1001
85+
ref: ${{ github.sha }}
86+
merge_ref: ''
87+
sycl_toolchain_artifact: sycl_linux_default
88+
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
89+
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
90+
e2e_testing_mode: 'build-only'
91+
run_prebuilt_e2e_tests:
92+
needs: [build, build_e2e_tests]
93+
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
94+
strategy:
95+
fail-fast: false
96+
matrix:
97+
include:
98+
- name: Intel
99+
runner: '["Linux", "gen12"]'
100+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
101+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
102+
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
103+
reset_intel_gpu: true
104+
extra_lit_opts: --param gpu-intel-gen12=True
105+
uses: ./.github/workflows/sycl-linux-run-tests.yml
106+
with:
107+
name: ${{ matrix.name }}
108+
runner: ${{ matrix.runner }}
109+
image: ${{ matrix.image }}
110+
image_options: ${{ matrix.image_options }}
111+
target_devices: ${{ matrix.target_devices }}
112+
extra_lit_opts: --param fallback-to-build-if-requires-build-and-run=True ${{ matrix.extra_lit_opts }}
113+
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
114+
ref: ${{ github.sha }}
115+
merge_ref: ''
116+
sycl_toolchain_artifact: sycl_linux_default
117+
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
118+
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
119+
e2e_binaries_artifact: sycl_e2e_bin_default
120+
e2e_testing_mode: 'run-only'
121+
75122
test:
76123
needs: [build, detect_changes, determine_arc_tests]
77124
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
@@ -90,13 +137,6 @@ jobs:
90137
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
91138
target_devices: ext_oneapi_hip:gpu
92139
reset_intel_gpu: false
93-
- name: Intel
94-
runner: '["Linux", "gen12"]'
95-
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
96-
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
97-
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
98-
reset_intel_gpu: true
99-
extra_lit_opts: --param gpu-intel-gen12=True
100140
- name: E2E tests on Intel Arc A-Series Graphics
101141
runner: '["Linux", "arc"]'
102142
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919

2020
target_devices:
2121
type: string
22-
required: True
22+
required: False
2323
extra_cmake_args:
2424
type: string
2525
required: False
@@ -59,6 +59,30 @@ on:
5959
default: ''
6060
required: False
6161

62+
e2e_binaries_artifact:
63+
description: |
64+
By setting this the E2E binaries folder will not be created, rather it
65+
will be downloaded and extracted from the specified artifact. When
66+
running tests in `run-only` mode this must be provided.
67+
type: string
68+
default: ''
69+
required: False
70+
e2e_testing_mode:
71+
description: |
72+
Testing mode to run E2E tests in, can be either `full`, `build-only`
73+
or `run-only`. In `build-only` mode an artifact of the E2E binaries
74+
will be uploaded.
75+
type: string
76+
default: 'full'
77+
artifact_suffix:
78+
description: 'Suffix for E2E binaries artifact that is output when in `build-only`.'
79+
type: string
80+
default: 'default'
81+
retention-days:
82+
description: 'E2E binaries artifact retention period.'
83+
type: string
84+
default: 1
85+
6286
reset_intel_gpu:
6387
type: string
6488
required: False
@@ -86,7 +110,9 @@ on:
86110
- '["Linux", "gen12"]'
87111
- '["amdgpu"]'
88112
- '["Linux", "arc"]'
113+
- '["Linux", "pvc"]'
89114
- '["cts-cpu"]'
115+
- '["Linux", "build"]'
90116
image:
91117
description: |
92118
Use option ending with ":build" for AMDGPU, ":latest" for the rest.
@@ -142,6 +168,11 @@ on:
142168
options:
143169
- false
144170
- true
171+
e2e_testing_mode:
172+
type: choice
173+
options:
174+
- "full"
175+
- "build-only"
145176

146177
permissions:
147178
contents: read
@@ -270,8 +301,19 @@ jobs:
270301
cat /usr/local/lib/igc/IGCTAG.txt
271302
fi
272303
304+
- name: Download E2E Binaries
305+
if: inputs.e2e_binaries_artifact != ''
306+
uses: actions/download-artifact@v4
307+
with:
308+
name: ${{ inputs.e2e_binaries_artifact }}
309+
- name: Extract E2E Binaries
310+
if: inputs.e2e_binaries_artifact != ''
311+
run: |
312+
mkdir build-e2e
313+
tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e
314+
273315
- name: Deduce E2E CMake options
274-
if: inputs.tests_selector == 'e2e'
316+
if: inputs.tests_selector == 'e2e' && inputs.e2e_binaries_artifact == ''
275317
id: cmake_opts
276318
shell: bash
277319
env:
@@ -281,14 +323,14 @@ jobs:
281323
echo "opts=$CMAKE_EXTRA_ARGS" >> $GITHUB_OUTPUT
282324
fi
283325
- name: Configure E2E tests
284-
if: inputs.tests_selector == 'e2e'
326+
if: inputs.tests_selector == 'e2e' && inputs.e2e_binaries_artifact == ''
285327
run: |
286-
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DSYCL_TEST_E2E_TARGETS="${{ inputs.target_devices }}" -DCMAKE_CXX_COMPILER="$(which clang++)" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }}
328+
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DCMAKE_CXX_COMPILER="$(which clang++)" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ steps.cmake_opts.outputs.opts }}
287329
- name: SYCL End-to-end tests
288330
shell: bash {0}
289331
if: inputs.tests_selector == 'e2e'
290332
env:
291-
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests ${{ inputs.extra_lit_opts }}
333+
LIT_OPTS: -v --no-progress-bar --show-unsupported --show-pass --show-xfail --max-time 3600 --time-tests --param test-mode=${{ inputs.e2e_testing_mode }} --param sycl_devices=${{ inputs.target_devices }} ${{ inputs.extra_lit_opts }}
292334
run: |
293335
ninja -C build-e2e check-sycl-e2e > e2e.log 2>&1
294336
exit_code=$?
@@ -375,3 +417,13 @@ jobs:
375417
grep 'exit code: [^0]' -r logs >> $GITHUB_STEP_SUMMARY
376418
377419
exit $ret
420+
- name: Pack E2E binaries
421+
if: ${{ always() && !cancelled() && inputs.e2e_testing_mode == 'build-only'}}
422+
run: tar -I 'zstd -9' -cf e2e_binaries.tar.zst -C ./build-e2e .
423+
- name: Upload E2E binaries
424+
if: ${{ always() && !cancelled() && inputs.e2e_testing_mode == 'build-only'}}
425+
uses: actions/upload-artifact@v4
426+
with:
427+
name: sycl_e2e_bin_${{ inputs.artifact_suffix }}
428+
path: e2e_binaries.tar.zst
429+
retention-days: ${{ inputs.retention-days }}

.github/workflows/sycl-post-commit.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ jobs:
6060
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
6161
target_devices: ext_oneapi_hip:gpu
6262
reset_intel_gpu: false
63+
- name: E2E tests on Intel Ponte Vecchio GPU
64+
runner: '["Linux", "pvc"]'
65+
env: '{"LIT_FILTER_OUT":"ESIMD/unified_memory_api/"}'
66+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:latest
67+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
68+
target_devices: ext_oneapi_level_zero:gpu;opencl:gpu
69+
extra_lit_opts: -j 50
70+
- name: E2E tests with dev igc on Intel Ponte Vecchio GPU
71+
runner: '["Linux", "pvc"]'
72+
env: '{"LIT_FILTER_OUT":"ESIMD/unified_memory_api/"}'
73+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
74+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
75+
target_devices: ext_oneapi_level_zero:gpu;opencl:gpu
76+
use_igc_dev: true
77+
extra_lit_opts: -j 50
6378
# Performance tests below. Specifics:
6479
# - only run performance tests (use LIT_FILTER env)
6580
# - ask llvm-lit to show all the output, even for PASS (-a)

devops/containers/ubuntu2204_intel_drivers.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM $base_image:$base_tag
55

66
ENV DEBIAN_FRONTEND=noninteractive
77

8-
ARG use_latest=true
8+
ARG use_unstable_driver=true
99

1010
USER root
1111

@@ -18,7 +18,7 @@ COPY dependencies.json /
1818
RUN mkdir /runtimes
1919
ENV INSTALL_LOCATION=/runtimes
2020
RUN --mount=type=secret,id=github_token \
21-
if [ "$use_latest" = "true" ]; then \
21+
if [ "$use_unstable_driver" = "true" ]; then \
2222
install_driver_opt=" --use-latest"; \
2323
else \
2424
install_driver_opt=" dependencies.json"; \
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM nvidia/cuda:12.6.3-devel-ubuntu24.04
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
USER root
6+
7+
# Install SYCL prerequisites
8+
COPY scripts/install_build_tools.sh /install.sh
9+
RUN /install.sh
10+
11+
SHELL ["/bin/bash", "-ec"]
12+
13+
# Make the directory if it doesn't exist yet.
14+
# This location is recommended by the distribution maintainers.
15+
RUN mkdir --parents --mode=0755 /etc/apt/keyrings
16+
# Download the key, convert the signing-key to a full
17+
# keyring required by apt and store in the keyring directory
18+
RUN wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
19+
gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null && \
20+
# Add rocm repo
21+
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/6.3/ubuntu noble main" \
22+
| tee /etc/apt/sources.list.d/amdgpu.list && \
23+
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.3 noble main" \
24+
| tee --append /etc/apt/sources.list.d/rocm.list && \
25+
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
26+
| tee /etc/apt/preferences.d/rocm-pin-600 && \
27+
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
28+
| tee /etc/apt/preferences.d/rocm-pin-600
29+
# Install the ROCM kernel driver
30+
RUN apt update && apt install -yqq rocm-dev && \
31+
apt-get clean && \
32+
rm -rf /var/lib/apt/lists/*
33+
34+
COPY scripts/create-sycl-user.sh /user-setup.sh
35+
RUN /user-setup.sh
36+
37+
COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh
38+
39+
USER sycl
40+
41+
ENTRYPOINT ["/docker_entrypoint.sh"]
42+

devops/containers/ubuntu2404_intel_drivers.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM $base_image:$base_tag
55

66
ENV DEBIAN_FRONTEND=noninteractive
77

8-
ARG use_latest=true
8+
ARG use_unstable_driver=true
99

1010
USER root
1111

@@ -18,7 +18,7 @@ COPY dependencies.json /
1818
RUN mkdir /runtimes
1919
ENV INSTALL_LOCATION=/runtimes
2020
RUN --mount=type=secret,id=github_token \
21-
if [ "$use_latest" = "true" ]; then \
21+
if [ "$use_unstable_driver" = "true" ]; then \
2222
install_driver_opt=" --use-latest"; \
2323
else \
2424
install_driver_opt=" dependencies.json"; \

llvm/lib/SYCLLowerIR/SanitizerKernelMetadata.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,29 @@ PreservedAnalyses SanitizerKernelMetadataPass::run(Module &M,
3838
auto &DL = M.getDataLayout();
3939
auto &Ctx = M.getContext();
4040

41+
// Fix device global type, by wrapping a structure type
42+
{
43+
assert(KernelMetadata->getValueType()->isArrayTy());
44+
45+
auto *KernelMetadataOld = KernelMetadata;
46+
47+
StructType *StructTypeWithArray = StructType::create(Ctx);
48+
StructTypeWithArray->setBody(KernelMetadataOld->getValueType());
49+
50+
KernelMetadata = new GlobalVariable(
51+
M, StructTypeWithArray, false, GlobalValue::ExternalLinkage,
52+
ConstantStruct::get(StructTypeWithArray,
53+
KernelMetadataOld->getInitializer()),
54+
"", nullptr, GlobalValue::NotThreadLocal, 1); // Global AddressSpace
55+
KernelMetadata->takeName(KernelMetadataOld);
56+
KernelMetadata->setUnnamedAddr(GlobalValue::UnnamedAddr::Local);
57+
KernelMetadata->setDSOLocal(true);
58+
KernelMetadata->copyAttributesFrom(KernelMetadataOld);
59+
KernelMetadata->copyMetadata(KernelMetadataOld, 0);
60+
61+
KernelMetadataOld->eraseFromParent();
62+
}
63+
4164
// Fix attributes
4265
KernelMetadata->addAttribute(
4366
"sycl-device-global-size",

llvm/test/tools/sycl-post-link/device-sanitizer/asan.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_E8MyKernel = comdat any
1818

1919
@__asan_kernel = internal addrspace(1) constant [55 x i8] c"_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_E8MyKernel\00"
2020
@__AsanKernelMetadata = appending dso_local local_unnamed_addr addrspace(1) global [1 x { i64, i64 }] [{ i64, i64 } { i64 ptrtoint (ptr addrspace(1) @__asan_kernel to i64), i64 54 }] #2
21-
; CHECK-IR: @__AsanKernelMetadata {{.*}} !spirv.Decorations
21+
; CHECK-IR: @__AsanKernelMetadata = dso_local local_unnamed_addr addrspace(1) global %0 { {{.*}} }, !spirv.Decorations
2222
@__spirv_BuiltInGlobalInvocationId = external dso_local local_unnamed_addr addrspace(1) constant <3 x i64>, align 32
2323
@__asan_func = internal addrspace(2) constant [106 x i8] c"typeinfo name for main::'lambda'(sycl::_V1::handler&)::operator()(sycl::_V1::handler&) const::MyKernelR_4\00"
2424

0 commit comments

Comments
 (0)