You need to sign in or sign up before continuing.
Commit 6c1da0f7 authored by Nayan Singhal's avatar Nayan Singhal Committed by Facebook Github Bot
Browse files

Fixing BMUF warmup and sync strategy

Summary:
Bmuf sync started happening even before warmup is done.
This diff fixes the behavior and do bmuf sync once warmup is done or if it's zero.

TODO: write a unit test case so that these problems can be figure out faster.

Reviewed By: jay-mahadeokar

Differential Revision: D17356277

fbshipit-source-id: 21500e6ed1225b97794e4ee203e5d7d04a2840f8
parent 62e65c41
...@@ -127,7 +127,9 @@ class FairseqBMUF(FairseqOptimizer): ...@@ -127,7 +127,9 @@ class FairseqBMUF(FairseqOptimizer):
def _is_bmuf_iter(self): def _is_bmuf_iter(self):
# Check whether train iterations is equal to bmuf sync iter # Check whether train iterations is equal to bmuf sync iter
if self.get_num_updates() % self.sync_iter == 0: if (self.get_num_updates() > self.warmup_iteration) and (
self.get_num_updates() % self.sync_iter == 0
):
return True return True
return False return False
......
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