"googlemock/vscode:/vscode.git/clone" did not exist on "633488a76325ad22c622a68cd7a20e556be96f5b"
Unverified Commit 6583ba2e authored by Yuting Jiang's avatar Yuting Jiang Committed by GitHub
Browse files

Benchmark: Revision - Add wait time option to resolve mem-bw unstable issue (#438)

**Description**
Add wait time option to resolve mem-bw unstable issue.
parent 1deb2eaa
...@@ -33,6 +33,13 @@ def add_parser_arguments(self): ...@@ -33,6 +33,13 @@ def add_parser_arguments(self):
default=False, default=False,
help='Enable shmoo mode for bandwidthtest.', 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): def _preprocess(self):
"""Preprocess/preparation operations before the benchmarking. """Preprocess/preparation operations before the benchmarking.
...@@ -52,6 +59,8 @@ def _preprocess(self): ...@@ -52,6 +59,8 @@ def _preprocess(self):
if self._args.memory == 'pinned': if self._args.memory == 'pinned':
command += ' memory=pinned' command += ' memory=pinned'
command += ' --csv' command += ' --csv'
if self._args.sleep != 0:
command += f' && sleep {self._args.sleep}'
self._commands.append(command) self._commands.append(command)
return True return True
......
...@@ -57,3 +57,18 @@ def test_cuda_memory_bw_performance(self, raw_output_h2d, raw_output_d2h, raw_ou ...@@ -57,3 +57,18 @@ def test_cuda_memory_bw_performance(self, raw_output_h2d, raw_output_d2h, raw_ou
assert (metric in benchmark.result) assert (metric in benchmark.result)
assert (len(benchmark.result[metric]) == 1) assert (len(benchmark.result[metric]) == 1)
assert (isinstance(benchmark.result[metric][0], numbers.Number)) 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])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment