Unverified Commit 2c039b57 authored by Ziyue Yang's avatar Ziyue Yang Committed by GitHub
Browse files

Benchmarks: Microbenchmark - Add data type option for NCCL and RCCL tests (#595)

**Description**
Add data type option for NCCL and RCCL tests.
parent 21a97026
......@@ -99,6 +99,12 @@ def add_parser_arguments(self):
action='store_true',
help='If specified, collect in-place numbers, else collect out-of-place numbers.',
)
self._parser.add_argument(
'--data_type',
type=str,
default='float',
help='Data type used in NCCL operations. Default: float.',
)
def _preprocess(self):
"""Preprocess/preparation operations before the benchmarking.
......@@ -128,9 +134,10 @@ def _preprocess(self):
return False
command = os.path.join(self._args.bin_dir, self._bin_name)
command += ' -b {} -e {} -f {} -g {} -c {} -n {} -w {} -G {}'.format(
command += ' -b {} -e {} -f {} -g {} -c {} -n {} -w {} -G {} -d {}'.format(
self._args.minbytes, self._args.maxbytes, str(self._args.stepfactor), str(self._args.ngpus),
str(self._args.check), str(self._args.iters), str(self._args.warmup_iters), str(self._args.graph_iters)
str(self._args.check), str(self._args.iters), str(self._args.warmup_iters), str(self._args.graph_iters),
self._args.data_type
)
self._commands.append(command)
......
......@@ -67,6 +67,7 @@ def test_nccl_bw_performance(self, allgather, allreduce, reduce, broadcast, redu
assert (benchmark._args.warmup_iters == 5)
assert (benchmark._args.graph_iters == 0)
assert (benchmark._args.in_place is False)
assert (benchmark._args.data_type == 'float')
# Check command list
bin_names = [
......@@ -75,7 +76,7 @@ def test_nccl_bw_performance(self, allgather, allreduce, reduce, broadcast, redu
]
command = bin_names[0] + benchmark._commands[0].split(bin_names[0])[1]
expected_command = '{} -b 8 -e 8G -f 2 -g 8 -c 0 -n 20 -w 5 -G 0'.format(bin_names[0])
expected_command = '{} -b 8 -e 8G -f 2 -g 8 -c 0 -n 20 -w 5 -G 0 -d float'.format(bin_names[0])
assert (command == expected_command)
# Check results and metrics.
......
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