Skip to content

Commit

Permalink
[Benchmark] use UR_ADAPTERS_FORCE_LOAD in benchmarks
Browse files Browse the repository at this point in the history
to enable testing L0 v2 adapter which cannot be selected
by ONEAPI_SELECTOR
  • Loading branch information
igchor committed Aug 28, 2024
1 parent 05d3ea7 commit 35ef3ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/benchmarks_compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,17 @@ jobs:
- name: Build SYCL
run: cmake --build ${{github.workspace}}/sycl_build -j

- name: Set oneAPI Device Selector
run: |
echo "ONEAPI_DEVICE_SELECTOR=${{ matrix.adapter.str_name }}:${{ matrix.adapter.unit }}" >> $GITHUB_ENV
- name: Configure UR
working-directory: ${{github.workspace}}/ur-repo
run: >
cmake -DCMAKE_BUILD_TYPE=Release
-B${{github.workspace}}/ur-repo/build
-DUR_BUILD_TESTS=OFF
-DUR_BUILD_ADAPTER_L0=ON
-DUR_BUILD_ADAPTER_L0_V2=ON
- name: Build UR
run: cmake --build ${{github.workspace}}/ur-repo/build -j $(nproc)

- name: Run benchmarks
id: benchmarks
Expand Down
5 changes: 1 addition & 4 deletions scripts/benchmarks/benches/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def bin_args(self) -> list[str]:
return []

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

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

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

def bin_args(self) -> list[str]:
return [
f"--Ioq={self.ioq}",
Expand Down
4 changes: 3 additions & 1 deletion scripts/benchmarks/benches/velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from utils.utils import run, create_build_path
import os
import re
from .options import options

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

def download_deps(self):
return
Expand All @@ -46,7 +48,7 @@ def bin_args(self) -> list[str]:
return []

def extra_env_vars(self) -> dict:
return {}
return {"UR_ADAPTERS_FORCE_LOAD" : self.adapter_path}

def parse_output(self, stdout: str) -> float:
raise NotImplementedError()
Expand Down

0 comments on commit 35ef3ff

Please sign in to comment.