Skip to content

Commit 51b18f3

Browse files
committed
address Adrian's comments
1 parent 0930b1f commit 51b18f3

File tree

5 files changed

+13
-20
lines changed

5 files changed

+13
-20
lines changed

pytorch_lightning/core/lightning.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,8 +1970,7 @@ def add_to_queue(self, queue: pl.strategies.launchers.spawn._FakeQueue) -> None:
19701970
queue: the instance of the queue to append the data.
19711971
19721972
.. deprecated:: v1.5
1973-
This method was deprecated in v1.5 in favor of `DDPSpawnStrategy.add_to_queue`
1974-
and will be removed in v1.7.
1973+
This method was deprecated in v1.5 and will be removed in v1.7.
19751974
"""
19761975

19771976
def get_from_queue(self, queue: pl.strategies.launchers.spawn._FakeQueue) -> None:
@@ -1982,8 +1981,7 @@ def get_from_queue(self, queue: pl.strategies.launchers.spawn._FakeQueue) -> Non
19821981
queue: the instance of the queue from where to get the data.
19831982
19841983
.. deprecated:: v1.5
1985-
This method was deprecated in v1.5 in favor of `DDPSpawnStrategy.get_from_queue`
1986-
and will be removed in v1.7.
1984+
This method was deprecated in v1.5 and will be removed in v1.7.
19871985
"""
19881986

19891987
@contextmanager

pytorch_lightning/lite/lite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,14 @@ def seed_everything(seed: Optional[int] = None, workers: Optional[bool] = None)
400400

401401
def _run_impl(self, run_method: Callable, *args: Any, **kwargs: Any) -> Any:
402402
# apply sharded context to prevent OOM
403-
run_method = partial(self._run_with_sharded_context, run_method)
403+
run_method = partial(self._run_with_strategy_setup, run_method)
404404

405405
if self._strategy.launcher is not None:
406406
return self._strategy.launcher.launch(run_method, *args, **kwargs)
407407
else:
408408
return run_method(*args, **kwargs)
409409

410-
def _run_with_sharded_context(self, run_method: Callable, *args: Any, **kwargs: Any) -> Any:
410+
def _run_with_strategy_setup(self, run_method: Callable, *args: Any, **kwargs: Any) -> Any:
411411
self._strategy.setup_environment()
412412
with self._strategy.model_sharded_context(), _replace_dataloader_init_method():
413413
return run_method(*args, **kwargs)

pytorch_lightning/trainer/configuration_validator.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,11 @@ def _check_add_get_queue(model: "pl.LightningModule") -> None:
261261
"""
262262
if is_overridden("add_to_queue", model):
263263
rank_zero_deprecation(
264-
"The `LightningModule.add_to_queue` method was deprecated in v1.5 and will be removed in v1.7 in "
265-
"favor of `DDPSpawnStrategy.add_to_queue`"
264+
"The `LightningModule.add_to_queue` method was deprecated in v1.5 and will be removed in v1.7."
266265
)
267266
if is_overridden("get_from_queue", model):
268267
rank_zero_deprecation(
269-
"The `LightningModule.get_from_queue` method was deprecated in v1.5 and will be removed in v1.7 in "
270-
"favor of `DDPSpawnStrategy.get_from_queue`"
268+
"The `LightningModule.get_from_queue` method was deprecated in v1.5 and will be removed in v1.7."
271269
)
272270

273271

setup.cfg

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ addopts =
2525
--color=yes
2626
--disable-pytest-warnings
2727
filterwarnings =
28-
# error out on our deprecation warnings - ensures the code and tests are kept up-to-date
29-
error::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning
30-
error::FutureWarning
31-
# warnings from deprecated modules on import
32-
# TODO: remove in 1.7
33-
ignore::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning:pytorch_lightning.core.decorators
34-
ignore::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning:pytorch_lightning.core.memory
28+
# error out on our deprecation warnings - ensures the code and tests are kept up-to-date
29+
error::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning
30+
error::FutureWarning
31+
# warnings from deprecated modules on import
32+
# TODO: remove in 1.7
33+
ignore::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning:pytorch_lightning.core.decorators
34+
ignore::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning:pytorch_lightning.core.memory
3535

3636
junit_duration_report = call
3737

tests/strategies/test_ddp_spawn_strategy.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ def get_from_queue(self, trainer: Trainer, queue) -> None:
9494

9595

9696
class TestDDPSpawnStrategy(DDPSpawnStrategy):
97-
def __init__(self, *args, **kwargs):
98-
super().__init__(*args, **kwargs)
99-
10097
def _configure_launcher(self):
10198
self._launcher = CustomSpawnLauncher(self)
10299

0 commit comments

Comments
 (0)