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

[RFC] Future structure #13265

Closed
wants to merge 20 commits into from
Closed

[RFC] Future structure #13265

wants to merge 20 commits into from

Conversation

Borda
Copy link
Member

@Borda Borda commented Jun 10, 2022

What does this PR do?

it is just PoC, and it follows the latest PyPA project structure - https://github.com/pypa/sampleproject
it is said that using src is better; it does not accidentally use modules that are not installed...

so with this new structure, we would have

examples/  # the actual pl_examples
src/
 L pytorch_lightning  # the actual package in root
test/
 |- legacy  # downloaded tests data from S3
 L  unittests  # actual folder with tests

NOTE:

  • there is no change in user experience while installing this repo from the source
  • there shall not be any breaking changes for ongoing/open PRs; if GitHub flags some collisions, they shall be quickly resolved in the command line with git rebase master as it uses here way resolver
  • this will be merged as rebase & merge for traceability and simple resolving potential conflicts

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 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 🙃

cc @carmocca @akihironitta @Borda @tchaton @justusschock @awaelchli

@Borda Borda added ci Continuous Integration let's do it! approved to implement design Includes a design discussion code quality labels Jun 10, 2022
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #13265 (f3f852c) into master (5e4b712) will decrease coverage by 1%.
The diff coverage is 85%.

@@           Coverage Diff            @@
##           master   #13265    +/-   ##
========================================
- Coverage      89%      87%    -1%     
========================================
  Files         217      221     +4     
  Lines       18322    19014   +692     
========================================
+ Hits        16282    16620   +338     
- Misses       2040     2394   +354     

@Borda Borda changed the title Future structure [RFC] Future structure Jun 10, 2022
@Borda Borda marked this pull request as ready for review June 10, 2022 15:46
@Borda Borda added this to the 1.7 milestone Jun 10, 2022
.azure-pipelines/gpu-benchmark.yml Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
@Borda Borda force-pushed the future/structure branch from 79eceaa to f3f852c Compare June 14, 2022 17:27
@mergify mergify bot removed the has conflicts label Jun 14, 2022
@@ -11,6 +11,7 @@ trigger:
include:
- "master"
- "release/*"
- "future/*"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be removed before merge, right?

Comment on lines +39 to +42
- bash: |
pip install -e . -r requirements/strategies.txt
pip list
displayName: 'Install package'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not necessary

@@ -86,8 +90,9 @@ jobs:
python -m coverage report
python -m coverage xml
python -m coverage html
python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure
python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,unittest --name="GPU-coverage" --env=linux,azure
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,unittest --name="GPU-coverage" --env=linux,azure
python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure

bash pl_examples/run_examples.sh --trainer.accelerator=gpu --trainer.devices=1
bash pl_examples/run_examples.sh --trainer.accelerator=gpu --trainer.devices=2 --trainer.strategy=ddp
bash pl_examples/run_examples.sh --trainer.accelerator=gpu --trainer.devices=2 --trainer.strategy=ddp --trainer.precision=16
bash run_ddp_examples.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep the test here with the other standalone tests

bash pl_examples/run_examples.sh --trainer.accelerator=gpu --trainer.devices=2 --trainer.strategy=ddp
bash pl_examples/run_examples.sh --trainer.accelerator=gpu --trainer.devices=2 --trainer.strategy=ddp --trainer.precision=16
bash run_ddp_examples.sh
bash run_pl_examples.sh --trainer.accelerator=gpu --trainer.devices=1
Copy link
Contributor

Choose a reason for hiding this comment

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

This script should be examples/pytorch/run_examples.sh

Comment on lines +58 to +60
pip install -e .
pip install --requirement requirements/devel.txt
pip install --requirement requirements/strategies.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pip install -e .
pip install --requirement requirements/devel.txt
pip install --requirement requirements/strategies.txt
pip install -e .[strategies]
pip install --requirement requirements/devel.txt

displayName: 'HPU precision test'

- bash: |
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
python "pl_examples/hpu_examples/simple_mnist/mnist.py"
python "pl_hpu/mnist_sample.py"
Copy link
Contributor

Choose a reason for hiding this comment

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

The structure here should be examples/pytorch/hpu

python -m coverage run --source pytorch_lightning -m pytest tests -vv --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
cd src
python -m pytest pytorch_lightning
displayName: 'DocTests'
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't add doctesting to these accelerator jobs as it complicates the pipeline for contributors

/docs/source/index.rst @williamfalcon
/docs/source/levels @williamfalcon @RobertLaurella
/docs/source/expertise_levels @williamfalcon @RobertLaurella
/docs/source-PL/conf.py @borda @awaelchli @carmocca
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this - separator instead of

docs/pytorch_lightning/source/...

@carmocca
Copy link
Contributor

@Borda is there anything left to do here? Can we close this?

@carmocca carmocca removed this from the pl:1.7 milestone Jul 19, 2022
@Borda
Copy link
Member Author

Borda commented Jul 19, 2022

@Borda is there anything left to do here? Can we close this?

shall be fine, but would like to check it, run some diff that it is minimal... 🐰

@stale
Copy link

stale bot commented Aug 12, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need further help see our docs: https://pytorch-lightning.readthedocs.io/en/latest/generated/CONTRIBUTING.html#pull-request or ask the assistance of a core contributor here or on Slack. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Aug 12, 2022
@carmocca carmocca closed this Aug 26, 2022
@carmocca carmocca deleted the future/structure branch August 26, 2022 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration code quality design Includes a design discussion has conflicts let's do it! approved to implement won't fix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants