Skip to content

Commit aa6015d

Browse files
committed
Docstring
1 parent 2e08a72 commit aa6015d

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

examples/pl_bug_report/bug_report_model.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from time import sleep
23

34
import torch
45
from torch.utils.data import DataLoader, Dataset
@@ -29,37 +30,31 @@ def forward(self, x):
2930
def training_step(self, batch, batch_idx):
3031
loss = self(batch).sum()
3132
self.log("train_loss", loss)
33+
for i in range(9999999999):
34+
print(f"[rank {self.local_rank}]", "zzz", i, os.getpid(), self.trainer.received_sigterm)
35+
sleep(3)
3236
return {"loss": loss}
3337

34-
def validation_step(self, batch, batch_idx):
35-
loss = self(batch).sum()
36-
self.log("valid_loss", loss)
37-
38-
def test_step(self, batch, batch_idx):
39-
loss = self(batch).sum()
40-
self.log("test_loss", loss)
41-
4238
def configure_optimizers(self):
4339
return torch.optim.SGD(self.layer.parameters(), lr=0.1)
4440

4541

4642
def run():
4743
train_data = DataLoader(RandomDataset(32, 64), batch_size=2)
48-
val_data = DataLoader(RandomDataset(32, 64), batch_size=2)
49-
test_data = DataLoader(RandomDataset(32, 64), batch_size=2)
5044

5145
model = BoringModel()
5246
trainer = Trainer(
5347
default_root_dir=os.getcwd(),
5448
limit_train_batches=1,
55-
limit_val_batches=1,
56-
limit_test_batches=1,
57-
num_sanity_val_steps=0,
58-
max_epochs=1,
49+
accelerator="cpu",
50+
strategy="ddp",
51+
devices=2,
5952
enable_model_summary=False,
53+
logger=False,
54+
enable_checkpointing=False,
55+
enable_progress_bar=False,
6056
)
61-
trainer.fit(model, train_dataloaders=train_data, val_dataloaders=val_data)
62-
trainer.test(model, dataloaders=test_data)
57+
trainer.fit(model, train_dataloaders=train_data)
6358

6459

6560
if __name__ == "__main__":

src/pytorch_lightning/loggers/mlflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class MLFlowLogger(Logger):
8080
8181
.. code-block:: bash
8282
83-
pip install mlflow
83+
pip install mlflow # or mlflow-skinny
8484
8585
.. code-block:: python
8686

0 commit comments

Comments
 (0)