[bugfix] TPU + all_gather + SingleTPU shouldn't call xm.all_gather (#6296)
* resolve an issue with TPU * update * add changelog
This commit is contained in:
parent
4a8422c2dc
commit
484dce11ec
|
@ -95,6 +95,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
|||
- Fixed duplicate logs appearing in console when using the python logging module ([#5509](https://github.com/PyTorchLightning/pytorch-lightning/pull/5509), [#6275](https://github.com/PyTorchLightning/pytorch-lightning/pull/6275))
|
||||
|
||||
|
||||
- Fixed `SingleTPU` calling `all_gather` ([#6296](https://github.com/PyTorchLightning/pytorch-lightning/pull/6296))
|
||||
|
||||
|
||||
- Fixed error thrown when using valid distributed mode in multi node ([#6297](https://github.com/PyTorchLightning/pytorch-lightning/pull/6297)
|
||||
|
||||
|
||||
|
|
|
@ -44,4 +44,7 @@ class TPUAccelerator(Accelerator):
|
|||
Return:
|
||||
A tensor of shape (world_size, batch, ...)
|
||||
"""
|
||||
# todo: Add support for backward with all_gather
|
||||
if torch.distributed.is_initialized():
|
||||
return xm.all_gather(tensor, group=group, sync_grads=sync_grads)
|
||||
return tensor
|
||||
|
|
Loading…
Reference in New Issue