Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit 3bc29b4

Browse files
carmoccaRaalsky
authored andcommitted
Fix docs filterwarnings snippet (Lightning-AI#10671)
1 parent 3d5c438 commit 3bc29b4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

docs/source/guides/speed.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ For debugging purposes or for dataloaders that load very small datasets, it is d
151151
152152
import warnings
153153
154-
warnings.filterwarnings(
155-
"ignore", ".*does not have many workers. Consider increasing the value of the `num_workers` argument*"
156-
)
154+
warnings.filterwarnings("ignore", ".*Consider increasing the value of the `num_workers` argument*")
157155
158156
Spawn
159157
"""""

pytorch_lightning/trainer/data_loading.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def _worker_check(self, dataloader: DataLoader, name: str) -> None:
104104
)
105105

106106
elif dataloader.num_workers <= 2 < num_cpus and not using_spawn:
107+
# if changed, update the `filterwarnings` snippet in 'speed.html#num-workers'
107108
rank_zero_warn(
108109
f"The dataloader, {name}, does not have many workers which may be a bottleneck."
109110
" Consider increasing the value of the `num_workers` argument`"

0 commit comments

Comments
 (0)