-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Improve typing coverage (4/n) #13445
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
Comments
@otaj I will start working on these 3 for now.
|
@otaj I can take:
|
A recommendation for contributors: Unless a file requires <10 lines of fixes, I strongly suggest you work on separate PRs per file if possible. Sometimes mypy requires you to update the typing annotations for a different file, but it does not mean you need to completely annotate all modified files. |
I would like to make my first contribution to lightning. I can take |
@barufa Thank you very much, added you to the list! |
I would like to contribute as well. I can take |
@donlapark thank you as well. Added to the list:) |
I will take |
@puhuk Thank you very much! You were added to the list! |
Hello! I can work on:
|
@Cyprien-Ricque Awesome, thanks! Added your reservations to the master comment. |
Hi! |
Hi! I want to take the followings.
|
@gautierdag , thank you! I saw it was a fairly small PR, so it doesn't matter much, but we would still prefer in the future if you reserve it as to avoid collisions with other people who might already start working on that. But anyway, thank you :) @ar90n, you were also added to the list, thank you :) |
@gautierdag, perfect, thank you, added to the list! |
can I be removed from pytorch_lightning/trainer/supporters.py and pytorch_lightning/trainer/trainer.py please |
Can I be released from |
@JustinGoheen, @HeegonJin, absolutely, though we're gonna be sad about that |
Hi, I can take |
Absolutely, @nninept, thank you! 🎉 You were added to the list ⚡ |
Hi @nandwalritik, I've unassigned you from |
Hi, I would like to take |
Hi, @BongYang, thank you very much, you were added to the list! ⚡ |
I would like to take up |
Alright, @krishnakalyan3, assigned this to you! Thanks a lot ⚡ |
Hi! I would like to take |
@donlapark Appreciated! Feel free to go ahead. It could be a challenging one, let us know if you need help! |
A Edit: Nevermind, the error in |
Hi @nninept, I've unassigned you from |
I would like to take |
Awesome, @donlapark! Thank you very much, you were added to the list! ⚡ |
🎉 We did it! 🎉 We just closed last PR resolving typing in PyTorch portion of Lightning 🎉 Thanks to everyone, who contributed, namely @carmocca @nninept @JustinGoheen @CyprienRicque @gautierdag @krishnakalyan3 @ar90n @donlapark @alro923 @himkt @BongYang @HalestormAI @lijm1358 @nandwalritik 🎉 |
Shall we do the same with lightning Flow and Work... 🦦 |
I'm all for it! But that's gonna be an entirely different beast, since there's a lot more on the |
🚀 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:
pyproject.toml
mypy
checks with the corresponding line removed. You can test it locally by runningmypy
from root directoryIf 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.py
Run mypy with PyTorch 1.12 #14044pytorch_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 #13879pytorch_lightning/loggers/base.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.base.py
#13494pytorch_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 #13492pytorch_lightning/strategies/single_device.py
@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/single_device.py #13532pytorch_lightning/trainer/optimizers.py
@gautierdag fix mypy typing errors in lightning/trainer/optimizers.py #13470pytorch_lightning/utilities/distributed.py
@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.utilities.distributed
#13678pytorch_lightning/callbacks/finetuning.py
@ar90n Fix type hints of callbacks/finetuning.py #13516pytorch_lightning/loggers/mlflow.py
@JustinGoheenFix mypy errors attributed to pytorch_lightning.loggers.mlflow #13690Fix mypy errors attributed topytorch_lightning.loggers.mlflow
#13691pytorch_lightning/tuner/tuning.py
@donlaparkfix typing in pl/tuner/tuning.py #13616Change the return type oftune()
intrainer.py
to TypedDict #13631pytorch_lightning/strategies/single_tpu.py
@CyprienRicque Fix mypy typing errors in pytorch_lightning/strategies/single_tpu.py #13534pytorch_lightning/strategies/ddp2.py
@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/ddp2.py #13535pytorch_lightning/strategies/parallel.py
@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/parallel.py #13556pytorch_lightning/loggers/csv_logs.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.csv_logs.py
#13538pytorch_lightning/tuner/lr_finder.py
@donlapark fix mypy typing errors in pytorch_lightning/tuner/lr_finder.py #13513 Remove abool
type assignment inlr_finder.py
#13652pytorch_lightning/strategies/dp.py
@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/dp.py #13564pytorch_lightning/profilers/simple.py
@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.profilers.simple
#14103pytorch_lightning/strategies/sharded_spawn.py
@krishnakalyan3 Fix mypy errors attributed topytorch_lightning. strategies.sharded_spawn
#14102pytorch_lightning/demos/mnist_datamodule.py
@alro923 Fix mypy typing errors attributed topytorch_lightning/demos/mnist_datamodule.py
#13929pytorch_lightning/demos/boring_classes.py
@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.demos.boring_classes
#14201pytorch_lightning/tuner/batch_size_scaling.py
@ar90n Fix type hints of tuner/batch_size_scaling.py #13518Difficulty 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 #13555pytorch_lightning/core/mixins/device_dtype_mixin.py
@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.core.mixins.device_dtype_mixin
#13704pytorch_lightning/loggers/comet.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.comet
#13689pytorch_lightning/loggers/tensorboard.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.tensorboard.py
#13688pytorch_lightning/strategies/horovod.py
@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/horovod.py #13570pytorch_lightning/callbacks/model_checkpoint.py
@BongYang Fix mypy typing errors in pytorch_lightning/callbacks/model_checkpoint.py #13617pytorch_lightning/strategies/fully_sharded.py
@BongYang Fix mypy typing errors in strategies/fully_sharded.py #13941pytorch_lightning/loggers/neptune.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.neptune
#13692pytorch_lightning/utilities/meta.py
@nninept Fix mypy errors attributed topytorch_lightning/utilities/meta.py
#13763 Remove meta device utilities in favor of torchdistx #13868pytorch_lightning/strategies/tpu_spawn.py
@BongYang Fix mypy typing errors in pytorch_lightning/strategies/tpu_spawn.py #13813pytorch_lightning/loggers/logger.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.loggers.logger.py
#13541pytorch_lightning/loggers/wandb.py
@gautierdag fix mypy errors for loggers/wandb.py #13483pytorch_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) #13860pytorch_lightning/strategies/strategy.py
@CyprienRicque fix mypy typing errors in pytorch_lightning/strategies/strategy.py #13519pytorch_lightning/strategies/deepspeed.py
@donlapark Fixes various typing errors inpytorch_lightning/strategies/deepspeed.py
#13832pytorch_lightning/strategies/ddp_spawn.py
@donlapark Fix mypy errors in strategies/ddp_spawn.py #13865pytorch_lightning/strategies/ipu.py
@HalestormAI Fix typing annotations for the ipu strategy #13786pytorch_lightning/trainer/connectors/callback_connector.py
@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.trainer.connectors.callback_connector.py
#13750pytorch_lightning/strategies/ddp.py
@lijm1358 Fix mypy errors inpytorch_lightning/strategies/ddp.py
#13885pytorch_lightning/core/saving.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.core.saving
#13932pytorch_lightning/callbacks/quantization.py
@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.callbacks.quantization
#13782pytorch_lightning/strategies/sharded.py
@lijm1358 Fix mypy errors inpytorch_lightning/strategies/sharded.py
#14184pytorch_lightning/core/datamodule.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.core.datamodule
#13693Difficulty 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
#13603pytorch_lightning/trainer/connectors/data_connector.py
@JustinGoheen Fix mypy errors attributed topytorch_lightning.trainer.connectors.data_connector.py
#13806pytorch_lightning/utilities/auto_restart.py
@donlapark fixes typing errors in auto_restart.py #13904pytorch_lightning/trainer/supporters.py
@donlapark fixes mypy errors in trainer/supporters.py #14633pytorch_lightning/profilers/pytorch.py
@krishnakalyan3 Fix mypy errors attributed topytorch_lightning.profilers.pytorch
#14405pytorch_lightning/utilities/data.py
@nandwalritik fix mypy typing errors in pytorch_lightning.utilities.data.py #13901pytorch_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
#13810pytorch_lightning/callbacks/progress/rich_progress.py
@donlapark fixes typing errors in rich_progress.py #14963cc @Borda @justusschock @awaelchli @rohitgr7 @Borda @tchaton @aniketmaurya @kingjuno @alat-rights @carmocca @akihironitta @stancld as you were all involved in previous issues
The text was updated successfully, but these errors were encountered: