Unverified Commit 5d3a7d04 authored by Toby Boyd's avatar Toby Boyd Committed by GitHub
Browse files

Move test to under accuracy class. (#6202)

parent 3a19c394
......@@ -66,6 +66,20 @@ class Resnet50KerasAccuracy(keras_benchmark.KerasBenchmark):
FLAGS.enable_eager = True
self._run_and_report_benchmark()
def benchmark_8_gpu_bfc_allocator(self):
self._setup()
FLAGS.num_gpus = 8
FLAGS.enable_eager = True
FLAGS.model_dir = self._get_model_dir('benchmark_8_gpu_bfc_allocator')
FLAGS.batch_size = 128 * 8 # 8 GPUs
# Limits CPU memory to work around memory spikes in eager mode.
# TODO(yuefengz): get rid of this test once we fix the memory issue.
os.environ['TF_CPU_ALLOCATOR_USE_BFC'] = 'true'
os.environ['TF_CPU_BFC_MEM_LIMIT_IN_MB'] = '100000'
self._run_and_report_benchmark()
del os.environ['TF_CPU_ALLOCATOR_USE_BFC']
del os.environ['TF_CPU_BFC_MEM_LIMIT_IN_MB']
def _run_and_report_benchmark(self):
start_time_sec = time.time()
stats = keras_imagenet_main.run(flags.FLAGS)
......@@ -157,23 +171,6 @@ class Resnet50KerasBenchmarkBase(keras_benchmark.KerasBenchmark):
FLAGS.batch_size = 128 * 8 # 8 GPUs
self._run_and_report_benchmark()
def benchmark_8_gpu_bfc_allocator(self):
self._setup()
FLAGS.num_gpus = 8
FLAGS.enable_eager = True
FLAGS.distribution_strategy = 'default'
FLAGS.model_dir = self._get_model_dir('benchmark_8_gpu')
FLAGS.batch_size = 128 * 8 # 8 GPUs
# Use BFC allocator with limited memory on CPU as a workaround for memory
# spikes in eager mode.
# TODO(yuefengz): get rid of this test once we fix the memory issue.
os.environ['TF_CPU_ALLOCATOR_USE_BFC'] = 'true'
os.environ['TF_CPU_BFC_MEM_LIMIT_IN_MB'] = '100000'
self._run_and_report_benchmark()
del os.environ['TF_CPU_ALLOCATOR_USE_BFC']
del os.environ['TF_CPU_BFC_MEM_LIMIT_IN_MB']
def benchmark_graph_8_gpu(self):
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