-
Notifications
You must be signed in to change notification settings - Fork 768
[SYCL] Remove plugin interface #14145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cd40463
580ae02
dc83909
c8dd930
27a6f76
6f2ce5f
fa58efd
e4f7350
504e5b6
85677f2
86d717b
34a3c8e
fb3c9bd
adacf4b
873f2cf
2e1450a
b64e954
5dd14bf
543a468
5e08657
c46c55c
b815dfa
7c3d3b0
506c09f
0932f6a
4d1111a
da1c029
6d63685
5fe61a8
9e27636
26da41c
81a5c8c
434de32
7406b78
68f5289
bc618be
e4ce2a8
9dbf4dd
56eb238
43a9547
ee31f85
f084966
901d8c9
41eb6e3
2039ea6
a4c6b0f
f9e9589
61cf322
50b7667
274c849
bb49925
e8e0871
c8f2efa
f887850
ab31ce6
2544c90
61de1cc
1143db0
0ed5ed5
da22011
b279b1a
9fa876d
621cd97
533d611
e823d12
0b4f68b
8c1c5b6
a2cf3ff
52f34ee
ddcfe1e
fb3379b
e8ead5b
42e0f89
a54226d
538fdf5
7d5cfe8
bce17a4
4d515f5
807683e
7e5b2ec
c841103
a867839
cab52ab
c3bd737
8fb916f
fcc9435
bcbd19d
78c8633
3e3d9b8
bb0d5c4
8f20dab
0cebe67
11c6f35
4cccdcf
94fcca0
80fcc4a
9342dcb
93e0d23
213dc5e
7b13aa1
9a71395
64a3f99
be4d80d
381d481
6cdac15
9726cd3
0fa7e8b
8d026ef
eff63c7
eeea5e6
cff16fd
f889704
0fe9c2c
51a215a
1697d14
56384d0
4a0b82a
c854c04
bcb9171
b2f66dc
28776c2
7b1328f
e54cfa5
fd72048
2267684
985f032
472a70d
dc7957b
1c63acb
053411f
dc35a84
9f61e7b
dcd13bf
41546d6
42d4479
88f60b5
6faf39d
5358705
60f2011
3d4d2a2
fc4a5d4
497089f
16203dc
5104f21
60def75
4abab89
b75519b
4da5fb8
7fa05fe
5e1c623
37a2cef
6f07103
62c321a
ae8ff61
02fe912
ec9028e
d16668d
c6f7942
7929962
fd17c83
748fea1
3af09f3
a76d2b0
1c9b149
4fbfc50
0390562
8528c9a
d164006
2bed873
0f6404f
8b18075
71bd27b
87f1b3d
0df01dd
1825b1a
05504e4
3c106d9
57ff033
04b60cb
284cf07
ebb2bb2
2cd5ee4
a4e247e
ced5ac2
0ab745e
5f169b4
f1e899b
ccd2421
13adbda
e04ce03
b271c28
fad8eee
fcf4a37
fed8dc4
254c4a2
65a8864
f46e409
5de3077
96a6d15
5d39e5b
e705c38
f5a30ff
75c654c
312070c
03baa49
bc007c5
11f0b98
18e38ed
7e87131
a2809d6
b9f6e55
a1ba4d2
cb943a3
cac3da9
c3746c8
a627db5
98f3161
39760e3
5ed9db1
866c209
7949962
9f0123b
97597e6
5411d4b
b1cd015
ac868cd
957fabb
2373a19
9187e16
97a3311
9b0f038
d31a163
39f424b
f769b4d
632cc70
5db5bdb
58edb70
cd22184
3653659
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# PI Unified Runtime plugin library. | ||
# | ||
# Either fetches UR from the appropriate repo or sets up variables based on user | ||
# preference. | ||
|
||
# TODO: taken from sycl/plugins/CMakeLists.txt - maybe we should handle this | ||
# within UR (although it is an obscure warning that the build system here | ||
# seems to specifically enable) | ||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|IntelLLVM" ) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-covered-switch-default") | ||
endif() | ||
|
||
|
||
# Options to override the default behaviour of the FetchContent to include UR | ||
# source code. | ||
|
@@ -15,8 +23,11 @@ option(SYCL_PI_UR_USE_FETCH_CONTENT | |
set(SYCL_PI_UR_SOURCE_DIR | ||
"" CACHE PATH "Path to root of Unified Runtime repository") | ||
|
||
# Override default to enable building tests from unified-runtime | ||
set(UR_BUILD_TESTS OFF CACHE BOOL "Build unit tests.") | ||
# Here we override the defaults to disable building tests from unified-runtime | ||
set(UR_BUILD_EXAMPLES OFF CACHE BOOL "Build example applications." FORCE) | ||
set(UR_BUILD_TESTS OFF CACHE BOOL "Build unit tests." FORCE) | ||
set(UR_BUILD_XPTI_LIBS OFF) | ||
set(UR_ENABLE_TRACING ON) | ||
|
||
if("level_zero" IN_LIST SYCL_ENABLE_PLUGINS) | ||
set(UR_BUILD_ADAPTER_L0 ON) | ||
|
@@ -26,6 +37,9 @@ if("cuda" IN_LIST SYCL_ENABLE_PLUGINS) | |
endif() | ||
if("hip" IN_LIST SYCL_ENABLE_PLUGINS) | ||
set(UR_BUILD_ADAPTER_HIP ON) | ||
if (SYCL_ENABLE_KERNEL_FUSION) | ||
set(UR_ENABLE_COMGR ON) | ||
endif() | ||
endif() | ||
if("opencl" IN_LIST SYCL_ENABLE_PLUGINS) | ||
set(UR_BUILD_ADAPTER_OPENCL ON) | ||
|
@@ -99,13 +113,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) | |
endfunction() | ||
|
||
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") | ||
# commit 2baf095188b235bb2b0a0140f0187d2041aef4b0 | ||
# Merge: 3d8fe8d2 58f85278 | ||
# commit b7b0c8b3d17aa7d511c67ec219d58091d07cfa60 | ||
# Merge: 2baf0951 5b8936da | ||
# Author: Piotr Balcer <[email protected]> | ||
# Date: Fri Jul 26 12:06:22 2024 +0200 | ||
# Merge pull request #1900 from kswiecicki/umf-version-bump | ||
# Bump UMF version | ||
set(UNIFIED_RUNTIME_TAG 58f85278a4ebf37742dd10afb3350580b0b1d9d7) | ||
# Date: Fri Jul 26 15:48:04 2024 +0200 | ||
# Merge pull request #1903 from kswiecicki/umf-version-bump | ||
# Bump UMF version again | ||
set(UNIFIED_RUNTIME_TAG b7b0c8b3d17aa7d511c67ec219d58091d07cfa60) | ||
|
||
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") | ||
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need | ||
|
@@ -210,86 +224,69 @@ target_include_directories(UnifiedRuntime-Headers | |
|
||
find_package(Threads REQUIRED) | ||
|
||
set(UNIFIED_RUNTIME_PLUGIN_ARGS | ||
SOURCES | ||
# These are short-term shared with Unified Runtime | ||
# The two plugins define a few things differently so must | ||
# be built separately. This difference is spelled in | ||
# their "ur_bindings.hpp" files. | ||
"ur_bindings.hpp" | ||
"pi2ur.hpp" | ||
# These below belong to Unified Runtime PI Plugin only | ||
"pi_unified_runtime.hpp" | ||
"pi_unified_runtime.cpp" | ||
LIBRARIES | ||
Threads::Threads | ||
UnifiedRuntimeLoader | ||
UnifiedRuntime-Headers | ||
UnifiedRuntimeCommon | ||
INCLUDE_DIRS | ||
"${UNIFIED_RUNTIME_SRC_INCLUDE_DIR}" | ||
"${UNIFIED_RUNTIME_COMMON_INCLUDE_DIR}" | ||
"${SYCL_SOURCE_DIR}/source" # for compiler.hpp | ||
) | ||
|
||
# We need for #include <ze_api.h> in common.h | ||
if("level_zero" IN_LIST SYCL_ENABLE_PLUGINS) | ||
list(APPEND UNIFIED_RUNTIME_PLUGIN_ARGS LevelZeroLoader-Headers) | ||
endif() | ||
|
||
if("opencl" IN_LIST SYCL_ENABLE_PLUGINS) | ||
list(APPEND UNIFIED_RUNTIME_PLUGIN_ARGS OpenCL-ICD) | ||
endif() | ||
|
||
add_sycl_plugin(unified_runtime ${UNIFIED_RUNTIME_PLUGIN_ARGS}) | ||
|
||
if(TARGET UnifiedRuntimeLoader) | ||
set_target_properties(hello_world PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1) | ||
# Install the UR loader. | ||
# TODO: this is piggy-backing on the existing target component level-zero-sycl-dev | ||
# When UR is moved to its separate repo perhaps we should introduce new component, | ||
# e.g. unified-runtime-sycl-dev. | ||
# See github issue #14598 | ||
install(TARGETS ur_loader | ||
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev | ||
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev | ||
RUNTIME DESTINATION "bin" COMPONENT level-zero-sycl-dev | ||
) | ||
endif() | ||
|
||
# Install the UR adapters too | ||
if("level_zero" IN_LIST SYCL_ENABLE_PLUGINS) | ||
add_dependencies(sycl-runtime-libraries ur_adapter_level_zero) | ||
add_custom_target(UnifiedRuntimeAdapters) | ||
|
||
# Install the UR adapters too | ||
install(TARGETS ur_adapter_level_zero | ||
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev | ||
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev | ||
RUNTIME DESTINATION "bin" COMPONENT level-zero-sycl-dev | ||
function(add_sycl_ur_adapter NAME) | ||
add_dependencies(UnifiedRuntimeAdapters ur_adapter_${NAME}) | ||
|
||
install(TARGETS ur_adapter_${NAME} | ||
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT ur_adapter_${NAME} | ||
RUNTIME DESTINATION "bin" COMPONENT ur_adapter_${NAME}) | ||
|
||
set(manifest_file | ||
${CMAKE_CURRENT_BINARY_DIR}/install_manifest_ur_adapter_${NAME}.txt) | ||
add_custom_command(OUTPUT ${manifest_file} | ||
COMMAND "${CMAKE_COMMAND}" | ||
"-DCMAKE_INSTALL_COMPONENT=ur_adapter_${NAME}" | ||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake" | ||
COMMENT "Deploying component ur_adapter_${NAME}" | ||
USES_TERMINAL | ||
) | ||
add_custom_target(install-sycl-ur-adapter-${NAME} | ||
DEPENDS ${manifest_file} ur_adapter_${NAME} | ||
) | ||
|
||
set_property(GLOBAL APPEND PROPERTY | ||
SYCL_TOOLCHAIN_INSTALL_COMPONENTS ur_adapter_${NAME}) | ||
endfunction() | ||
|
||
if("level_zero" IN_LIST SYCL_ENABLE_PLUGINS) | ||
add_sycl_ur_adapter(level_zero) | ||
|
||
# TODO: L0 adapter does other... things in its cmake - make sure they get | ||
# added to the new build system | ||
endif() | ||
|
||
if("cuda" IN_LIST SYCL_ENABLE_PLUGINS) | ||
add_dependencies(sycl-runtime-libraries ur_adapter_cuda) | ||
add_sycl_ur_adapter(cuda) | ||
endif() | ||
|
||
if("hip" IN_LIST SYCL_ENABLE_PLUGINS) | ||
add_dependencies(sycl-runtime-libraries ur_adapter_hip) | ||
add_sycl_ur_adapter(hip) | ||
endif() | ||
|
||
if ("opencl" IN_LIST SYCL_ENABLE_PLUGINS) | ||
add_dependencies(sycl-runtime-libraries ur_adapter_opencl) | ||
|
||
# Install the UR adapters too | ||
install(TARGETS ur_adapter_opencl | ||
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev | ||
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev | ||
RUNTIME DESTINATION "bin" COMPONENT level-zero-sycl-dev | ||
) | ||
if("opencl" IN_LIST SYCL_ENABLE_PLUGINS) | ||
add_sycl_ur_adapter(opencl) | ||
endif() | ||
|
||
if ("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS) | ||
add_dependencies(sycl-runtime-libraries ur_adapter_native_cpu) | ||
if("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS) | ||
add_sycl_ur_adapter(native_cpu) | ||
|
||
# Deal with OCK option | ||
option(NATIVECPU_USE_OCK "Use the oneAPI Construction Kit for Native CPU" ON) | ||
|
||
if(NATIVECPU_USE_OCK) | ||
message(STATUS "Compiling Native CPU adapter with OCK support.") | ||
|
@@ -300,8 +297,6 @@ if ("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS) | |
endif() | ||
endif() | ||
|
||
add_dependencies(sycl-runtime-libraries ur_umf) | ||
|
||
# TODO: this is piggy-backing on the existing target component level-zero-sycl-dev | ||
install(TARGETS umf | ||
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,7 +196,7 @@ variables in production code.</span> | |
| Environment variable | Values | Description | | ||
| -------------------- | ------ | ----------- | | ||
| `SYCL_PREFER_UR` | Integer | If non-0 then run through Unified Runtime if desired backend is supported there. Default is 0. | | ||
| `SYCL_PI_TRACE` | Described [below](#sycl_pi_trace-options) | Enable specified level of tracing for PI. | | ||
| `SYCL_UR_TRACE` | Integer | If non-0 then enable Unified Runtime tracing. Default is 0. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this documented in the UR repo or elsewhere? Might be good to link here if so. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a SYCL RT only environment variable, it sets up UR specifc environment to enable logging largely equivelent to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did we remove |
||
| `SYCL_QUEUE_THREAD_POOL_SIZE` | Positive integer | Number of threads in thread pool of queue. | | ||
| `SYCL_DEVICELIB_NO_FALLBACK` | Any(\*) | Disable loading and linking of device library images | | ||
| `SYCL_PRINT_EXECUTION_GRAPH` | Described [below](#sycl_print_execution_graph-options) | Print execution graph to DOT text file. | | ||
|
@@ -231,16 +231,6 @@ variables in production code.</span> | |
| after_addHostAcc | print graph after addHostAccessor method | | ||
| always | print graph before and after each of the above methods | | ||
|
||
### `SYCL_PI_TRACE` Options | ||
|
||
`SYCL_PI_TRACE` accepts a bit-mask. Supported tracing levels are in the table below | ||
|
||
| Option | Description | | ||
| ------ | ----------- | | ||
| 1 | Enable basic tracing, which is tracing of PI plugins/devices discovery | | ||
| 2 | Enable tracing of the PI calls | | ||
| -1 | Enable all levels of tracing | | ||
|
||
## Debugging variables for Level Zero Plugin | ||
|
||
:warning: **Warning:** <span style="color:red">the environment variables | ||
|
Uh oh!
There was an error while loading. Please reload this page.