Skip to content

Commit b1896d3

Browse files
committed
edited lightning integration
1 parent 91a0868 commit b1896d3

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

docs/source/examples/lightning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Pytorch Lightning
1+
# PyTorch Lightning
22

33
```{eval-rst}
44
.. literalinclude:: ./scripts/lightning_train.py
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
"""Pytorch Lightning extension utilities."""
1+
"""Integration with PyTorch Lightning Trainer."""
22

3-
import torch
43
from lightning.fabric.plugins.environments.torchelastic import ( # pyright: ignore [reportMissingImports]
54
TorchElasticEnvironment,
65
)
76

87

98
class TorchrunxClusterEnvironment(TorchElasticEnvironment):
10-
"""PyTorch Lightning ClusterEnvironment compatible with torchrunx."""
9+
"""Compatible ClusterEnvironment for PyTorch Lightning."""
1110

1211
@staticmethod
1312
def detect() -> bool:
14-
"""Returns ``True`` if the current process was launched using torchrunx."""
15-
return torch.distributed.is_available()
13+
"""Force use of the TorchElasticEnvironment."""
14+
return True

0 commit comments

Comments
 (0)