-
Notifications
You must be signed in to change notification settings - Fork 44
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
Autobatch #543
Autobatch #543
Conversation
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.
Thanks! I have some minor comments and think we can merge after those are addressed.
xnmt/train/regimens.py
Outdated
self.checkpoint_and_save(save_fct) | ||
if self.should_stop_training(): break | ||
|
||
def checkpoint_and_save(self, save_fct): |
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.
Maybe we can avoid code duplication by making this a subclass of SimpleTrainingRegimen
instead of TrainingRegimen
, and removing checkpoint_and_save
and update
?
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.
Done. There is a little hack to call backward at the right time though, with a comment. Not sure if it is the best solution.
@@ -0,0 +1,56 @@ | |||
# Similar to the standard setup, but with big data to compare |
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.
It would improve clarity to put all experiments in one file with a defaults
experiment, and then several experiments that only change the relevant points. But this is not a well-documented feature and it's also ok for me to just do this myself after merging this PR.
Thanks! Started to work on the changes but might need a few more days. A few questions:
|
Hmmm, I'm bit of a newbie with Github reviews... Should I just click on "Resolve conversation" on the points I addressed? Do I ask for another review when I addressed all the requested changes? |
Sure, but you can also just write a message when you're done and I'll take another look, either way is fine. I think checking that the batch size is set through Regarding the profiling, that would also be interesting information! We could probably also merge without that, but if you're planning on doing some profiling we could wait for that. In this case, you can prepend [WIP] to the title of the PR to communicate that this is not ready to merge. |
Ok, I think it is ready for another review now. The only that should be missing from the previous review is to unify the YAML files into a single one: not sure exactly how to do that. As for the profiling, I'm ok with this being merged without profiling since it might be useful as is. I can always do another pull request with an improved version later. |
Sure, that sounds good! The code looks good to me, and I'll send a PR to simplify the config later. |
Addressing #536 |
This pull request implement a new training regimen that leverages DyNet autobatching. It's very similar to SimpleTrainingRegimen but accumulates losses sequentially before computing the forward and backward passes.
batch_size
is expected to be fixed at 1 whileupdate_every
will encode the "actual batch size".This request also add a few YAML files to benchmark standard batching vs. autobatching.