Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions tutorials/examples/train_hypergrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,13 +928,9 @@ def _model_builder() -> Tuple[GFlowNet, torch.optim.Optimizer]:
env,
training_objects, # type: ignore
recalculate_all_logprobs=(not is_on_policy_iter),
reduction="sum" if args.distributed or args.loss == "SubTB" else "mean", # type: ignore
reduction="sum" if args.loss == "SubTB" else "mean", # type: ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - what was the bug here? This can produce unintended behaviour as you scale up with DDP, but maybe it actually produces incorrect scaling for distributed async training. We should discuss on the call tomorrow.

)

# Normalize the loss by the local batch size if distributed.
if args.distributed:
loss = loss / (per_node_batch_size)

# Barrier.
with Timer(
timing, "barrier 0", enabled=(args.timing and args.distributed)
Expand Down