Unverified Commit 1c509f19 authored by Toby Boyd's avatar Toby Boyd Committed by GitHub
Browse files

Additional force_v2 tests. (#7296)

parent 9fb1a1b6
...@@ -147,7 +147,7 @@ class ShakespeareAccuracy(ShakespeareBenchmarkBase): ...@@ -147,7 +147,7 @@ class ShakespeareAccuracy(ShakespeareBenchmarkBase):
FLAGS.model_dir = '' FLAGS.model_dir = ''
self._run_and_report_benchmark() self._run_and_report_benchmark()
def benchmark_1_gpu_no_ds_run_eagerly(self): def benchmark_1_gpu_no_ds(self):
"""Benchmark 1 gpu without distribution strategies.""" """Benchmark 1 gpu without distribution strategies."""
self._setup() self._setup()
FLAGS.num_gpus = 1 FLAGS.num_gpus = 1
...@@ -155,9 +155,19 @@ class ShakespeareAccuracy(ShakespeareBenchmarkBase): ...@@ -155,9 +155,19 @@ class ShakespeareAccuracy(ShakespeareBenchmarkBase):
FLAGS.batch_size = 64 FLAGS.batch_size = 64
FLAGS.train_epochs = 43 FLAGS.train_epochs = 43
FLAGS.model_dir = '' FLAGS.model_dir = ''
FLAGS.run_eagerly = True
FLAGS.distribution_strategy = 'off' FLAGS.distribution_strategy = 'off'
self._run_and_report_benchmark()
def benchmark_1_gpu_no_ds_run_eagerly(self):
"""Benchmark 1 gpu without distribution strategies and run eagerly."""
self._setup()
FLAGS.num_gpus = 1
FLAGS.training_data = self.train_data
FLAGS.batch_size = 64
FLAGS.train_epochs = 43
FLAGS.model_dir = ''
FLAGS.run_eagerly = True
FLAGS.distribution_strategy = 'off'
self._run_and_report_benchmark() self._run_and_report_benchmark()
def benchmark_1_gpu_no_ds_force_v2(self): def benchmark_1_gpu_no_ds_force_v2(self):
...@@ -264,6 +274,14 @@ class ShakespeareKerasBenchmarkReal(ShakespeareBenchmarkBase): ...@@ -264,6 +274,14 @@ class ShakespeareKerasBenchmarkReal(ShakespeareBenchmarkBase):
FLAGS.distribution_strategy = 'off' FLAGS.distribution_strategy = 'off'
self._run_and_report_benchmark() self._run_and_report_benchmark()
def benchmark_cpu_no_ds_force_v2(self):
"""Benchmark cpu no ds, and force v2."""
self._setup()
FLAGS.num_gpus = 0
FLAGS.batch_size = 64
FLAGS.distribution_strategy = 'off'
self._run_and_report_benchmark()
def benchmark_1_gpu(self): def benchmark_1_gpu(self):
"""Benchmark 1 gpu.""" """Benchmark 1 gpu."""
self._setup() self._setup()
...@@ -279,6 +297,15 @@ class ShakespeareKerasBenchmarkReal(ShakespeareBenchmarkBase): ...@@ -279,6 +297,15 @@ class ShakespeareKerasBenchmarkReal(ShakespeareBenchmarkBase):
FLAGS.distribution_strategy = 'off' FLAGS.distribution_strategy = 'off'
self._run_and_report_benchmark() self._run_and_report_benchmark()
def benchmark_1_gpu_no_ds_force_v2(self):
"""Benchmark 1 gpu no ds, and force v2."""
self._setup()
FLAGS.num_gpus = 1
FLAGS.batch_size = 64
FLAGS.force_v2_in_keras_compile = True
FLAGS.distribution_strategy = 'off'
self._run_and_report_benchmark()
def benchmark_1_gpu_no_ds_run_eagerly(self): def benchmark_1_gpu_no_ds_run_eagerly(self):
"""Benchmark 1 gpu.""" """Benchmark 1 gpu."""
self._setup() self._setup()
......
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