Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tsoc
superbenchmark
Commits
f57d86f4
Commit
f57d86f4
authored
Apr 15, 2026
by
one
Browse files
Update GPU vendors
parent
49a4389b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
superbench/benchmarks/micro_benchmarks/ib_validation_performance.py
.../benchmarks/micro_benchmarks/ib_validation_performance.py
+1
-1
superbench/common/utils/device_manager.py
superbench/common/utils/device_manager.py
+2
-2
superbench/tools/system_info.py
superbench/tools/system_info.py
+9
-0
tests/benchmarks/micro_benchmarks/test_ib_traffic_performance.py
...enchmarks/micro_benchmarks/test_ib_traffic_performance.py
+5
-0
No files found.
superbench/benchmarks/micro_benchmarks/ib_validation_performance.py
View file @
f57d86f4
...
@@ -282,7 +282,7 @@ def __prepare_general_ib_command_params(self, msg_size, device='cpu'):
...
@@ -282,7 +282,7 @@ def __prepare_general_ib_command_params(self, msg_size, device='cpu'):
gpu
=
GPU
()
gpu
=
GPU
()
if
gpu
.
vendor
==
'nvidia'
:
if
gpu
.
vendor
==
'nvidia'
:
gpu_dev
=
f
'--use_cuda=
{
self
.
_args
.
gpu_dev
}
'
gpu_dev
=
f
'--use_cuda=
{
self
.
_args
.
gpu_dev
}
'
elif
gpu
.
vendor
==
'amd'
:
elif
gpu
.
vendor
==
'amd'
or
gpu
.
vendor
==
'hygon'
:
gpu_dev
=
f
'--use_rocm=
{
self
.
_args
.
gpu_dev
}
'
gpu_dev
=
f
'--use_rocm=
{
self
.
_args
.
gpu_dev
}
'
else
:
else
:
self
.
_result
.
set_return_code
(
ReturnCode
.
INVALID_ARGUMENT
)
self
.
_result
.
set_return_code
(
ReturnCode
.
INVALID_ARGUMENT
)
...
...
superbench/common/utils/device_manager.py
View file @
f57d86f4
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
gpu
=
GPU
()
gpu
=
GPU
()
if
gpu
.
vendor
==
'nvidia'
or
gpu
.
vendor
==
'nvidia-graphics'
:
if
gpu
.
vendor
==
'nvidia'
or
gpu
.
vendor
==
'nvidia-graphics'
:
import
py3nvml.py3nvml
as
nvml
import
py3nvml.py3nvml
as
nvml
elif
gpu
.
vendor
==
'amd'
or
gpu
.
vendor
==
'amd-graphics'
:
elif
gpu
.
vendor
==
'amd'
or
gpu
.
vendor
==
'amd-graphics'
or
gpu
.
vendor
==
'hygon'
:
import
amdsmi
as
rocml
import
amdsmi
as
rocml
...
@@ -456,5 +456,5 @@ def get_device_ecc_error(self, idx):
...
@@ -456,5 +456,5 @@ def get_device_ecc_error(self, idx):
device_manager
:
Optional
[
DeviceManager
]
=
DeviceManager
()
device_manager
:
Optional
[
DeviceManager
]
=
DeviceManager
()
if
gpu
.
vendor
==
'nvidia'
or
gpu
.
vendor
==
'nvidia-graphics'
:
if
gpu
.
vendor
==
'nvidia'
or
gpu
.
vendor
==
'nvidia-graphics'
:
device_manager
=
NvidiaDeviceManager
()
device_manager
=
NvidiaDeviceManager
()
elif
gpu
.
vendor
==
'amd'
or
gpu
.
vendor
==
'amd-graphics'
:
elif
gpu
.
vendor
==
'amd'
or
gpu
.
vendor
==
'amd-graphics'
or
gpu
.
vendor
==
'hygon'
:
device_manager
=
AmdDeviceManager
()
device_manager
=
AmdDeviceManager
()
superbench/tools/system_info.py
View file @
f57d86f4
...
@@ -286,6 +286,13 @@ def get_gpu_amd(self):
...
@@ -286,6 +286,13 @@ def get_gpu_amd(self):
return
gpu_dict
return
gpu_dict
def
get_gpu_hygon
(
self
):
"""Get hygon gpu info."""
gpu_dict
=
self
.
get_gpu_amd
()
if
gpu_dict
:
gpu_dict
[
'accelerator_vendor'
]
=
'hygon'
return
gpu_dict
def
get_gpu
(
self
):
def
get_gpu
(
self
):
"""Get gpu info and identify gpu type(nvidia/amd).
"""Get gpu info and identify gpu type(nvidia/amd).
...
@@ -296,6 +303,8 @@ def get_gpu(self):
...
@@ -296,6 +303,8 @@ def get_gpu(self):
if
Path
(
'/dev/nvidiactl'
).
is_char_device
()
and
Path
(
'/dev/nvidia-uvm'
).
is_char_device
():
if
Path
(
'/dev/nvidiactl'
).
is_char_device
()
and
Path
(
'/dev/nvidia-uvm'
).
is_char_device
():
return
self
.
get_gpu_nvidia
()
return
self
.
get_gpu_nvidia
()
if
Path
(
'/dev/kfd'
).
is_char_device
()
and
Path
(
'/dev/dri'
).
is_dir
():
if
Path
(
'/dev/kfd'
).
is_char_device
()
and
Path
(
'/dev/dri'
).
is_dir
():
if
Path
(
'/usr/local/hyhal'
).
exists
()
or
Path
(
'/opt/hyhal'
).
exists
():
return
self
.
get_gpu_hygon
()
return
self
.
get_gpu_amd
()
return
self
.
get_gpu_amd
()
except
Exception
:
except
Exception
:
logger
.
exception
(
'Error: get gpu info failed'
)
logger
.
exception
(
'Error: get gpu info failed'
)
...
...
tests/benchmarks/micro_benchmarks/test_ib_traffic_performance.py
View file @
f57d86f4
...
@@ -224,6 +224,11 @@ def test_ib_traffic_performance(self, mock_gpu):
...
@@ -224,6 +224,11 @@ def test_ib_traffic_performance(self, mock_gpu):
expect_command
=
expect_command
.
replace
(
'cuda'
,
'rocm'
)
expect_command
=
expect_command
.
replace
(
'cuda'
,
'rocm'
)
command
=
benchmark
.
_bin_name
+
benchmark
.
_commands
[
0
].
split
(
benchmark
.
_bin_name
)[
1
]
command
=
benchmark
.
_bin_name
+
benchmark
.
_commands
[
0
].
split
(
benchmark
.
_bin_name
)[
1
]
assert
(
command
==
expect_command
)
assert
(
command
==
expect_command
)
mock_gpu
.
return_value
=
'hygon'
benchmark
=
benchmark_class
(
benchmark_name
,
parameters
=
parameters
)
ret
=
benchmark
.
_preprocess
()
command
=
benchmark
.
_bin_name
+
benchmark
.
_commands
[
0
].
split
(
benchmark
.
_bin_name
)[
1
]
assert
(
command
==
expect_command
)
parameters
=
'--command ib_read_lat --ib_dev mlx5_0 --iters 2000 --msg_size 33554432 '
+
\
parameters
=
'--command ib_read_lat --ib_dev mlx5_0 --iters 2000 --msg_size 33554432 '
+
\
'--pattern one-to-one --hostfile hostfile --gpu_dev 0 --direction gpu-to-gpu'
'--pattern one-to-one --hostfile hostfile --gpu_dev 0 --direction gpu-to-gpu'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment