Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
8f44de85
Commit
8f44de85
authored
Jun 11, 2019
by
guptapriya
Committed by
guptapriya
Jun 12, 2019
Browse files
Add more tests and benchmarks to cover no dist strat and ctl cases
parent
bed2745d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
official/recommendation/ncf_keras_benchmark.py
official/recommendation/ncf_keras_benchmark.py
+6
-0
official/recommendation/ncf_test.py
official/recommendation/ncf_test.py
+13
-6
No files found.
official/recommendation/ncf_keras_benchmark.py
View file @
8f44de85
...
@@ -121,6 +121,12 @@ class KerasNCFRealData(KerasNCFBenchmarkBase):
...
@@ -121,6 +121,12 @@ class KerasNCFRealData(KerasNCFBenchmarkBase):
self
.
_setup
()
self
.
_setup
()
self
.
_run_and_report_benchmark
()
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_no_dist_strat_early_stop
(
self
):
self
.
_setup
()
FLAGS
.
distribution_strategy
=
'off'
FLAGS
.
early_stopping
=
True
self
.
_run_and_report_benchmark
()
def
benchmark_1_gpu_early_stop
(
self
):
def
benchmark_1_gpu_early_stop
(
self
):
self
.
_setup
()
self
.
_setup
()
FLAGS
.
early_stopping
=
True
FLAGS
.
early_stopping
=
True
...
...
official/recommendation/ncf_test.py
View file @
8f44de85
...
@@ -201,22 +201,29 @@ class NcfTest(tf.test.TestCase):
...
@@ -201,22 +201,29 @@ class NcfTest(tf.test.TestCase):
extra_flags
=
self
.
_BASE_END_TO_END_FLAGS
+
[
'-ml_perf'
,
'True'
])
extra_flags
=
self
.
_BASE_END_TO_END_FLAGS
+
[
'-ml_perf'
,
'True'
])
@
mock
.
patch
.
object
(
rconst
,
"SYNTHETIC_BATCHES_PER_EPOCH"
,
100
)
@
mock
.
patch
.
object
(
rconst
,
"SYNTHETIC_BATCHES_PER_EPOCH"
,
100
)
def
test_end_to_end_keras
(
self
):
def
test_end_to_end_keras
_no_dist_strat
(
self
):
integration
.
run_synthetic
(
integration
.
run_synthetic
(
ncf_keras_main
.
main
,
tmp_root
=
self
.
get_temp_dir
(),
max_train
=
None
,
ncf_keras_main
.
main
,
tmp_root
=
self
.
get_temp_dir
(),
max_train
=
None
,
extra_flags
=
self
.
_BASE_END_TO_END_FLAGS
+
extra_flags
=
self
.
_BASE_END_TO_END_FLAGS
+
[
'-distribution_strategy'
,
'off'
])
[
'-distribution_strategy'
,
'off'
])
@
mock
.
patch
.
object
(
rconst
,
"SYNTHETIC_BATCHES_PER_EPOCH"
,
100
)
@
mock
.
patch
.
object
(
rconst
,
"SYNTHETIC_BATCHES_PER_EPOCH"
,
100
)
def
test_end_to_end_keras_
mlperf
(
self
):
def
test_end_to_end_keras_
dist_strat
(
self
):
integration
.
run_synthetic
(
integration
.
run_synthetic
(
ncf_keras_main
.
main
,
tmp_root
=
self
.
get_temp_dir
(),
max_train
=
None
,
ncf_keras_main
.
main
,
tmp_root
=
self
.
get_temp_dir
(),
max_train
=
None
,
extra_flags
=
self
.
_BASE_END_TO_END_FLAGS
+
extra_flags
=
self
.
_BASE_END_TO_END_FLAGS
+
[
'-num_gpus'
,
'0'
])
[
'-ml_perf'
,
'True'
,
'-distribution_strategy'
,
'off'
])
@
mock
.
patch
.
object
(
rconst
,
"SYNTHETIC_BATCHES_PER_EPOCH"
,
100
)
def
test_end_to_end_keras_dist_strat_ctl
(
self
):
flags
=
(
self
.
_BASE_END_TO_END_FLAGS
+
[
'-num_gpus'
,
'0'
]
+
[
'-keras_use_ctl'
,
'True'
])
integration
.
run_synthetic
(
ncf_keras_main
.
main
,
tmp_root
=
self
.
get_temp_dir
(),
max_train
=
None
,
extra_flags
=
self
.
_BASE_END_TO_END_FLAGS
+
[
'-num_gpus'
,
'0'
])
@
mock
.
patch
.
object
(
rconst
,
"SYNTHETIC_BATCHES_PER_EPOCH"
,
100
)
@
mock
.
patch
.
object
(
rconst
,
"SYNTHETIC_BATCHES_PER_EPOCH"
,
100
)
def
test_end_to_end_keras_1_gpu
(
self
):
def
test_end_to_end_keras_1_gpu
_dist_strat
(
self
):
if
context
.
num_gpus
()
<
1
:
if
context
.
num_gpus
()
<
1
:
self
.
skipTest
(
self
.
skipTest
(
"{} GPUs are not available for this test. {} GPUs are available"
.
"{} GPUs are not available for this test. {} GPUs are available"
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment