Skip to content

Commit

Permalink
add initialization options for rocm gemm
Browse files Browse the repository at this point in the history
  • Loading branch information
yukirora committed Nov 22, 2023
1 parent 9f4880c commit 8cc7674
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ def add_parser_arguments(self):
required=False,
help='Specifies the scalar beta.',
)
self._parser.add_argument(
'--initialization',
type=str,
default='hpl',
choices=['rand_int', 'trig_float', 'hpl'],
required=False,
help='Initialize with random integers, trig functions sin and cos, or hpl-like input.',
)

def _preprocess(self):
"""Preprocess/preparation operations before the benchmarking.
Expand All @@ -110,6 +118,7 @@ def _preprocess(self):
command += ' --lda {} --ldb {} --ldc {} --ldd {}'.format(
self._args.lda, self._args.ldb, self._args.ldc, self._args.ldd
)
command += ' --initialization {}'.format(self._args.initialization)
self._commands.append(command)

return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_rocm_flops_performance(self):
assert (benchmark._args.k == 8192)

params = '--transposeA N --transposeB T -m 7680 -n 8192 -k 8192' + \
' --alpha 1 --beta 0 --lda 8384 --ldb 8384 --ldc 8384 --ldd 8384'
' --alpha 1 --beta 0 --lda 8384 --ldb 8384 --ldc 8384 --ldd 8384 --initialization hpl'
# Check command list
expected_command = [
'rocblas-bench -r f64_r -f gemm ' + params,
Expand Down

0 comments on commit 8cc7674

Please sign in to comment.