Skip to content

[SYCL][BENCHMARK] Enable velocityBench and SyclBench for cuda adapter #17217

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions unified-runtime/scripts/benchmarks/benches/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def benchmarks(self) -> list[Benchmark]:
if options.sycl is None:
return []

if options.ur_adapter == "cuda":
return []

benches = [
SubmitKernelL0(self, 0),
SubmitKernelL0(self, 1),
Expand Down
3 changes: 3 additions & 0 deletions unified-runtime/scripts/benchmarks/benches/llamacpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def benchmarks(self) -> list[Benchmark]:
if options.sycl is None:
return []

if options.ur_adapter == "cuda":
return []

return [LlamaBench(self)]


Expand Down
5 changes: 5 additions & 0 deletions unified-runtime/scripts/benchmarks/benches/syclbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def setup(self):
f"-DSYCL_IMPL=dpcpp",
]

if options.ur_adapter == "cuda":
configure_command += [
f"-DCMAKE_CXX_FLAGS=-fsycl -fsycl-targets=nvptx64-nvidia-cuda"
]

run(configure_command, add_sycl=True)
run(f"cmake --build {build_path} -j", add_sycl=True)

Expand Down
29 changes: 29 additions & 0 deletions unified-runtime/scripts/benchmarks/benches/velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ def benchmarks(self) -> list[Benchmark]:
if options.sycl is None:
return []

if options.ur_adapter == "cuda":
return [
Hashtable(self),
Bitcracker(self),
CudaSift(self),
QuickSilver(self),
SobelFilter(self),
]

return [
Hashtable(self),
Bitcracker(self),
Expand All @@ -66,6 +75,8 @@ def download_deps(self):
return

def extra_cmake_args(self) -> list[str]:
if options.ur_adapter == "cuda":
return [f"-DUSE_NVIDIA_BACKEND=YES", f"-DUSE_SM=80"]
return []

def ld_libraries(self) -> list[str]:
Expand Down Expand Up @@ -358,6 +369,12 @@ def download_deps(self):

def extra_cmake_args(self):
oneapi = get_oneapi()
if options.ur_adapter == "cuda":
return [
f"-DUSE_NVIDIA_BACKEND=YES",
f"-DUSE_SM=80",
f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{oneapi.dnn_include()} -I{oneapi.mkl_include()} -L{oneapi.dnn_lib()} -L{oneapi.mkl_lib()}",
]
return [
f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{oneapi.dnn_include()} -I{oneapi.mkl_include()} -L{oneapi.dnn_lib()} -L{oneapi.mkl_lib()}"
]
Expand Down Expand Up @@ -415,6 +432,12 @@ def download_deps(self):

def extra_cmake_args(self):
oneapi = get_oneapi()
if options.ur_adapter == "cuda":
return [
f"-DUSE_NVIDIA_BACKEND=YES",
f"-DUSE_SM=80",
f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{oneapi.dnn_include()} -I{oneapi.mkl_include()} -L{oneapi.dnn_lib()} -L{oneapi.mkl_lib()}",
]
return [
f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{oneapi.dnn_include()} -I{oneapi.mkl_include()} -L{oneapi.dnn_lib()} -L{oneapi.mkl_lib()}"
]
Expand Down Expand Up @@ -452,6 +475,12 @@ def ld_libraries(self):

def extra_cmake_args(self):
oneapi = get_oneapi()
if options.ur_adapter == "cuda":
return [
f"-DUSE_NVIDIA_BACKEND=YES",
f"-DUSE_SM=80",
f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{oneapi.dnn_include()} -I{oneapi.mkl_include()} -L{oneapi.dnn_lib()} -L{oneapi.mkl_lib()}",
]
return [
f"-DCMAKE_CXX_FLAGS=-O3 -fsycl -ffast-math -I{oneapi.dnn_include()} -I{oneapi.mkl_include()} -L{oneapi.dnn_lib()} -L{oneapi.mkl_lib()}"
]
Expand Down
14 changes: 14 additions & 0 deletions unified-runtime/scripts/benchmarks/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,18 @@ def validate_and_parse_env_args(env_args):
help="The name of the results which should be used as a baseline for metrics calculation",
default=options.current_run_name,
)
parser.add_argument(
"--cudnn_directory",
type=str,
help="Directory for cudnn library",
default=None,
)
parser.add_argument(
"--cublas_directory",
type=str,
help="Directory for cublas library",
default=None,
)

args = parser.parse_args()
additional_env_vars = validate_and_parse_env_args(args.env)
Expand All @@ -434,6 +446,8 @@ def validate_and_parse_env_args(env_args):
options.iterations_stddev = args.iterations_stddev
options.build_igc = args.build_igc
options.current_run_name = args.relative_perf
options.cudnn_directory = args.cudnn_directory
options.cublas_directory = args.cublas_directory

if args.build_igc and args.compute_runtime is None:
parser.error("--build-igc requires --compute-runtime to be set")
Expand Down
Loading