Commit f66e9cb5 authored by Myle Ott's avatar Myle Ott
Browse files

Disable c10d for AdaptiveLoss

parent 1082ba35
...@@ -22,6 +22,12 @@ class AdaptiveLoss(FairseqCriterion): ...@@ -22,6 +22,12 @@ class AdaptiveLoss(FairseqCriterion):
def __init__(self, args, task): def __init__(self, args, task):
super().__init__(args, task) super().__init__(args, task)
if not args.no_c10d:
raise Exception(
'AdaptiveLoss is not compatible with the c10d version of '
'DistributedDataParallel. Please add the `--no-c10d` flag.'
)
def forward(self, model, sample, reduce=True): def forward(self, model, sample, reduce=True):
"""Compute the loss for the given sample. """Compute the loss for the given sample.
......
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