-
Notifications
You must be signed in to change notification settings - Fork 45.6k
Fix/ncf mlperf tweaks #5334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/ncf mlperf tweaks #5334
Conversation
robieta
commented
Sep 19, 2018
- Cleanup run script. Fix hr threshold and add ml_perf flag
- Make exit behavior more stable
- Add seed to reduce variation. There is still unaccounted for variation, but this at least removes some of it.
atexit.register(_shutdown, proc=proc) | ||
atexit.register(tf.gfile.DeleteRecursively, | ||
ncf_dataset.cache_paths.cache_root) | ||
cleanup_called = {"finished": False} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you set this to True?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Good catch.
@@ -390,6 +396,8 @@ def run_ncf(_): | |||
if model_helpers.past_stop_threshold(FLAGS.hr_threshold, hr): | |||
break | |||
|
|||
cleanup_fn() # Cleanup data construction artifacts and subprocess. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to call this, since it's registered with atexit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from Shawn. He is running in a loop, and is accumulating files because the atexit hasn't triggered yet. I neglected that use case when I decided to rely on atexits.
num_gpus = flags_core.get_num_gpus(FLAGS) | ||
batch_size = distribution_utils.per_device_batch_size( | ||
int(FLAGS.batch_size), num_gpus) | ||
eval_batch_size = int(FLAGS.eval_batch_size or FLAGS.batch_size) | ||
ncf_dataset = data_preprocessing.instantiate_pipeline( | ||
ncf_dataset, cleanup_fn = data_preprocessing.instantiate_pipeline( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass deterministic=FLAGS.seed is not None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I wonder if this is the reason that I wasn't seeing deterministic behavior. (I'll rerun to test.)
1b180ca
to
11c5a43
Compare