Skip to content

Remove the deprecated run_stage #14870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pytorch_lightning/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- Removed the deprecated `Trainer.use_amp` and `LightningModule.use_amp` attributes ([#14832](https://github.com/Lightning-AI/lightning/pull/14832))

- Removed the deprecated `Trainer.run_stage` in favor of `Trainer.{fit,validate,test,predict}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe I missed it but why no one is adding the PR link for these PRs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this! I believe we forgot this. Should I open a new PR to add this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this in another PR :)



- Removed the deprecated `SimpleProfiler.profile_iterable` and `AdvancedProfiler.profile_iterable` attributes ([#14864](https://github.com/Lightning-AI/lightning/pull/14864))

Expand Down
7 changes: 0 additions & 7 deletions src/pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,13 +1133,6 @@ def _teardown(self):
self._logger_connector.teardown()
self._signal_connector.teardown()

def run_stage(self) -> None:
rank_zero_deprecation(
"`Trainer.run_stage` is deprecated in v1.6 and will be removed in v1.8. Use"
" `Trainer.{fit,validate,test,predict}` instead."
)
return self._run_stage()

def _run_stage(self):
self.strategy.barrier("run-stage")
self.strategy.dispatch(self)
Expand Down
7 changes: 0 additions & 7 deletions tests/tests_pytorch/deprecated_api/test_remove_1-8.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ def test_v1_8_0_deprecated_call_hook():
trainer.call_hook("test_hook")


def test_v1_8_0_deprecated_run_stage():
trainer = Trainer()
trainer._run_stage = Mock()
with pytest.deprecated_call(match="`Trainer.run_stage` is deprecated in v1.6 and will be removed in v1.8."):
trainer.run_stage()


def test_v1_8_0_trainer_verbose_evaluate():
trainer = Trainer()
with pytest.deprecated_call(match="verbose_evaluate` property has been deprecated and will be removed in v1.8"):
Expand Down