Skip to content

Commit

Permalink
fix make doc and update precision reference
Browse files Browse the repository at this point in the history
  • Loading branch information
four4fish committed Nov 17, 2021
1 parent f3ede47 commit c4d9fb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions pytorch_lightning/accelerators/accelerator.py
Expand Up @@ -280,10 +280,9 @@ def amp_backend(self) -> Optional[LightningEnum]:

@property
def precision(self) -> Union[str, int]:
"""
.. deprecated
This method is deprecated will be removed soon.
Use :`training_type_plugin.precision_plugin.precision` instead.
"""This method is deprecated and will be removed soon.
Use `training_type_plugin.precision_plugin.precision` instead.
"""
rank_zero_deprecation(
f"`{self.__class__.__name__}.precision` was and will be removed soon"
Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/plugins/training_type/ipu.py
Expand Up @@ -118,7 +118,7 @@ def setup(self) -> None:
self.lightning_module.trainer._update_dataloader = self._convert_to_poptorch_loader

def pre_dispatch(self) -> None:
model = LightningIPUModule(self.lightning_module, self.precision)
model = LightningIPUModule(self.lightning_module, self.precision_plugin.precision)
self.model = model

# reset the backup
Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/plugins/training_type/sharded.py
Expand Up @@ -75,7 +75,7 @@ def _reinit_optimizers_with_oss(self, optimizers: List[Union[Optimizer, Lightnin
optim_class = type(optimizer)
zero_optimizer = OSS(params=optimizer.param_groups, optim=optim_class, **optimizer.defaults)
if _FAIRSCALE_OSS_FP16_BROADCAST_AVAILABLE:
precision = self._precision or self.precision
precision = self._precision or self.precision_plugin.precision
is_fp16 = precision in ("mixed", 16)
# For multi-node training, compressing the model shards in fp16 before broadcasting
# improves performance. When using PyTorch AMP, it will not degrade
Expand Down

0 comments on commit c4d9fb8

Please sign in to comment.