transformers
transformers copied to clipboard
fp16 is broken
run run_glue.py with the parameter of --fp16, and return error:
RuntimeError: Incoming model is an instance of torch.nn.parallel.DistributedDataParallel. Parallel wrappers should only be applied to the model(s) AFTER
the model(s) have been returned from amp.initialize.
i find the reason is the wrong order of amp.initialize and model = torch.nn.DataParallel, iIf DDP wrapping occurs before amp.initialize, amp.initialize will raise an error, and it worked after i change the order
Indeed, thanks! Fixed in master