Skip to content

Commit e9582f3

Browse files
committed
Compute-benchmarks use already compiled UR
1 parent 2296205 commit e9582f3

File tree

11 files changed

+36
-19
lines changed

11 files changed

+36
-19
lines changed

.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

cmake/helpers.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ function(add_ur_library name)
139139
endif()
140140
endfunction()
141141

142+
function(install_ur_library name)
143+
install(TARGETS ${name}
144+
EXPORT ${PROJECT_NAME}-targets
145+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
146+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
147+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT unified-runtime
148+
)
149+
endfunction()
150+
142151
include(FetchContent)
143152

144153
function(FetchSource GIT_REPOSITORY GIT_TAG GIT_DIR DEST)

scripts/benchmarks/benches/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Benchmark:
1717
def __init__(self, directory):
1818
self.directory = directory
19-
self.adapter_path = os.path.join(options.ur_dir, 'build', 'lib', f"libur_adapter_{options.ur_adapter_name}.so")
19+
self.adapter_path = os.path.join(options.ur_dir, 'lib64', f"libur_adapter_{options.ur_adapter_name}.so")
2020

2121
def run_bench(self, command, env_vars):
2222
env_vars_with_forced_adapter = env_vars.copy()

scripts/benchmarks/benches/compute.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def setup(self):
2121
if self.built:
2222
return
2323

24-
repo_path = git_clone(self.directory, "compute-benchmarks-repo", "https://github.com/intel/compute-benchmarks.git", "08c41bb8bc1762ad53c6194df6d36bfcceff4aa2")
24+
repo_path = git_clone(self.directory, "compute-benchmarks-repo", "https://github.com/intel/compute-benchmarks.git", "f6882552215736f90295244046fcb6e17fe53e83")
2525
build_path = create_build_path(self.directory, 'compute-benchmarks-build')
2626

2727
configure_command = [
@@ -33,10 +33,7 @@ def setup(self):
3333
f"-DSYCL_COMPILER_ROOT={options.sycl}",
3434
f"-DALLOW_WARNINGS=ON",
3535
f"-DBUILD_UR=ON",
36-
f"-DUR_BUILD_TESTS=OFF",
37-
f"-DUR_BUILD_TESTS=OFF",
38-
f"-DUMF_DISABLE_HWLOC=ON",
39-
f"-DBENCHMARK_UR_SOURCE_DIR={options.ur_dir}",
36+
f"-Dunified-runtime_DIR={options.ur_dir}/lib/cmake/unified-runtime",
4037
]
4138
run(configure_command, add_sycl=True)
4239

scripts/benchmarks/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def validate_and_parse_env_args(env_args):
128128
parser = argparse.ArgumentParser(description='Unified Runtime Benchmark Runner')
129129
parser.add_argument('benchmark_directory', type=str, help='Working directory to setup benchmarks.')
130130
parser.add_argument('sycl', type=str, help='Root directory of the SYCL compiler.')
131-
parser.add_argument('ur_dir', type=str, help='Root directory of the UR.')
131+
parser.add_argument('ur_dir', type=str, help='UR install prefix path')
132132
parser.add_argument('ur_adapter_name', type=str, help='Options to build the Unified Runtime as part of the benchmark')
133133
parser.add_argument("--no-rebuild", help='Rebuild the benchmarks from scratch.', action="store_true")
134134
parser.add_argument("--env", type=str, help='Use env variable for a benchmark run.', action="append", default=[])

source/adapters/cuda/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ add_ur_adapter(${TARGET_NAME}
4545
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp
4646
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.hpp
4747
)
48+
install_ur_library(${TARGET_NAME})
4849

4950
set_target_properties(${TARGET_NAME} PROPERTIES
5051
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
@@ -100,7 +101,7 @@ if (UR_ENABLE_TRACING)
100101
XPTI_ENABLE_INSTRUMENTATION
101102
XPTI_STATIC_LIBRARY
102103
)
103-
target_include_directories(${TARGET_NAME} PUBLIC
104+
target_include_directories(${TARGET_NAME} PRIVATE
104105
${XPTI_INCLUDES}
105106
${CUDA_CUPTI_INCLUDE_DIR}
106107
)

source/adapters/hip/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ add_ur_adapter(${TARGET_NAME}
9292
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp
9393
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.hpp
9494
)
95+
install_ur_library(${TARGET_NAME})
9596

9697
if(NOT MSVC)
9798
target_compile_options(${TARGET_NAME} PRIVATE

source/adapters/level_zero/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ if(UR_BUILD_ADAPTER_L0)
140140
${CMAKE_CURRENT_SOURCE_DIR}/helpers/memory_helpers.cpp
141141
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp
142142
)
143+
install_ur_library(ur_adapter_level_zero)
143144

144145
if(UR_STATIC_ADAPTER_L0)
145146
target_compile_definitions(ur_adapter_level_zero PUBLIC UR_STATIC_ADAPTER_LEVEL_ZERO)
@@ -240,6 +241,7 @@ if(UR_BUILD_ADAPTER_L0_V2)
240241
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_immediate_in_order.cpp
241242
${CMAKE_CURRENT_SOURCE_DIR}/v2/usm.cpp
242243
)
244+
install_ur_library(ur_adapter_level_zero_v2)
243245

244246
if(NOT WIN32)
245247
# api.cpp contains NOT_SUPPORTED functions-only

source/adapters/native_cpu/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ add_ur_adapter(${TARGET_NAME}
4141
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp
4242
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.hpp
4343
)
44+
install_ur_library(${TARGET_NAME})
4445

4546
set_target_properties(${TARGET_NAME} PROPERTIES
4647
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"

source/adapters/opencl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ add_ur_adapter(${TARGET_NAME} SHARED
4343
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.cpp
4444
${CMAKE_CURRENT_SOURCE_DIR}/../../ur/ur.hpp
4545
)
46+
install_ur_library(${TARGET_NAME})
4647

4748
set_target_properties(${TARGET_NAME} PROPERTIES
4849
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"

0 commit comments

Comments
 (0)