Skip to content

Commit

Permalink
Add MLPerf version to metadata
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=300364473
  • Loading branch information
tohaowu authored and bvliu committed Mar 12, 2020
1 parent a8667b7 commit 28cd0e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def _CreateMetadataDict(benchmark_spec):
'use_tpu': bool(benchmark_spec.tpus),
'model_dir': benchmark_spec.model_dir,
'model': benchmark_spec.benchmark,
'version': 'v0.6.0',
}
if benchmark_spec.tpus:
metadata.update({
Expand Down Expand Up @@ -349,7 +350,6 @@ def MakeSamplesFromOutput(metadata, output, use_tpu=False, model='resnet'):
r':::MLL (\d+\.\d+) eval_accuracy: {(.*)}', output)

start = None
version = 'v0.6.0'
for wall_time, result in results:
wall_time = float(wall_time)
if not start:
Expand All @@ -366,7 +366,6 @@ def MakeSamplesFromOutput(metadata, output, use_tpu=False, model='resnet'):
value = regex_util.ExtractExactlyOneMatch(r'"value": (\d+\.\d+)', result)
metadata_copy['times'] = wall_time - start
metadata_copy['epoch'] = int(epoch)
metadata_copy['version'] = version
samples.append(
sample.Sample('Eval Accuracy',
float(value) * 100, '%', metadata_copy))
Expand Down
2 changes: 1 addition & 1 deletion tests/linux_benchmarks/mlperf_benchmark_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def setUp(self):

@mock.patch('time.time', mock.MagicMock(return_value=1550279509.59))
def testTrainResults(self):
samples = mlperf_benchmark.MakeSamplesFromOutput({},
samples = mlperf_benchmark.MakeSamplesFromOutput({'version': 'v0.6.0'},
self.contents,
use_tpu=True,
model='resnet')
Expand Down

0 comments on commit 28cd0e2

Please sign in to comment.