Skip to content

Commit 509de91

Browse files
committed
[Benchmark] use UR_ADAPTERS_FORCE_LOAD in benchmarks
to enable testing L0 v2 adapter which cannot be selected by ONEAPI_SELECTOR
1 parent a2e9255 commit 509de91

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

.github/workflows/benchmarks_compute.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,17 @@ jobs:
151151
- name: Build SYCL
152152
run: cmake --build ${{github.workspace}}/sycl_build -j
153153

154-
- name: Set oneAPI Device Selector
155-
run: |
156-
echo "ONEAPI_DEVICE_SELECTOR=${{ matrix.adapter.str_name }}:${{ matrix.adapter.unit }}" >> $GITHUB_ENV
154+
- name: Configure UR
155+
working-directory: ${{github.workspace}}/ur-repo
156+
run: >
157+
cmake -DCMAKE_BUILD_TYPE=Release
158+
-B${{github.workspace}}/ur-repo/build
159+
-DUR_BUILD_TESTS=OFF
160+
-DUR_BUILD_ADAPTER_L0=ON
161+
-DUR_BUILD_ADAPTER_L0_V2=ON
162+
163+
- name: Build UR
164+
run: cmake --build ${{github.workspace}}/ur-repo/build -j $(nproc)
157165

158166
- name: Run benchmarks
159167
id: benchmarks

scripts/benchmarks/benches/compute.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def bin_args(self) -> list[str]:
6060
return []
6161

6262
def extra_env_vars(self) -> dict:
63-
return {}
63+
return {"UR_ADAPTERS_FORCE_LOAD" : os.path.join(self.bench.libs, f"libur_adapter_{options.ur_adapter_name}.so")}
6464

6565
def unit(self):
6666
return "μs"
@@ -130,9 +130,6 @@ def name(self):
130130
order = "in order" if self.ioq else "out of order"
131131
return f"api_overhead_benchmark_ur SubmitKernel {order}"
132132

133-
def extra_env_vars(self) -> dict:
134-
return {"UR_ADAPTERS_FORCE_LOAD" : os.path.join(self.bench.libs, f"libur_adapter_{options.ur_adapter_name}.so")}
135-
136133
def bin_args(self) -> list[str]:
137134
return [
138135
f"--Ioq={self.ioq}",

scripts/benchmarks/benches/velocity.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from utils.utils import run, create_build_path
1010
import os
1111
import re
12+
from .options import options
1213

1314
class VelocityBench:
1415
def __init__(self, directory):
@@ -22,6 +23,7 @@ def __init__(self, name: str, bin_name: str, vb: VelocityBench):
2223
self.bench_name = name
2324
self.bin_name = bin_name
2425
self.code_path = os.path.join(self.vb.repo_path, self.bench_name, 'SYCL')
26+
self.adapter_path = os.path.join(options.ur_dir, 'build', 'lib', f"libur_adapter_{options.ur_adapter_name}.so")
2527

2628
def download_deps(self):
2729
return
@@ -46,7 +48,7 @@ def bin_args(self) -> list[str]:
4648
return []
4749

4850
def extra_env_vars(self) -> dict:
49-
return {}
51+
return {"UR_ADAPTERS_FORCE_LOAD" : self.adapter_path}
5052

5153
def parse_output(self, stdout: str) -> float:
5254
raise NotImplementedError()

source/common/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@
55

66
if (UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_L0_V2)
77
include(FetchLevelZero)
8-
endif()
9-
10-
if (UR_BUILD_ADAPTER_L0_V2)
11-
# For now, only v2 adapter uses L0 provider from UMF
128
set(UMF_BUILD_LEVEL_ZERO_PROVIDER ON CACHE INTERNAL "Build Level Zero Provider")
139
set(UMF_LEVEL_ZERO_INCLUDE_DIR "${LEVEL_ZERO_INCLUDE_DIR}" CACHE INTERNAL "Level Zero headers")
14-
else()
15-
set(UMF_BUILD_LEVEL_ZERO_PROVIDER OFF CACHE INTERNAL "Build Level Zero Provider")
1610
endif()
1711

1812
add_ur_library(ur_common STATIC

0 commit comments

Comments
 (0)