Skip to content

Conversation

@rohitgr7
Copy link
Contributor

@rohitgr7 rohitgr7 commented Mar 28, 2022

What does this PR do?

Fixes #<issue_number>

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

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 internal minor changes/refactorings)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read 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 🙃

cc @tchaton @rohitgr7 @akihironitta @justusschock @kaushikb11 @awaelchli @Borda @ananthsub @ninginthecloud @jjenniferdai

@mergify mergify bot added the ready PRs ready to be merged label Mar 28, 2022
@rohitgr7 rohitgr7 enabled auto-merge (squash) March 28, 2022 14:46
@rohitgr7 rohitgr7 disabled auto-merge March 28, 2022 15:00
- Deprecated `Trainer.num_gpus` in favor of `Trainer.num_devices` when GPU is used ([#12384](https://github.com/PyTorchLightning/pytorch-lightning/pull/12384))


- Deprecated `Trainer.ipus` in favor of `Trainer.num_devices` when IPU is used ([#12386](https://github.com/PyTorchLightning/pytorch-lightning/pull/12386))
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we reverting this? Could you please add some details to the description?

Copy link
Contributor

@awaelchli awaelchli Mar 28, 2022

Choose a reason for hiding this comment

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

@rohitgr7 In our brief discussion earlier with Will and team we were just talking about the trainer arguments. The properties can be deprecated more freely as the impact and number of code changes on the user side is rare and small. So I don't think this PR is necessary.

Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

I don't think these should be un-deprecated.

The deprecation concerns only the Trainer's properties but does not touch the __init__'s arguments of the same name.

The suggestion of using num_devices is natural, especially after the accelerator connector rewrite.

@mergify mergify bot removed the ready PRs ready to be merged label Mar 28, 2022
@awaelchli
Copy link
Contributor

awaelchli commented Mar 28, 2022

If we could just revert this addition here, then that should be all I think. Couldn't find any others. We can simply resume efforts on #11040 after the release 😃

edit: done in #12495 (comment)

@kaushikb11
Copy link
Contributor

kaushikb11 commented Mar 28, 2022

The deprecation of the Trainer properties was also a natural progression toward deprecating the Trainer flags. As we are moving towards the accelerator agnostic attributes for the users.

IMO, if we are not deprecating Trainer(gpus=x) in this release and extending it to the next major release, we should do the same for Trainer.gpus, etc. Users wouldn't understand the reason why we are deprecating gpus, tpu_cores, etc and moving towards num_devices unless they are enforced to use the devices=x logic.

@DuYicong515
Copy link
Contributor

DuYicong515 commented Mar 28, 2022

Users wouldn't understand the reason why we are deprecating gpus, tpu_cores, etc and moving towards num_devices unless they are enforced to use the devices=x logic.

Currently, tpu_cores, num_processes, ipus return number of devices, and gpus return the trainer argument of gpus/devices or what's decided by auto etc. I feel it's a bit confusing when the properties have the same name with the arguments, but return values are different from the argument, and are not consistent across the 4 properties.

I think suggesting user to use device agnostic properties to access their device count or ids is natural even we don't deprecate the arguments. The suggested properties are more general and have clear expectations on the return values from their names. In addition, if we decide they'll be removed eventually, I feel it's better to add deprecation message and prepare people early.

@daniellepintz
Copy link
Contributor

Why not just do the deprecation of the constructor arguments in this release as well? #11040 is ready to go

@Borda Borda added the priority: 1 Medium priority task label Mar 28, 2022
@carmocca
Copy link
Contributor

We are not comfortable doing this very impactful change for the community one day away from the release.

@carmocca carmocca mentioned this pull request Mar 29, 2022
12 tasks
@rohitgr7 rohitgr7 closed this Mar 29, 2022
@rohitgr7 rohitgr7 deleted the rev/device_flags branch March 29, 2022 08:00
@awaelchli
Copy link
Contributor

I'm closing this, as 1.6 has now been released. Happy deleting code everybody!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants