Skip to content

Commit

Permalink
Add warning about how subsets of the benchmark suites don't generate …
Browse files Browse the repository at this point in the history
…valid results.

fixes proposed by @PoaloS02
  • Loading branch information
hirooih committed Jan 17, 2023
1 parent 96a0147 commit f6e075d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
11 changes: 9 additions & 2 deletions benchmark_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ def build_parser():
type=str,
default=[],
nargs='+',
help='Benchmark name(s) to measure. By default all tests are measure.'
help='Benchmark name(s) to measure. By default all tests are measured. Results obtained from subsets are not valid Embench scores.'
)
parser.add_argument(
'--exclude',
type=str,
default=[],
nargs='+',
help='Benchmark name(s) to exclude.'
help='Benchmark name(s) to exclude. Results obtained from subsets are not valid Embench scores.'
)

return parser
Expand Down Expand Up @@ -359,6 +359,8 @@ def collect_data(benchmarks):

# Output it
if gp['output_format'] == output_format.JSON:
if gp['benchmark'] or gp['exclude']:
log.info('These results are not valid Embench scores as they are taken from a subset of the Embench suite.')
log.info('{ "size results" :')
log.info(' { "detailed size results" :')
for bench in benchmarks:
Expand All @@ -377,6 +379,8 @@ def collect_data(benchmarks):

log.info(' },')
elif gp['output_format'] == output_format.TEXT:
if gp['benchmark'] or gp['exclude']:
log.info('These results are not valid Embench scores as they are taken from a subset of the Embench suite.')
log.info('Benchmark size')
log.info('--------- ----')
for bench in benchmarks:
Expand All @@ -387,6 +391,9 @@ def collect_data(benchmarks):
res_output = f' {rel_data[bench]:6.2f}'
log.info(f'{bench:15} {res_output:8}')
elif gp['output_format'] == output_format.BASELINE:
if gp['benchmark'] or gp['exclude']:
log.info('ERROR: These results are not valid Embench scores as they are taken from a subset of the Embench suite.')
return [], []
log.info('{')
for bench in benchmarks:
res_output = ''
Expand Down
11 changes: 9 additions & 2 deletions benchmark_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ def get_common_args():
type=str,
default=[],
nargs='+',
help='Benchmark name(s) to measure. By default all tests are measure.'
help='Benchmark name(s) to measure. By default all tests are measured. Results obtained from subsets are not valid Embench scores.'
)
parser.add_argument(
'--exclude',
type=str,
default=[],
nargs='+',
help='Benchmark name(s) to exclude.'
help='Benchmark name(s) to exclude. Results obtained from subsets are not valid Embench scores.'
)

return parser.parse_known_args()
Expand Down Expand Up @@ -314,6 +314,8 @@ def collect_data(benchmarks, remnant):

# Output it
if gp['output_format'] == output_format.JSON:
if gp['benchmark'] or gp['exclude']:
log.info('These results are not valid Embench scores as they are taken from a subset of the Embench suite.')
log.info('{ "speed results" :')
log.info(' { "detailed speed results" :')
for bench in benchmarks:
Expand All @@ -332,6 +334,8 @@ def collect_data(benchmarks, remnant):
log.info(f' "{bench}" : {output},')
log.info(' },')
elif gp['output_format'] == output_format.TEXT:
if gp['benchmark'] or gp['exclude']:
log.info('These results are not valid Embench scores as they are taken from a subset of the Embench suite.')
log.info('Benchmark Speed')
log.info('--------- -----')
for bench in benchmarks:
Expand All @@ -344,6 +348,9 @@ def collect_data(benchmarks, remnant):
# Want relative results (the default). Only use non-zero values.
log.info(f'{bench:15} {output:8}')
elif gp['output_format'] == output_format.BASELINE:
if gp['benchmark'] or gp['exclude']:
log.info('ERROR: These results are not valid Embench scores as they are taken from a subset of the Embench suite.')
return [], []
log.info('{')
for bench in benchmarks:
if bench == benchmarks[-1]:
Expand Down
4 changes: 2 additions & 2 deletions build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ def build_parser():
type=str,
default=[],
nargs='+',
help='Benchmark name(s) to build. By default all tests are build.'
help='Benchmark name(s) to build. By default all tests are built. Results obtained from subsets are not valid Embench scores.'
)
parser.add_argument(
'--exclude',
type=str,
default=[],
nargs='+',
help='Benchmark name(s) to exclude.'
help='Benchmark name(s) to exclude. Results obtained from subsets are not valid Embench scores.'
)

return parser
Expand Down

0 comments on commit f6e075d

Please sign in to comment.