-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
make gpus=str in Trainer consistent with command line parsing of string #6388
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6388 +/- ##
======================================
- Coverage 91% 91% -0%
======================================
Files 200 200
Lines 12896 12985 +89
======================================
+ Hits 11746 11799 +53
- Misses 1150 1186 +36 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong feelings for either a) or b). But if you choose b), you could leave all this logic for the future behaviour implemented already by checking the current lightning version. Just in case we forget about this.
Then when 1.5 comes we just have to remove the old code instead of resolving TODOs
I really think we should avoid breaking changes, esp when this is unexpected. |
@edenlightning so you want me to close this PR? this would mean we keep the current behavior, nothing changes, and also close the linked issue. |
@awaelchli still draft? |
@Borda it's 95% done, just waiting for a go/no-go decision here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Kaushik B <[email protected]>
@awaelchli I see you modified the milestone here. Note that if this goes into 1.4 you'll have to update the deprecation warnings |
Yes this got pushed back so I'll pick it up after 1.3. Thanks. |
Hello @awaelchli! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-05-04 09:03:46 UTC |
.. warning:: | ||
The behavior for :code:`gpus="3"` (str) will change. Currently it selects the GPU with index 3, but will | ||
select the first 3 GPUs from v1.5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we announcing a change in 2 versions ahead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you saying one version is enough? I followed deprecation guideline of two versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am for it. BC should be prevented when possible, unless it is to correct a behaviour.
from tests.helpers import BoringModel | ||
from tests.helpers.datamodules import ClassifDataModule | ||
from tests.helpers.imports import Batch, Dataset, Example, Field, LabelField | ||
from tests.helpers.runif import RunIf | ||
from tests.helpers.simple_models import ClassificationModel | ||
|
||
PL_VERSION_LT_1_5 = _compare_version("pytorch_lightning", operator.lt, "1.5") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice !
What does this PR do?
Fixes #6228
Closes #7236
Current behavior:
Desired behavior:
This change makes the string type parsing for the gpus flag consistent with how the command line arguments are parsed.
**This PR announces the change today (from 1.3), the changes will take effect in 1.5 (breaking change). **
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃