Skip to content

Commit 2674976

Browse files
Bordaawaelchli
andauthored
remove deprecated API for v0.8 (Lightning-AI#2073)
* remove deprecated API * chlog * times * missed * formatting check * missing * missing * miss * fix docs build error * fix pep whitespace error * docs * wip * amp_level * amp_level Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
1 parent 08573d0 commit 2674976

34 files changed

+94
-533
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ steps:
3838
#- pip install -r ./docs/requirements.txt --user -q
3939
- pip list
4040
- python -c "import torch ; print(' & '.join([torch.cuda.get_device_name(i) for i in range(torch.cuda.device_count())]) if torch.cuda.is_available() else 'only CPU')"
41-
- coverage run --source pytorch_lightning -m py.test pytorch_lightning tests benchmarks -v # --flake8
41+
- coverage run --source pytorch_lightning -m py.test pytorch_lightning tests benchmarks -v --durations=25 # --flake8
4242
#- cd docs; make doctest; make coverage
4343
- coverage report
4444
- codecov --token $CODECOV_TOKEN # --pr $DRONE_PULL_REQUEST --build $DRONE_BUILD_NUMBER --branch $DRONE_BRANCH --commit $DRONE_COMMIT --tag $DRONE_TAG

.github/workflows/code-formatting-check.yml renamed to .github/workflows/code-formatting.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
name: "Check Formatting"
2-
on: [push, pull_request]
1+
name: "Check Formatting - Black"
2+
on:
3+
# Trigger the workflow on push or pull request,
4+
# but only for the master branch
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
311

412
jobs:
513
check_code_formatting:

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5353
### Removed
5454

5555
- Removed unintended Trainer argument `progress_bar_callback`, the callback should be passed in by `Trainer(callbacks=[...])` instead ([#1855](https://github.com/PyTorchLightning/pytorch-lightning/pull/1855))
56-
- Remove obsolete `self._device` in Trainer ([#1849](https://github.com/PyTorchLightning/pytorch-lightning/pull/1849))
56+
- Removed obsolete `self._device` in Trainer ([#1849](https://github.com/PyTorchLightning/pytorch-lightning/pull/1849))
57+
- Removed deprecated API ([#2073](https://github.com/PyTorchLightning/pytorch-lightning/pull/2073))
58+
* Packages: `pytorch_lightning.pt_overrides`, `pytorch_lightning.root_module`
59+
* Modules: `pytorch_lightning.logging.comet_logger`, `pytorch_lightning.logging.mlflow_logger`, `pytorch_lightning.logging.test_tube_logger`, `pytorch_lightning.overrides.override_data_parallel`, `pytorch_lightning.core.model_saving`, `pytorch_lightning.core.root_module`
60+
* Trainer arguments: `add_row_log_interval`, `default_save_path`, `gradient_clip`, `nb_gpu_nodes`, `max_nb_epochs`, `min_nb_epochs`, `nb_sanity_val_steps`
61+
* Trainer attributes: `nb_gpu_nodes`, `num_gpu_nodes`, `gradient_clip`, `max_nb_epochs`, `min_nb_epochs`, `nb_sanity_val_steps`, `default_save_path`, `tng_tqdm_dic`
5762

5863
### Fixed
5964

@@ -102,6 +107,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
102107
### Deprecated
103108

104109
- Deprecated `tags_csv` in favor of `hparams_file` ([#1271](https://github.com/PyTorchLightning/pytorch-lightning/pull/1271))
110+
- Deprecated `amp_level` in favor of native AMP ([#1561](https://github.com/PyTorchLightning/pytorch-lightning/pull/1561))
105111

106112
### Fixed
107113

docs/source/conf.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,7 @@
141141
'api/modules.rst',
142142

143143
# deprecated/renamed:
144-
'api/pytorch_lightning.loggers.comet_logger.rst', # TODO: remove in v0.8.0
145-
'api/pytorch_lightning.loggers.mlflow_logger.rst', # TODO: remove in v0.8.0
146-
'api/pytorch_lightning.loggers.test_tube_logger.rst', # TODO: remove in v0.8.0
147-
'api/pytorch_lightning.callbacks.pt_callbacks.*', # TODO: remove in v0.8.0
148-
'api/pytorch_lightning.pt_overrides.*', # TODO: remove in v0.8.0
149-
'api/pytorch_lightning.root_module.*', # TODO: remove in v0.8.0
150-
'api/pytorch_lightning.logging.*', # TODO: remove in v0.8.0
144+
'api/pytorch_lightning.logging.*', # TODO: remove in v0.9.0
151145
]
152146

153147
# The name of the Pygments (syntax highlighting) style to use.

docs/source/weights_loading.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To change the checkpoint path pass in:
3131

3232
.. testcode::
3333

34-
trainer = Trainer(default_save_path='/your/path/to/save/checkpoints')
34+
trainer = Trainer(default_root_dir='/your/path/to/save/checkpoints')
3535

3636
To modify the behavior of checkpointing pass in your own callback.
3737

pytorch_lightning/core/hooks.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ def backward(self, use_amp, loss, optimizer):
149149

150150
if self.trainer.use_native_amp:
151151
self.trainer.scaler.scale(loss).backward()
152-
153-
# TODO: remove in v0.8.0
154152
else:
155153
with amp.scale_loss(loss, optimizer) as scaled_loss:
156154
scaled_loss.backward()

pytorch_lightning/core/lightning.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -990,9 +990,7 @@ def configure_apex(self, amp, model, optimizers, amp_level):
990990
991991
return model, optimizers
992992
"""
993-
model, optimizers = amp.initialize(
994-
model, optimizers, opt_level=amp_level,
995-
)
993+
model, optimizers = amp.initialize(model, optimizers, opt_level=amp_level)
996994

997995
return model, optimizers
998996

pytorch_lightning/core/model_saving.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

pytorch_lightning/core/root_module.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

pytorch_lightning/logging/comet_logger.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)