Skip to content

Commit 6b5534c

Browse files
authored
Merge branch 'main' into yc/1024-devasan-bug-symbolizer-destruct-too-early
2 parents 4c32c8f + eddfd8e commit 6b5534c

File tree

365 files changed

+19240
-6197
lines changed

Some content is hidden

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

365 files changed

+19240
-6197
lines changed

.github/docker/install_dpcpp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ if [ "${SKIP_DPCPP_BUILD}" ]; then
1616
fi
1717

1818
mkdir -p ${DPCPP_PATH}/dpcpp_compiler
19-
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
19+
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
2020
tar -xvf ${DPCPP_PATH}/dpcpp_compiler.tar.gz -C ${DPCPP_PATH}/dpcpp_compiler

.github/workflows/benchmarks_compute.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,31 @@ jobs:
152152
run: cmake --build ${{github.workspace}}/sycl_build -j
153153

154154
- name: Configure UR
155-
working-directory: ${{github.workspace}}/ur-repo
156155
run: >
157156
cmake -DCMAKE_BUILD_TYPE=Release
158-
-B${{github.workspace}}/ur-repo/build
157+
-S${{github.workspace}}/ur-repo
158+
-B${{github.workspace}}/ur_build
159+
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/ur_install
159160
-DUR_BUILD_TESTS=OFF
160161
-DUR_BUILD_ADAPTER_L0=ON
161162
-DUR_BUILD_ADAPTER_L0_V2=ON
163+
-DUMF_DISABLE_HWLOC=ON
162164
163165
- name: Build UR
164-
run: cmake --build ${{github.workspace}}/ur-repo/build -j $(nproc)
166+
run: cmake --build ${{github.workspace}}/ur_build -j $(nproc)
167+
168+
- name: Install UR
169+
run: cmake --install ${{github.workspace}}/ur_build
165170

166171
- name: Run benchmarks
167172
id: benchmarks
168-
run: numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py ~/bench_workdir ${{github.workspace}}/sycl_build ${{github.workspace}}/ur-repo ${{ matrix.adapter.str_name }} ${{ inputs.bench_script_params }}
173+
run: >
174+
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
175+
~/bench_workdir
176+
${{github.workspace}}/sycl_build
177+
${{github.workspace}}/ur_install
178+
${{ matrix.adapter.str_name }}
179+
${{ inputs.bench_script_params }}
169180
170181
- name: Add comment to PR
171182
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,24 @@ jobs:
8282
-DUR_ENABLE_TRACING=ON
8383
-DUR_DEVELOPER_MODE=ON
8484
-DUR_BUILD_TESTS=ON
85+
-DUR_CONFORMANCE_TEST_LOADER=OFF
8586
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
8687
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
8788
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
8889
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
8990
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
91+
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
9092
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}
9193
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
9294
9395
- name: Build
9496
# This is so that device binaries can find the sycl runtime library
9597
run: cmake --build ${{github.workspace}}/build -j $(nproc)
9698

99+
- name: Install
100+
# This is to check that install command does not fail
101+
run: cmake --install ${{github.workspace}}/build
102+
97103
- name: Test adapter specific
98104
working-directory: ${{github.workspace}}/build
99105
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180

.github/workflows/cmake.yml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: Install apt packages
5050
run: |
5151
sudo apt-get update
52-
sudo apt-get install -y doxygen ${{matrix.compiler.c}}
52+
sudo apt-get install -y ${{matrix.compiler.c}} devscripts
5353
5454
- name: Install libhwloc
5555
run: .github/scripts/install_hwloc.sh
@@ -62,9 +62,6 @@ jobs:
6262
run: |
6363
sudo apt-get install -y ${{matrix.compiler.cxx}}
6464
65-
- name: Install pip packages
66-
run: pip install -r third_party/requirements.txt
67-
6865
- name: Install libbacktrace
6966
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
7067
run: |
@@ -79,12 +76,13 @@ jobs:
7976
if: matrix.os == 'ubuntu-22.04'
8077
run: |
8178
sudo apt install libncurses5
82-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
79+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
8380
mkdir -p ${{github.workspace}}/dpcpp_compiler
8481
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler
8582
8683
- name: Configure CMake
8784
if: matrix.os == 'ubuntu-22.04'
85+
# WEXTRA: https://github.com/oneapi-src/unified-runtime/issues/2109
8886
run: >
8987
cmake
9088
-B${{github.workspace}}/build
@@ -93,14 +91,18 @@ jobs:
9391
-DUR_ENABLE_TRACING=ON
9492
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
9593
-DUR_BUILD_TESTS=ON
96-
-DUR_FORMAT_CPP_STYLE=ON
94+
-DUR_FORMAT_CPP_STYLE=OFF
95+
-DUR_DEVELOPER_MODE=ON
9796
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
97+
-DUR_CONFORMANCE_TEST_LOADER=OFF
9898
${{matrix.libbacktrace}}
9999
${{matrix.pool_tracking}}
100100
${{matrix.latency_tracking}}
101101
102102
- name: Configure CMake
103103
if: matrix.os == 'ubuntu-20.04'
104+
# WEXTRA: https://github.com/oneapi-src/unified-runtime/issues/2109
105+
# Note: Disable Werror, since 20.04 raises different ones than 22.04
104106
run: >
105107
cmake
106108
-B${{github.workspace}}/build
@@ -109,21 +111,20 @@ jobs:
109111
-DUR_ENABLE_TRACING=ON
110112
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
111113
-DUR_BUILD_TESTS=ON
112-
-DUR_FORMAT_CPP_STYLE=ON
114+
-DUR_FORMAT_CPP_STYLE=OFF
115+
-DUR_DEVELOPER_MODE=OFF
113116
${{matrix.libbacktrace}}
114117
${{matrix.pool_tracking}}
115118
${{matrix.latency_tracking}}
116119
117-
- name: Generate source from spec, check for uncommitted diff
118-
if: matrix.os == 'ubuntu-22.04'
119-
run: cmake --build ${{github.workspace}}/build --target check-generated
120-
121-
- name: Verify that each source file contains a license
122-
run: cmake --build ${{github.workspace}}/build --target verify-licenses
123-
124120
- name: Build
125121
run: cmake --build ${{github.workspace}}/build -j $(nproc)
126122

123+
- name: Verify hardening flags have been set
124+
run: cmake --build ${{github.workspace}}/build --target verify-hardening
125+
# https://github.com/oneapi-src/unified-runtime/issues/2120
126+
if: ${{ matrix.compiler.cxx != 'clang++' && matrix.os != 'ubuntu-20.04' }}
127+
127128
- name: Test
128129
working-directory: ${{github.workspace}}/build
129130
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace"
@@ -251,20 +252,6 @@ jobs:
251252
steps:
252253
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
253254

254-
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
255-
with:
256-
python-version: 3.9
257-
258-
- name: Install prerequisites
259-
run: python3 -m pip install -r third_party/requirements.txt
260-
261-
- name: Install doxygen
262-
run: |
263-
$WorkingDir = $PWD.Path
264-
Invoke-WebRequest -Uri https://github.com/doxygen/doxygen/releases/download/Release_1_9_8/doxygen-1.9.8.windows.x64.bin.zip -OutFile "$WorkingDir\doxygen.zip"
265-
Expand-Archive -Path "$WorkingDir\doxygen.zip"
266-
Add-Content $env:GITHUB_PATH "$WorkingDir\doxygen"
267-
268255
- name: Install hwloc
269256
run: vcpkg install hwloc:x64-windows
270257

@@ -282,14 +269,10 @@ jobs:
282269
-DUR_ENABLE_TRACING=ON
283270
-DUR_DEVELOPER_MODE=ON
284271
-DUR_BUILD_TESTS=ON
285-
-DUR_FORMAT_CPP_STYLE=ON
272+
-DUR_FORMAT_CPP_STYLE=OFF
273+
-DUR_CONFORMANCE_TEST_LOADER=OFF
286274
${{matrix.adapter.var}}
287275
288-
# TODO: re-enable when check-generated is fixed for windows runners see #888
289-
# - name: Generate source from spec, check for uncommitted diff
290-
# if: matrix.os == 'windows-2022'
291-
# run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}}
292-
293276
- name: Build all
294277
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
295278

@@ -301,7 +284,7 @@ jobs:
301284
name: Build - MacOS
302285
strategy:
303286
matrix:
304-
os: ['macos-12', 'macos-13']
287+
os: ['macos-13']
305288
runs-on: ${{matrix.os}}
306289

307290
steps:

.github/workflows/e2e_level_zero.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
config: ""
2222
unit: "gpu"
2323
# Failing tests
24-
xfail: "DeviceCodeSplit/grf.cpp;ESIMD/mask_expand_load.cpp;KernelAndProgram/target_register_alloc_mode.cpp;Matrix/SG32/get_coord_int8_matB.cpp;Matrix/get_coord_int8_matB.cpp;Matrix/joint_matrix_prefetch.cpp;Matrix/joint_matrix_rowmajorA_rowmajorB.cpp;ESIMD/mask_expand_load.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_bf16_fill_k_cache_OOB.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_out_bounds.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_prefetch.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_rowmajorA_rowmajorB.cpp;Matrix/element_wise_all_ops_1d.cpp;Matrix/element_wise_all_ops_1d_cont.cpp;Matrix/element_wise_all_ops_scalar.cpp;Matrix/joint_matrix_bf16_fill_k_cache_OOB.cpp;Matrix/joint_matrix_bf16_fill_k_cache_prefetch.cpp;Matrix/joint_matrix_out_bounds.cpp;Matrix/joint_matrix_unaligned_k.cpp;Matrix/SPVCooperativeMatrix/SG32/get_coord_int8_matB.cpp;Matrix/SPVCooperativeMatrix/element_wise_all_ops_1d.cpp;Matrix/SPVCooperativeMatrix/element_wise_all_ops_1d_cont.cpp;Matrix/SPVCooperativeMatrix/element_wise_all_ops_scalar.cpp;Matrix/SPVCooperativeMatrix/element_wise_ops.cpp;Matrix/SPVCooperativeMatrix/get_coord_int8_matB.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_bf16_fill_k_cache_SLM.cpp;Matrix/joint_matrix_bf16_fill_k_cache_SLM.cpp"
24+
xfail: "InvokeSimd/Regression/call_vadd_1d_spill.cpp;InvokeSimd/Regression/ImplicitSubgroup/call_vadd_1d_spill.cpp;ESIMD/mask_expand_load.cpp;Matrix/joint_matrix_prefetch.cpp;ESIMD/mask_expand_load.cpp;Matrix/SPVCooperativeMatrix/joint_matrix_prefetch.cpp;Matrix/joint_matrix_bf16_fill_k_cache_prefetch.cpp;Matrix/SPVCooperativeMatrix/element_wise_ops.cpp;"
2525
# Unexpectedly Passed Tests
2626
xfail_not: ""
2727
# Flaky tests

.github/workflows/multi_device.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ jobs:
1717
strategy:
1818
matrix:
1919
adapter: [
20-
{name: L0}
20+
{name: L0},
21+
{name: L0_V2}
2122
]
2223
build_type: [Debug, Release]
2324
compiler: [{c: gcc, cxx: g++}] # TODO: investigate why memory-adapter-level_zero hangs with clang
@@ -30,12 +31,11 @@ jobs:
3031
- name: Install pip packages
3132
run: pip install -r third_party/requirements.txt
3233

33-
# TODO: enable once test failure are fixed/ignored
34-
# - name: Download DPC++
35-
# run: |
36-
# wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
37-
# mkdir dpcpp_compiler
38-
# tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
34+
- name: Download DPC++
35+
run: |
36+
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
37+
mkdir dpcpp_compiler
38+
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
3939
4040
- name: Configure CMake
4141
shell: bash -el {0}
@@ -48,7 +48,10 @@ jobs:
4848
-DUR_DEVELOPER_MODE=ON
4949
-DUR_BUILD_TESTS=ON
5050
-DUR_BUILD_ADAPTER_${{matrix.adapter.name}}=ON
51+
-DUR_CONFORMANCE_TEST_LOADER=OFF
5152
-DUR_TEST_DEVICES_COUNT=2
53+
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
54+
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
5255
5356
- name: Build
5457
run: cmake --build ${{github.workspace}}/build -j $(nproc)
@@ -60,4 +63,4 @@ jobs:
6063

6164
- name: Test adapters
6265
working-directory: ${{github.workspace}}/build
63-
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" --timeout 180
66+
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --output-on-failure -L "conformance" -E "enqueue|kernel|integration|exp_command_buffer|exp_enqueue_native|exp_launch_properties|exp_usm_p2p" --timeout 180

.github/workflows/source-checks.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Source Checks
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
7+
cancel-in-progress: true
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
source-checks:
14+
name: Source Checks
15+
strategy:
16+
matrix:
17+
os: ['ubuntu-22.04', 'windows-2022']
18+
19+
runs-on: ${{matrix.os}}
20+
21+
steps:
22+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
24+
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
25+
with:
26+
python-version: 3.9
27+
28+
- name: Install pip packages
29+
run: pip install -r third_party/requirements.txt
30+
31+
- name: "[Lin] Install doxygen"
32+
if: matrix.os == 'ubuntu-22.04'
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y doxygen
36+
37+
- name: "[Win] Install doxygen"
38+
if: matrix.os == 'windows-2022'
39+
run: |
40+
$WorkingDir = $PWD.Path
41+
Invoke-WebRequest -Uri https://github.com/doxygen/doxygen/releases/download/Release_1_9_8/doxygen-1.9.8.windows.x64.bin.zip -OutFile "$WorkingDir\doxygen.zip"
42+
Expand-Archive -Path "$WorkingDir\doxygen.zip"
43+
Add-Content $env:GITHUB_PATH "$WorkingDir\doxygen"
44+
45+
- name: "[Lin] Install hwloc"
46+
if: matrix.os == 'ubuntu-22.04'
47+
run: .github/scripts/install_hwloc.sh
48+
49+
- name: "[Win] Install hwloc"
50+
if: matrix.os == 'windows-2022'
51+
run: vcpkg install hwloc:x64-windows
52+
53+
- name: Configure CMake
54+
env:
55+
VCPKG_PATH: "C:/vcpkg/packages/hwloc_x64-windows"
56+
run: >
57+
cmake
58+
-B${{github.workspace}}/build
59+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
60+
-DUR_ENABLE_TRACING=OFF
61+
-DCMAKE_BUILD_TYPE=Debug
62+
-DUR_BUILD_TESTS=OFF
63+
-DUR_FORMAT_CPP_STYLE=ON
64+
65+
# Verifying license should be enough on a single OS
66+
- name: Verify that each source file contains a license
67+
if: matrix.os == 'ubuntu-22.04'
68+
run: cmake --build ${{github.workspace}}/build --target verify-licenses
69+
70+
- name: Generate source from spec, check for uncommitted diff
71+
run: cmake --build ${{github.workspace}}/build --target check-generated

CMakeLists.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ option(UR_BUILD_EXAMPLES "Build example applications." ON)
3434
option(UR_BUILD_TESTS "Build unit tests." ON)
3535
option(UR_BUILD_TOOLS "build ur tools" ON)
3636
option(UR_FORMAT_CPP_STYLE "format code style of C++ sources" OFF)
37-
option(UR_DEVELOPER_MODE "enable developer checks, treats warnings as errors" OFF)
37+
option(UR_DEVELOPER_MODE "treats warnings as errors" OFF)
3838
option(UR_ENABLE_FAST_SPEC_MODE "enable fast specification generation mode" OFF)
3939
option(UR_USE_ASAN "enable AddressSanitizer" OFF)
4040
option(UR_USE_UBSAN "enable UndefinedBehaviorSanitizer" OFF)
@@ -68,6 +68,7 @@ set(UR_CONFORMANCE_TARGET_TRIPLES "" CACHE STRING
6868
"List of sycl targets to build CTS device binaries for")
6969
set(UR_CONFORMANCE_AMD_ARCH "" CACHE STRING "AMD device target ID to build CTS binaries for")
7070
option(UR_CONFORMANCE_ENABLE_MATCH_FILES "Enable CTS match files" ON)
71+
option(UR_CONFORMANCE_TEST_LOADER "Also test the loader in the conformance tests" OFF)
7172
set(UR_ADAPTER_LEVEL_ZERO_SOURCE_DIR "" CACHE PATH
7273
"Path to external 'level_zero' adapter source dir")
7374
set(UR_ADAPTER_OPENCL_SOURCE_DIR "" CACHE PATH
@@ -161,6 +162,12 @@ if(UR_ENABLE_TRACING)
161162
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
162163
)
163164

165+
if (NOT MSVC)
166+
# Hardening flags cause issues on Windows
167+
add_ur_target_compile_options(xptifw)
168+
add_ur_target_link_options(xptifw)
169+
endif()
170+
164171
if (UR_STATIC_LOADER)
165172
install(TARGETS xpti xptifw
166173
EXPORT ${PROJECT_NAME}-targets
@@ -218,6 +225,14 @@ if(UR_USE_MSAN)
218225
add_sanitizer_flag(memory)
219226
endif()
220227

228+
if(NOT (UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_HIP
229+
OR UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_OPENCL
230+
OR UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_L0_V2
231+
OR UR_BUILD_ADAPTER_ALL))
232+
message(WARNING "No adapters have been enabled; conformance tests will not be ran")
233+
message(STATUS "Consider setting UR_BUILD_ADAPTER_*")
234+
endif()
235+
221236
# Check if clang-format (in correct version) is available for Cpp code formatting.
222237
if(UR_FORMAT_CPP_STYLE)
223238
find_program(CLANG_FORMAT NAMES clang-format-15 clang-format-15.0 clang-format)
@@ -269,6 +284,13 @@ add_custom_target(verify-licenses
269284
COMMENT "Verify all files contain a license."
270285
)
271286

287+
# Add hardening check
288+
add_custom_target(verify-hardening
289+
COMMAND "${PROJECT_SOURCE_DIR}/scripts/check-hardening.sh"
290+
${CMAKE_BINARY_DIR}
291+
COMMENT "Check hardening settings on built binaries and libraries"
292+
)
293+
272294
# Add code formatter target
273295
add_custom_target(cppformat)
274296
# ... and all source files to the formatter

0 commit comments

Comments
 (0)