Commit 866d0d2e authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Fix --ddp-backend=no_c10d for params that don't require grads

Summary: Pull Request resolved: https://github.com/pytorch/fairseq/pull/388

Reviewed By: theweiho

Differential Revision: D13244869

fbshipit-source-id: d22c18f63f9a691ccc7245e06bc9a5b776a192b5
parent 07e34244
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,4 +166,5 @@ class LegacyDistributedDataParallel(nn.Module):
            def allreduce_hook(*unused):
                Variable._execution_engine.queue_callback(reduction_fn)

            if p.requires_grad:
                p.register_hook(allreduce_hook)