File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
src/torchrunx/integrations Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
- # Pytorch Lightning
1
+ # PyTorch Lightning
2
2
3
3
``` {eval-rst}
4
4
.. literalinclude:: ./scripts/lightning_train.py
Original file line number Diff line number Diff line change 1
- """Pytorch Lightning extension utilities ."""
1
+ """Integration with PyTorch Lightning Trainer ."""
2
2
3
- import torch
4
3
from lightning .fabric .plugins .environments .torchelastic import ( # pyright: ignore [reportMissingImports]
5
4
TorchElasticEnvironment ,
6
5
)
7
6
8
7
9
8
class TorchrunxClusterEnvironment (TorchElasticEnvironment ):
10
- """PyTorch Lightning ClusterEnvironment compatible with torchrunx ."""
9
+ """Compatible ClusterEnvironment for PyTorch Lightning ."""
11
10
12
11
@staticmethod
13
12
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
You can’t perform that action at this time.
0 commit comments