From 28cd0e2ae0740033f19c159fd58117580c41a7ff Mon Sep 17 00:00:00 2001 From: tohaowu Date: Wed, 11 Mar 2020 11:07:32 -0700 Subject: [PATCH] Add MLPerf version to metadata ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=300364473 --- perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py | 3 +-- tests/linux_benchmarks/mlperf_benchmark_test.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py b/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py index 92e69823ed..c2db362895 100644 --- a/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py +++ b/perfkitbenchmarker/linux_benchmarks/mlperf_benchmark.py @@ -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({ @@ -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: @@ -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)) diff --git a/tests/linux_benchmarks/mlperf_benchmark_test.py b/tests/linux_benchmarks/mlperf_benchmark_test.py index 687ee24d8c..cdf248072f 100644 --- a/tests/linux_benchmarks/mlperf_benchmark_test.py +++ b/tests/linux_benchmarks/mlperf_benchmark_test.py @@ -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')