From 0d82876132846311f75fa752560c43ad4bd7f34b Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Wed, 18 Aug 2021 11:15:32 -0700 Subject: [PATCH] Add comment for reference re PyTorch XLA 'race' issue --- train.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/train.py b/train.py index 1e95c831..217f9a88 100755 --- a/train.py +++ b/train.py @@ -732,6 +732,11 @@ def evaluate( elif dev_env.type_cuda: dev_env.synchronize() + # FIXME uncommenting this fixes race btw model `output`/`loss` and loss_m/accuracy_m meter input + # for PyTorch XLA GPU use. + # This issue does not exist for normal PyTorch w/ GPU (CUDA) or PyTorch XLA w/ TPU. + # loss.item() + tracker.mark_iter_step_end() losses_m.update(loss, output.size(0)) accuracy_m.update(output, target)