Skip to content

Commit 8166909

Browse files
committed
Add HIP to becnhmarks scripts
1 parent ce5bfa8 commit 8166909

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

devops/scripts/benchmarks/benches/compute.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def benchmarks(self) -> list[Benchmark]:
117117
if options.sycl is None:
118118
return []
119119

120-
if options.ur_adapter == "cuda":
120+
if options.ur_adapter == "cuda" or options.ur_adapter == "hip":
121121
return []
122122

123123
benches = []

devops/scripts/benchmarks/benches/llamacpp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def benchmarks(self) -> list[Benchmark]:
8282
if options.sycl is None:
8383
return []
8484

85-
if options.ur_adapter == "cuda":
85+
if options.ur_adapter == "cuda" or options.ur_adapter == "hip":
8686
return []
8787

8888
return [LlamaBench(self)]

devops/scripts/benchmarks/benches/syclbench.py

+5
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ def setup(self):
5656
f"-DCMAKE_CXX_FLAGS=-fsycl -fsycl-targets=nvptx64-nvidia-cuda"
5757
]
5858

59+
if options.ur_adapter == "hip":
60+
configure_command += [
61+
f"-DCMAKE_CXX_FLAGS=-fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch={options.hip_arch}"
62+
]
63+
5964
run(configure_command, add_sycl=True)
6065
run(f"cmake --build {build_path} -j {options.build_jobs}", add_sycl=True)
6166

devops/scripts/benchmarks/benches/velocity.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def benchmarks(self) -> list[Benchmark]:
4747
if options.sycl is None:
4848
return []
4949

50-
if options.ur_adapter == "cuda":
50+
if options.ur_adapter == "cuda" or options.ur_adapter == "hip":
5151
return [
5252
Hashtable(self),
5353
Bitcracker(self),
@@ -83,6 +83,11 @@ def download_deps(self):
8383
def extra_cmake_args(self) -> list[str]:
8484
if options.ur_adapter == "cuda":
8585
return [f"-DUSE_NVIDIA_BACKEND=YES", f"-DUSE_SM=80"]
86+
if options.ur_adapter == "hip":
87+
return [
88+
f"-DUSE_AMD_BACKEND=YES",
89+
f"-DUSE_AMDHIP_BACKEND={options.hip_arch}",
90+
]
8691
return []
8792

8893
def ld_libraries(self) -> list[str]:

devops/scripts/benchmarks/main.py

+5
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ def validate_and_parse_env_args(env_args):
468468
type=int,
469469
help="Number of build jobs to run simultaneously",
470470
default=options.build_jobs,
471+
"--hip_arch",
472+
type=str,
473+
help="HIP device architecture",
474+
default=None,
471475
)
472476

473477
args = parser.parse_args()
@@ -497,6 +501,7 @@ def validate_and_parse_env_args(env_args):
497501
options.cublas_directory = args.cublas_directory
498502
options.custom_results_dir = args.results_dir
499503
options.build_jobs = args.build_jobs
504+
options.hip_arch = args.hip_arch
500505

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

0 commit comments

Comments
 (0)