Created
October 19, 2020 14:29
-
-
Save wookim3/8c94006a51aa4cb678ef546436815918 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = torch.nn.parallel.DistributedDataParallel( | |
model, | |
device_ids=[rank], | |
output_device=rank | |
) | |
with model.join(): | |
for _ in range(5): | |
for inp in inputs: | |
loss = model(inp).sum() | |
loss.backward() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment