Use the strategy's `root_device` instead of the LightningModule's device property (#11734)
This commit is contained in:
parent
58324b5197
commit
72db64d294
|
@ -93,7 +93,7 @@ class ParallelStrategy(Strategy, ABC):
|
|||
return all_gather_ddp_if_available(tensor, group=group, sync_grads=sync_grads)
|
||||
|
||||
def reduce_boolean_decision(self, decision: bool) -> bool:
|
||||
decision = torch.tensor(int(decision), device=self.lightning_module.device)
|
||||
decision = torch.tensor(int(decision), device=self.root_device)
|
||||
decision = self.reduce(decision, reduce_op=ReduceOp.SUM)
|
||||
decision = bool(decision == self.world_size)
|
||||
return decision
|
||||
|
|
Loading…
Reference in New Issue