Skip to content

Commit 90d9a0a

Browse files
authored
Merge branch 'master' into rich/default
2 parents e7b6379 + 60fe152 commit 90d9a0a

File tree

419 files changed

+20143
-14843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

419 files changed

+20143
-14843
lines changed

.azure-pipelines/gpu-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
lspci | egrep 'VGA|3D'
4444
whereis nvidia
4545
nvidia-smi
46+
which python && which pip
4647
python --version
4748
pip --version
4849
pip list
@@ -51,7 +52,8 @@ jobs:
5152
- bash: |
5253
python -c "fname = 'requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if 'horovod' not in line] ; open(fname, 'w').writelines(lines)"
5354
pip install fairscale==0.4.0
54-
pip install deepspeed==0.5.4
55+
pip install deepspeed==0.5.7
56+
pip install bagua-cuda102==0.9.0
5557
pip install . --requirement requirements/devel.txt
5658
pip list
5759
displayName: 'Install dependencies'

.circleci/config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ references:
3737
run:
3838
name: Make Documentation
3939
command: |
40-
# First run the same pipeline as Read-The-Docs
41-
# apt-get update && apt-get install -y cmake
42-
# using: https://hub.docker.com/r/readthedocs/build
43-
# we need to use py3.7 ot higher becase of an issue with metaclass inheritence
40+
# the image uses python 2.7 by default, force a different version
4441
pyenv global 3.7.3
4542
python --version
4643
pip install -r requirements/docs.txt
Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,65 @@
1-
# How to become a core contributor
1+
# How to Become a Core Contributor
22

33
Thanks for your interest in joining the Lightning team! We’re a rapidly growing project which is poised to become the go-to framework for DL researchers!
4-
We're currently recruiting for a team of 5 core maintainers.
54

6-
As a core maintainer you will have a strong say in the direction of the project. Big changes will require a majority of maintainers to agree.
5+
As a core maintainer, you will have a strong say in the direction of the project. Big changes will require a majority of maintainers to agree.
6+
Our development is fully open, so you can still raise your voice just by commenting on issues and pull requests! Doing so is a big step in becoming part of core.
77

8-
## Code of conduct
8+
## Code of Conduct
99

10-
First and foremost, you'll be evaluated against [these core values](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/.github/CONTRIBUTING.md). Any code we commit or feature we add needs to align with those core values.
10+
First and foremost, you'll be evaluated against [these core values](CONTRIBUTING.md). Any code we commit or feature we add needs to align with those core values.
11+
Any collaboration and communication must adhere to our [code of conduct](CODE_OF_CONDUCT.md).
1112

12-
## The bar for joining the team
13+
## The Bar for Joining the Team
1314

1415
Lightning is being used to solve really hard problems at the top AI labs in the world. As such, the bar for adding team members is extremely high. Candidates must have solid engineering skills, have a good eye for user experience, and must be a power user of Lightning and PyTorch.
1516

1617
With that said, the Lightning team will be diverse and a reflection of an inclusive AI community. You don't have to be an engineer to contribute! Scientists with great usability intuition and PyTorch ninja skills are welcomed!
1718

1819
## Responsibilities:
1920

20-
The responsibilities mainly revolve around 3 things.
21+
Here, we describe general expectations from core contributors:
2122

22-
### Github issues
23+
### Github Issues
2324

24-
- Here we want to help users have an amazing experience. These range from questions from new people getting into DL to questions from researchers about doing something esoteric with Lightning
25-
Often, these issues require some sort of bug fix, document clarification or new functionality to be scoped out.
25+
- Our community is the main motivation for our work. Help them have an amazing experience. Issues range from answering questions from new people getting into deep learning to helping researchers doing something esoteric.
26+
They often require some sort of bug fix, document clarification, or new functionality to be scoped out. You can help them solve their issues and guide them to completion.
2627

27-
- To become a core member you must resolve at least 10 Github issues which align with the API design goals for Lightning. By the end of these 10 issues I should feel comfortable in the way you answer user questions
28-
Pleasant/helpful tone.
28+
- Weigh in on discussions in a timely fashion. Most importantly, on the RFCs (request for comments) that will shape the future of Lightning.
29+
There are some big decisions which the project must make. For these, we expect core contributors to have something meaningful to add, especially if it’s their area of expertise.
2930

30-
- Can abstract from that issue or bug into functionality that might solve other related issues or makes the platform more flexible.
31+
- Propose your own RFCs that align with the API design goals for Lightning.
32+
33+
- Identify opportunities from an issue or bug that can solve other related issues or make the framework more flexible.
3134

3235
- Don’t make users feel like they don’t know what they’re doing. We’re here to help and to make everyone’s experience delightful.
3336

34-
### Pull requests
37+
- Help out with critical bugs. Nobody likes bugs so you'll be a hero if you fix them!
38+
39+
### Pull Requests (PRs)
3540

36-
- Here we need to ensure the code that enters Lightning is high quality. For each PR we need to:
37-
- Make sure code coverage does not decrease
38-
- Documents are updated
39-
- Code is elegant and simple
40-
- Code is NOT overly engineered or hard to read
41-
- Ask yourself, could a non-engineer understand what’s happening here?
42-
- Make sure new tests are written
43-
- Is this NECESSARY for Lightning? There are some PRs which are just purely about adding engineering complexity which have no place in Lightning.
44-
Guidance
45-
- Some other PRs are for people who are wanting to get involved and add something unnecessary. We do want their help though! So don’t approve the PR, but direct them to a Github issue that they might be interested in helping with instead!
46-
- To be considered for core contributor, please review 10 PRs and help the authors land it on master. Once you've finished the review, ping me
47-
for a sanity check. At the end of 10 PRs if your PR reviews are inline with expectations described above, then you can merge PRs on your own going forward,
48-
otherwise we'll do a few more until we're both comfortable :)
41+
- Pull requests are the evolutionary mechanism of Lightning, so quality is extremely important. Make sure contributors adhere to the guidelines described in the [contributing section](CONTRIBUTING.md#Pull-request).
4942

50-
### Project directions
43+
- Some PRs are from people who want to get involved and try to add something unnecessary. We do want their help though! So don’t approve the PR, but direct them to a Github issue that they might be interested in helping with instead!
5144

52-
There are some big decisions which the project must make. For these I expect core contributors to have something meaningful to add if it’s their area of expertise.
45+
- Provide strong and valuable feedback during reviews. This is expected both when reviewing community PRs as well as PRs from other core contributors.
46+
Even if you are not part of core yet, you can still review and approve PRs. This will show us your abilities.
5347

5448
### Diversity
5549

56-
Lightning should reflect the broader community it serves. As such we should have scientists/researchers from
57-
different fields contributing!
50+
Lightning should reflect the broader community it serves. As such we should have scientists/researchers from different fields contributing!
51+
52+
### Community
5853

59-
The first 5 core contributors will fit this profile. Thus if you overlap strongly with experiences and expertise as someone else on the team, you might have to wait until the next set of contributors are added.
54+
We have an active [Slack](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-pw5v393p-qRaDgEk24~EjiZNBpSQFgQ) community, where questions are asked daily.
55+
This is a great way to show off your Lightning and PyTorch knowledge, and help out others.
56+
There's also [GitHub discussions](https://github.com/PyTorchLightning/pytorch-lightning/discussions).
6057

61-
### Summary: Requirements to apply
58+
## Applying
6259

63-
The goal is to be inline with expectations for solving issues by the last one so you can do them on your own. If not, I might ask you to solve a few more specific ones.
60+
There are no precise targets for becoming a core contributor. In the past, community members have become core after fitting the previous expectations consistently.
61+
We are on the lookout for new people to join, however, if you feel like you meet the expectations already and we haven't reached out to you yet, feel free to ping us privately on [Slack](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-pw5v393p-qRaDgEk24~EjiZNBpSQFgQ)!.
6462

65-
- Solve 10+ Github issues.
66-
- Create 5+ meaningful PRs which solves some reported issue - bug,
67-
- Perform 10+ PR reviews from other contributors.
63+
## Employment
6864

69-
If you want to be considered, ping me on [Slack](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-pw5v393p-qRaDgEk24~EjiZNBpSQFgQ).
65+
You can also become a [Grid.ai](https://www.grid.ai) employee or intern and work on Lightning. To get started, you can email `[email protected]` with your resume or check out our [open job postings](https://boards.greenhouse.io/gridai).

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
/pytorch_lightning/plugins @tchaton @SeanNaren @awaelchli @justusschock
3333
/pytorch_lightning/profiler @williamfalcon @tchaton @borda @carmocca
3434
/pytorch_lightning/profiler/pytorch.py @nbcsm @guotuofeng
35+
/pytorch_lightning/strategies @tchaton @SeanNaren @awaelchli @justusschock @kaushikb11
3536
/pytorch_lightning/trainer @williamfalcon @borda @tchaton @SeanNaren @carmocca @awaelchli @justusschock @kaushikb11
3637
/pytorch_lightning/trainer/connectors @tchaton @SeanNaren @carmocca @borda
3738
/pytorch_lightning/tuner @SkafteNicki @borda @awaelchli
@@ -52,6 +53,7 @@
5253
/tests/helpers/boring_model.py @williamfalcon @tchaton @borda
5354

5455
/.github/CODEOWNERS @williamfalcon
56+
/SECURITY.md @williamfalcon
5557
/README.md @williamfalcon @edenlightning @borda
5658
/setup.py @williamfalcon @borda
5759
/pytorch_lightning/__about__.py @williamfalcon @borda

.github/CONTRIBUTING.md

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Contributing
22

3-
Welcome to the PyTorch Lightning community! We're building the most advanced research platform on the planet to implement the latest, best practices that the amazing PyTorch team rolls out!
3+
Welcome to the PyTorch Lightning community! We're building the most advanced research platform on the planet to implement the latest, best practices
4+
and integrations that the amazing PyTorch team and other research organization rolls out!
45

56
If you are new to open source, check out [this blog to get started with your first Open Source contribution](https://devblog.pytorchlightning.ai/quick-contribution-guide-86d977171b3a).
67

@@ -9,12 +10,12 @@ If you are new to open source, check out [this blog to get started with your fir
910
Simplify the API as much as possible from the user perspective.
1011
Any additions or improvements should minimize the things the user needs to remember.
1112

12-
For example: One benefit of the validation_step is that the user doesn't have to remember to set the model to .eval().
13+
For example: One benefit of the `validation_step` is that the user doesn't have to remember to set the model to .eval().
1314
This helps users avoid all sorts of subtle errors.
1415

1516
## Lightning Design Principles
1617

17-
We encourage all sorts of contributions you're interested in adding! When coding for lightning, please follow these principles.
18+
We encourage all sorts of contributions you're interested in adding! When coding for Lightning, please follow these principles.
1819

1920
### No PyTorch Interference
2021

@@ -102,7 +103,7 @@ _**Note**, even if you do not find the solution, sending a PR with a test coveri
102103

103104
Want to keep Lightning healthy? Love seeing those green tests? So do we! How to we keep it that way? We write tests! We value tests contribution even more than new features.
104105

105-
Most of the tests in PyTorch Lightning train a trial MNIST model under various trainer conditions (ddp, ddp2+amp, etc...). The tests expect the model to perform to a reasonable degree of testing accuracy to pass. Want to add a new test case and not sure how? [Talk to us!](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-pw5v393p-qRaDgEk24~EjiZNBpSQFgQ)
106+
Most of the tests in PyTorch Lightning train a random `BoringModel` under various trainer conditions (ddp, ddp2+amp, etc...). Want to add a new test case and not sure how? [Talk to us!](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-pw5v393p-qRaDgEk24~EjiZNBpSQFgQ)
106107

107108
______________________________________________________________________
108109

@@ -125,7 +126,7 @@ In case you adding new dependencies, make sure that they are compatible with the
125126
### Coding Style
126127

127128
1. Use f-strings for output formation (except logging when we stay with lazy `logging.info("Hello %s!", name)`.
128-
1. You can use `pre-commit` to make sure your code style is correct.
129+
1. You can use [pre-commit](https://pre-commit.com/) to make sure your code style is correct.
129130

130131
### Documentation
131132

@@ -134,7 +135,7 @@ Moreover, we set Google style to follow with type convention.
134135

135136
- [Napoleon formatting with Google style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
136137
- [ReStructured Text (reST)](https://docs.pylonsproject.org/projects/docs-style-guide/)
137-
- [Paragraph-level markup](https://www.sphinx-doc.org/en/1.5/markup/para.html)
138+
- [Paragraph-level markup](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#paragraphs)
138139

139140
See following short example of a sample function taking one position string and optional
140141

@@ -152,12 +153,14 @@ def my_func(param_a: int, param_b: Optional[float] = None) -> str:
152153
Return:
153154
sum of both numbers
154155
155-
Example:
156+
Example::
157+
156158
Sample doctest example...
157159
>>> my_func(1, 2)
158160
3
159161
160-
.. note:: If you want to add something.
162+
Note:
163+
If you want to add something.
161164
"""
162165
p = param_b if param_b else 0
163166
return str(param_a + p)
@@ -170,6 +173,7 @@ Run these commands
170173
```bash
171174
git submodule update --init --recursive
172175
pip install -r requirements/docs.txt
176+
make clean
173177
cd docs
174178
make html
175179
```
@@ -194,6 +198,7 @@ To setup a local development environment, install both local and test dependenci
194198
```bash
195199
python -m pip install ".[dev, examples]"
196200
python -m pip install pre-commit
201+
pre-commit install
197202
```
198203

199204
Additionally, for testing backward compatibility with older versions of PyTorch Lightning, you also need to download all saved version-checkpoints from the public AWS storage. Run the following script to get all saved version-checkpoints:
@@ -232,21 +237,42 @@ python -m pytest -v tests/trainer/test_trainer_cli.py::test_default_args
232237

233238
We welcome any useful contribution! For your convenience here's a recommended workflow:
234239

235-
0. Think about what you want to do - fix a bug, repair docs, etc. If you want to implement a new feature or enhance an existing one, start by opening a GitHub issue to explain the feature and the motivation. Members from core-contributors will take a look (it might take some time - we are often overloaded with issues!) and discuss it. Once an agreement was reached - start coding.
236-
1. Start your work locally (usually until you need our CI testing).
240+
1. Think about what you want to do - fix a bug, repair docs, etc. If you want to implement a new feature or enhance an existing one.
241+
242+
- Start by opening a GitHub issue to explain the feature and the motivation.
243+
In the case of features, ask yourself first - Is this NECESSARY for Lightning? There are some PRs that are just
244+
purely about adding engineering complexity which has no place in Lightning.
245+
- Core contributors will take a look (it might take some time - we are often overloaded with issues!) and discuss it.
246+
- Once an agreement was reached - start coding.
247+
248+
1. Start your work locally.
249+
237250
- Create a branch and prepare your changes.
238-
- Tip: do not work with your master directly, it may become complicated when you need to rebase.
251+
- Tip: do not work on your master branch directly, it may become complicated when you need to rebase.
239252
- Tip: give your PR a good name! It will be useful later when you may work on multiple tasks/PRs.
253+
240254
1. Test your code!
255+
241256
- It is always good practice to start coding by creating a test case, verifying it breaks with current behaviour, and passes with your new changes.
242257
- Make sure your new tests cover all different edge cases.
243-
- Make sure all exceptions are handled.
244-
1. Create a "Draft PR" which is clearly marked, to let us know you don't need feedback yet.
258+
- Make sure all exceptions raised are tested.
259+
- Make sure all warnings raised are tested.
260+
261+
1. If your PR is not ready for reviews, but you want to run it on our CI, open a "Draft PR" to let us know you don't need feedback yet.
262+
245263
1. When you feel ready for integrating your work, mark your PR "Ready for review".
264+
246265
- Your code should be readable and follow the project's design principles.
247-
- Make sure all tests are passing.
248-
- Make sure you add a GitHub issue to your PR.
249-
1. Use tags in PR name for following cases:
266+
- Make sure all tests are passing and any new code is tested for (coverage!).
267+
- Make sure you link the GitHub issue to your PR.
268+
- Make sure any docs for that piece of code are updated, or added.
269+
- The code should be elegant and simple. No over-engineering or hard-to-read code.
270+
271+
Do your best but don't sweat about perfection! We do code-review to find any missed items.
272+
If you need help, don't hesitate to ping the core team on the PR.
273+
274+
1. Use tags in PR name for the following cases:
275+
250276
- **\[blocked by #<number>\]** if your work is dependent on other PRs.
251277
- **\[wip\]** when you start to re-edit your work, mark it so no one will accidentally merge it in meantime.
252278

@@ -303,7 +329,7 @@ Here is the process to create a new test
303329
- 0. Optional: Follow tutorials !
304330
- 1. Find a file in tests/ which match what you want to test. If none, create one.
305331
- 2. Use this template to get started !
306-
- 3. Use `BoringModel and derivates to test out your code`.
332+
- 3. Use **BoringModel and derivates to test out your code**.
307333

308334
```python
309335
# TEST SHOULD BE IN YOUR FILE: tests/..../...py
@@ -335,7 +361,7 @@ def test_explain_what_is_being_tested(tmpdir):
335361
run our/your test with
336362

337363
```bash
338-
python -m pytest tests/..../...py::test_explain_what_is_being_tested --verbose --capture=no
364+
python -m pytest tests/..../...py::test_explain_what_is_being_tested -v --capture=no
339365
```
340366

341367
#### How to fix PR with mixed base and target branches?

.github/mergify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ pull_request_rules:
6666
actions:
6767
request_reviews:
6868
teams:
69-
- "@PyTorchLightning/core-contributors"
69+
- "@PyTorchLightning/core-lightning"

.github/set-min-requirements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"requirements.txt",
33
"requirements/extra.txt",
44
"requirements/loggers.txt",
5-
"requirements/test.txt",
65
"requirements/examples.txt",
6+
# "requirements/test.txt", # Don't use old testing packages
77
)
88

99

.github/workflows/ci_dockers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
1717
- ".github/workflows/events-nightly.yml"
1818
- "setup.py"
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
22+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
23+
2024
jobs:
2125
build-PL:
2226
runs-on: ubuntu-20.04

.github/workflows/ci_pkg-install.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
77
pull_request:
88
branches: [master, "release/*"]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
12+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
13+
1014
jobs:
1115

1216
install:
@@ -16,7 +20,7 @@ jobs:
1620
# max-parallel: 6
1721
matrix:
1822
os: [ubuntu-20.04, macOS-10.15, windows-2019]
19-
python-version: [3.6, 3.9]
23+
python-version: [3.7, 3.9]
2024

2125
steps:
2226
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)