-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
🚀 Typing coverage
Let's improve typing coverage of PyTorch Lightning together!
I'm creating a new issue in order to increase visibility. There are three older issues (#7037, #5023, #4698) which became stale over time.
Plan
Currently, there are 55 files which are excluded from mypy checks so that our CI does not fail. These files vastly differ in difficulty in order to make the typing complete. For this reason, we are introducing difficulty estimate for each file so that community members can choose to work on the files appropriate to their skill level.
Please, comment on this issue in order to reserve a particular file to work on. Once you do so, I will edit this top comment to avoid collisions. Once you think your work is finished, please open a PR referencing this issue which:
- removes the corresponding line from
pyproject.toml - and passes
mypychecks with the corresponding line removed. You can test it locally by runningmypyfrom root directory
If you are struggling with pushing it over the finish line, open the PR anyway and someone from our team will help you to get it there. 🚀
Please note, that it can happen that you may need to edit more than just one file. This is fine, but please keep in mind, that the goal of your PR will be to make the check passing for the chosen file. Also, please note that the difficulty is just an educated guess.
For those of you who are not familiar with the process of contributing a PR, we have prepared a simple guide that will walk you through the necessary steps. You can do it! 🚀 💪
List of files and guesstimated difficulty
Completed
Difficulty 1 of 3
-
pytorch_lightning/core/decorators.pyRun mypy with PyTorch 1.12 #14044 -
pytorch_lightning/profilers/advanced.py@nninept Fix mypy errors attributed topytorch_lightning/profilers/advanced.py#13792
- [ ]pytorch_lightning/profilers/base.py@LeeChanHyuk Fix mypy errors attributed to pytorch_lightning/profilers/base.py #13879 -
pytorch_lightning/loggers/base.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.base.py#13494 -
pytorch_lightning/__setup__.py@CyprienRicque fix mypy typing errors in pytorch_lightning/__setup__.py #13472
- [ ]pytorch_lightning/distributed/dist.py@puhuk fix mypy errors for distributed/dist.py #13492 -
pytorch_lightning/strategies/single_device.py@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/single_device.py #13532 -
pytorch_lightning/trainer/optimizers.py@gautierdag fix mypy typing errors in lightning/trainer/optimizers.py #13470 -
pytorch_lightning/utilities/distributed.py@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.utilities.distributed#13678 -
pytorch_lightning/callbacks/finetuning.py@ar90n Fix type hints of callbacks/finetuning.py #13516 -
pytorch_lightning/loggers/mlflow.py@JustinGoheenFix mypy errors attributed to pytorch_lightning.loggers.mlflow #13690Fix mypy errors attributed topytorch_lightning.loggers.mlflow#13691 -
pytorch_lightning/tuner/tuning.py@donlaparkfix typing in pl/tuner/tuning.py #13616Change the return type oftune()intrainer.pyto TypedDict #13631 -
pytorch_lightning/strategies/single_tpu.py@CyprienRicque Fix mypy typing errors in pytorch_lightning/strategies/single_tpu.py #13534 -
pytorch_lightning/strategies/ddp2.py@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/ddp2.py #13535 -
pytorch_lightning/strategies/parallel.py@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/parallel.py #13556 -
pytorch_lightning/loggers/csv_logs.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.csv_logs.py#13538 -
pytorch_lightning/tuner/lr_finder.py@donlapark fix mypy typing errors in pytorch_lightning/tuner/lr_finder.py #13513 Remove abooltype assignment inlr_finder.py#13652 -
pytorch_lightning/strategies/dp.py@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/dp.py #13564 -
pytorch_lightning/profilers/simple.py@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.profilers.simple#14103 -
pytorch_lightning/strategies/sharded_spawn.py@krishnakalyan3 Fix mypy errors attributed topytorch_lightning. strategies.sharded_spawn#14102 -
pytorch_lightning/demos/mnist_datamodule.py@alro923 Fix mypy typing errors attributed topytorch_lightning/demos/mnist_datamodule.py#13929 -
pytorch_lightning/demos/boring_classes.py@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.demos.boring_classes#14201 -
pytorch_lightning/tuner/batch_size_scaling.py@ar90n Fix type hints of tuner/batch_size_scaling.py #13518
Difficulty 2 of 3
-
pytorch_lightning/loops/epoch/training_epoch_loop.py@himkt Fix mypy errors attributed to pytorch_lightning/loops/epoch/training_epoch_loop.py #13555 -
pytorch_lightning/core/mixins/device_dtype_mixin.py@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.core.mixins.device_dtype_mixin#13704 -
pytorch_lightning/loggers/comet.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.comet#13689 -
pytorch_lightning/loggers/tensorboard.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.tensorboard.py#13688 -
pytorch_lightning/strategies/horovod.py@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/horovod.py #13570 -
pytorch_lightning/callbacks/model_checkpoint.py@BongYang Fix mypy typing errors in pytorch_lightning/callbacks/model_checkpoint.py #13617 -
pytorch_lightning/strategies/fully_sharded.py@BongYang Fix mypy typing errors in strategies/fully_sharded.py #13941 -
pytorch_lightning/loggers/neptune.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.neptune#13692 -
pytorch_lightning/utilities/meta.py@nninept Fix mypy errors attributed topytorch_lightning/utilities/meta.py#13763 Remove meta device utilities in favor of torchdistx #13868 -
pytorch_lightning/strategies/tpu_spawn.py@BongYang Fix mypy typing errors in pytorch_lightning/strategies/tpu_spawn.py #13813 -
pytorch_lightning/loggers/logger.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.logger.py#13541 -
pytorch_lightning/loggers/wandb.py@gautierdag fix mypy errors for loggers/wandb.py #13483 -
pytorch_lightning/callbacks/stochastic_weight_avg.py@donlapark fixes typing in pytorch_lightning/callbacks/stochastic_weight_avg.py #13685 fixes typing instochastic_weight_avg.py(follow-up of #13685) #13860 -
pytorch_lightning/strategies/strategy.py@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/strategy.py #13519 -
pytorch_lightning/strategies/deepspeed.py@donlapark Fixes various typing errors inpytorch_lightning/strategies/deepspeed.py#13832 -
pytorch_lightning/strategies/ddp_spawn.py@donlapark Fix mypy errors in strategies/ddp_spawn.py #13865 -
pytorch_lightning/strategies/ipu.py@HalestormAI Fix typing annotations for the ipu strategy #13786 -
pytorch_lightning/trainer/connectors/callback_connector.py@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.trainer.connectors.callback_connector.py#13750 -
pytorch_lightning/strategies/ddp.py@lijm1358 Fix mypy errors inpytorch_lightning/strategies/ddp.py#13885 -
pytorch_lightning/core/saving.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.core.saving#13932 -
pytorch_lightning/callbacks/quantization.py@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.callbacks.quantization#13782 -
pytorch_lightning/strategies/sharded.py@lijm1358 Fix mypy errors inpytorch_lightning/strategies/sharded.py#14184 -
pytorch_lightning/core/datamodule.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.core.datamodule#13693
Difficulty 3 of 3
~- [ ] pytorch_lightning/trainer/callback_hook.py @JustinGoheen #13807 ~
-
pytorch_lightning/core/module.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.core.module.py#13603 -
pytorch_lightning/trainer/connectors/data_connector.py@JustinGoheen Fix mypy errors attributed topytorch_lightning.trainer.connectors.data_connector.py#13806 -
pytorch_lightning/utilities/auto_restart.py@donlapark fixes typing errors in auto_restart.py #13904 -
pytorch_lightning/trainer/supporters.py@donlapark fixes mypy errors in trainer/supporters.py #14633 -
pytorch_lightning/profilers/pytorch.py@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.profilers.pytorch#14405 -
pytorch_lightning/utilities/data.py@nandwalritik fix mypy typing errors in pytorch_lightning.utilities.data.py #13901 -
pytorch_lightning/trainer/trainer.py@JustinGoheen Fix mypy errors attributed to@BongYang Fix mypy typing errors in pytorch_lightning/trainer/trainer.py #14204pytorch_lightning.trainer.trainer.py#13810 -
pytorch_lightning/callbacks/progress/rich_progress.py@donlapark fixes typing errors in rich_progress.py #14963
cc @Borda @justusschock @awaelchli @rohitgr7 @Borda @tchaton @aniketmaurya @kingjuno @alat-rights @carmocca @akihironitta @stancld as you were all involved in previous issues