Skip to content
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

Update core/lightning.py to core/module.py #12740

Conversation

tanmoyio
Copy link
Contributor

What does this PR do?

Fixes #10499

Does your PR introduce any breaking changes? If yes, please list them.

While running make test I got some CUDA errors, I think that's issue from my side and some of the tests need nvidia/apex, deepspeed etc which I don't have in my system.

result:

220 failed, 2509 passed, 335 skipped, 12 xfailed, 4996 warnings, 3 rerun

some of the errors I got

FAILED tests/trainer/optimization/test_manual_optimization.py::test_multiple_optimizers_step - RuntimeError: CUDA error: invalid device function
FAILED tests/trainer/optimization/test_manual_optimization.py::test_step_with_optimizer_closure_with_different_frequencies_ddp_spawn - torch.multiprocessing.spawn.ProcessRaise...
FAILED tests/trainer/optimization/test_manual_optimization.py::test_multiple_optimizers_logging[16] - RuntimeError: CUDA error: invalid device function
FAILED tests/trainer/optimization/test_manual_optimization.py::test_multiple_optimizers_logging[32] - RuntimeError: CUDA error: invalid device function
FAILED tests/trainer/properties/test_get_model.py::test_get_model_gpu - RuntimeError: CUDA error: invalid device function
FAILED tests/tuner/test_scale_batch_size.py::test_auto_scale_batch_size_trainer_arg[power] - RuntimeError: CUDA error: invalid device function
FAILED tests/tuner/test_scale_batch_size.py::test_auto_scale_batch_size_trainer_arg[binsearch] - RuntimeError: CUDA error: invalid device function
FAILED tests/tuner/test_scale_batch_size.py::test_auto_scale_batch_size_trainer_arg[True] - RuntimeError: CUDA error: invalid device function
FAILED tests/tuner/test_scale_batch_size.py::test_auto_scale_batch_size_set_model_attribute[True] - RuntimeError: CUDA error: invalid device function
FAILED tests/tuner/test_scale_batch_size.py::test_auto_scale_batch_size_set_model_attribute[False] - RuntimeError: CUDA error: invalid device function
FAILED tests/tuner/test_scale_batch_size.py::test_auto_scale_batch_size_with_amp - RuntimeError: CUDA error: invalid device function
FAILED tests/utilities/test_cli.py::test_cli_distributed_save_config_callback[ddp_spawn-False] - AssertionError: Regex pattern 'Error on fit start' does not match '\n\n-- Proc...
FAILED tests/utilities/test_cli.py::test_cli_distributed_save_config_callback[ddp_spawn-True] - AssertionError: Regex pattern 'Error on fit start' does not match '\n\n-- Proce...
FAILED tests/utilities/test_cli.py::test_cli_distributed_save_config_callback[ddp-False] - RuntimeError: CUDA error: invalid device function
FAILED tests/utilities/test_cli.py::test_cli_distributed_save_config_callback[ddp-True] - RuntimeError: CUDA error: invalid device function
FAILED tests/utilities/test_distributed.py::test_collect_states - torch.multiprocessing.spawn.ProcessRaisedException:
FAILED tests/utilities/test_dtype_device_mixin.py::test_submodules_multi_gpu_dp - RuntimeError: CUDA error: invalid device function
FAILED tests/utilities/test_dtype_device_mixin.py::test_submodules_multi_gpu_ddp_spawn - torch.multiprocessing.spawn.ProcessRaisedException:
FAILED tests/utilities/test_fetching.py::test_trainer_num_prefetch_batches - RuntimeError: CUDA error: invalid device function
FAILED tests/utilities/test_model_summary.py::test_linear_model_summary_shapes[device1--1] - RuntimeError: CUDA error: invalid device function
FAILED tests/utilities/test_model_summary.py::test_linear_model_summary_shapes[device1-1] - RuntimeError: CUDA error: invalid device function
FAILED tests/utilities/test_model_summary.py::test_model_size_precision - RuntimeError: CUDA error: invalid device function

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@justusschock
Copy link
Member

Hey @tanmoyio thank you for working on this. Already looks pretty good. What's mainly missing:

  • A changelog entry
  • A file under the old name forwarding the import and raising a deprecation warning
  • A test for the deprecation warning :)

@rohitgr7
Copy link
Contributor

A file under the old name forwarding the import and raising a deprecation warning
A test for the deprecation warning :)

should it be done in a follow-up? else git diff might be huge here.

@tanmoyio tanmoyio force-pushed the lightningmodule/10499_lightning_to_module branch from cf3e9b9 to be9f19b Compare April 13, 2022 19:54
@tanmoyio
Copy link
Contributor Author

tanmoyio commented Apr 13, 2022

@justusschock @rohitgr7 is it looking good now?

@akihironitta akihironitta added the community This PR is from the community label Apr 26, 2022
@akihironitta akihironitta self-assigned this May 4, 2022
@akihironitta
Copy link
Contributor

@tanmoyio Sorry for the delay! Could you merge or rebase master?

@akihironitta
Copy link
Contributor

akihironitta commented May 4, 2022

@carmocca Do we need to split this PR into two as suggested by @rohitgr7? #12740 (comment)

@carmocca
Copy link
Contributor

carmocca commented May 4, 2022

I would say yes. For such a large change, we need to split moving code from modifying code

@carmocca carmocca added refactor lightningmodule pl.LightningModule labels May 4, 2022
@Borda Borda added the breaking change Includes a breaking change label May 4, 2022
@mergify mergify bot removed the has conflicts label May 5, 2022
@tanmoyio
Copy link
Contributor Author

tanmoyio commented May 5, 2022

@akihironitta I have updated, let me know if I need to change anything else

@tanmoyio tanmoyio requested a review from ananthsub as a code owner May 9, 2022 11:18
@rohitgr7 rohitgr7 added this to the 1.7 milestone May 9, 2022
tests/core/test_lightning_module.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready PRs ready to be merged label May 10, 2022
@mergify mergify bot removed the ready PRs ready to be merged label May 12, 2022
rohitgr7 added a commit to tanmoyio/lightning that referenced this pull request May 12, 2022
rohitgr7 added a commit to tanmoyio/lightning that referenced this pull request May 12, 2022
@rohitgr7 rohitgr7 force-pushed the lightningmodule/10499_lightning_to_module branch from 0093ba3 to 75a7c58 Compare May 12, 2022 11:31
rohitgr7 added a commit to tanmoyio/lightning that referenced this pull request May 12, 2022
rohitgr7 added a commit to tanmoyio/lightning that referenced this pull request May 12, 2022
@rohitgr7 rohitgr7 force-pushed the lightningmodule/10499_lightning_to_module branch from 75a7c58 to c9dd894 Compare May 12, 2022 11:33
@rohitgr7 rohitgr7 enabled auto-merge (rebase) May 12, 2022 11:34
@mergify mergify bot added ready PRs ready to be merged has conflicts and removed has conflicts ready PRs ready to be merged labels May 12, 2022
@carmocca carmocca force-pushed the lightningmodule/10499_lightning_to_module branch from c9dd894 to ae0dbaf Compare May 13, 2022 16:04
@mergify mergify bot added ready PRs ready to be merged and removed has conflicts ready PRs ready to be merged labels May 13, 2022
@awaelchli
Copy link
Contributor

Gatekeeper merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Includes a breaking change community This PR is from the community lightningmodule pl.LightningModule ready PRs ready to be merged refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update core/lightning.py to core/lightning_module.py
8 participants