Benchmark: Revision - Add wait time option to resolve mem-bw unstable issue (#438)
**Description** Add wait time option to resolve mem-bw unstable issue.
This commit is contained in:
Родитель
1deb2eaa29
Коммит
6583ba2e40
|
@ -33,6 +33,13 @@ class CudaMemBwBenchmark(MemBwBenchmark):
|
|||
default=False,
|
||||
help='Enable shmoo mode for bandwidthtest.',
|
||||
)
|
||||
self._parser.add_argument(
|
||||
'--sleep',
|
||||
type=int,
|
||||
default=0,
|
||||
required=False,
|
||||
help='The seconds will be sleeped between each bandwidthtest command.',
|
||||
)
|
||||
|
||||
def _preprocess(self):
|
||||
"""Preprocess/preparation operations before the benchmarking.
|
||||
|
@ -52,6 +59,8 @@ class CudaMemBwBenchmark(MemBwBenchmark):
|
|||
if self._args.memory == 'pinned':
|
||||
command += ' memory=pinned'
|
||||
command += ' --csv'
|
||||
if self._args.sleep != 0:
|
||||
command += f' && sleep {self._args.sleep}'
|
||||
self._commands.append(command)
|
||||
|
||||
return True
|
||||
|
|
|
@ -57,3 +57,18 @@ class CudaMemBwTest(BenchmarkTestCase, unittest.TestCase):
|
|||
assert (metric in benchmark.result)
|
||||
assert (len(benchmark.result[metric]) == 1)
|
||||
assert (isinstance(benchmark.result[metric][0], numbers.Number))
|
||||
|
||||
benchmark = benchmark_class(benchmark_name, parameters='--memory=pinned --sleep 3')
|
||||
|
||||
ret = benchmark._preprocess()
|
||||
assert (ret is True)
|
||||
assert (benchmark.return_code == ReturnCode.SUCCESS)
|
||||
|
||||
# Check command list
|
||||
expected_command = [
|
||||
'bandwidthTest --htod memory=pinned --csv && sleep 3',
|
||||
'bandwidthTest --dtoh memory=pinned --csv && sleep 3', 'bandwidthTest --dtod memory=pinned --csv && sleep 3'
|
||||
]
|
||||
for i in range(len(expected_command)):
|
||||
command = benchmark._bin_name + benchmark._commands[i].split(benchmark._bin_name)[1]
|
||||
assert (command == expected_command[i])
|
||||
|
|
Загрузка…
Ссылка в новой задаче