Commit d0358bb3 authored by Jerry Ma's avatar Jerry Ma Committed by Facebook Github Bot
Browse files

fix inconsistency w/ recent pytorch cuda device logic

Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/892

Differential Revision: D18109685

Pulled By: jma127

fbshipit-source-id: f96e1080a5577b8ee0748dfdd956bf72bed47474
parent 39faa0a4
......@@ -330,7 +330,7 @@ class Trainer(object):
print(msg, file=sys.stderr)
if torch.cuda.is_available() and hasattr(torch.cuda, "memory_summary"):
for device_idx in range(torch.cuda.device_count()):
print(torch.cuda.memory_summary(device=torch.cuda.device(device_idx)),
print(torch.cuda.memory_summary(device=device_idx),
file=sys.stderr)
sys.stderr.flush()
......
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