Skip to content

Commit 257ea1e

Browse files
authored
Merge branch 'master' into master
2 parents 5e51680 + 3945dd8 commit 257ea1e

File tree

120 files changed

+7171
-1664
lines changed

Some content is hidden

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

120 files changed

+7171
-1664
lines changed

.circleci/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ pytorch_tutorial_build_defaults: &pytorch_tutorial_build_defaults
116116
export AWS_ACCESS_KEY_ID=${CIRCLECI_AWS_ACCESS_KEY_FOR_ECR_READ_ONLY}
117117
export AWS_SECRET_ACCESS_KEY=${CIRCLECI_AWS_SECRET_KEY_FOR_ECR_READ_ONLY}
118118
eval $(aws ecr get-login --region us-east-1 --no-include-email)
119+
- restore_cache:
120+
key: v1.0-tutorial-{{ .Environment.CIRCLE_JOB }}
119121
- run:
120122
name: Build
121123
no_output_timeout: "20h"
@@ -164,11 +166,35 @@ pytorch_tutorial_build_defaults: &pytorch_tutorial_build_defaults
164166
fi
165167
set -x
166168
169+
# This also copies the cached build to docker.
167170
docker cp /home/circleci/project/. "$id:/var/lib/jenkins/workspace"
168171
169172
export COMMAND='((echo "source ./workspace/env" && echo "sudo chown -R jenkins workspace && cd workspace && ./ci_build_script.sh") | docker exec -u jenkins -i "$id" bash) 2>&1'
170173
echo ${COMMAND} > ./command.sh && unbuffer bash ./command.sh | ts
171174
175+
# Copy the last build from docker
176+
docker cp "$id:/var/lib/jenkins/workspace/_build" /home/circleci/project
177+
docker cp "$id:/var/lib/jenkins/workspace/docs" /home/circleci/project
178+
docker cp "$id:/var/lib/jenkins/workspace/advanced" /home/circleci/project
179+
docker cp "$id:/var/lib/jenkins/workspace/beginner" /home/circleci/project
180+
docker cp "$id:/var/lib/jenkins/workspace/intermediate" /home/circleci/project
181+
docker cp "$id:/var/lib/jenkins/workspace/prototype" /home/circleci/project
182+
docker cp "$id:/var/lib/jenkins/workspace/recipes" /home/circleci/project
183+
docker cp "$id:/var/lib/jenkins/workspace/src" /home/circleci/project
184+
185+
- save_cache:
186+
# Save to cache for incremental build
187+
key: v1.0-tutorial-{{ .Environment.CIRCLE_JOB }}
188+
paths:
189+
- /home/circleci/project/_build
190+
- /home/circleci/project/docs
191+
- /home/circleci/project/advanced
192+
- /home/circleci/project/beginner
193+
- /home/circleci/project/intermediate
194+
- /home/circleci/project/prototype
195+
- /home/circleci/project/recipes
196+
- /home/circleci/project/src
197+
172198
pytorch_tutorial_build_worker_defaults: &pytorch_tutorial_build_worker_defaults
173199
environment:
174200
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7"

.circleci/scripts/build_for_windows.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ REQUIREMENTS="$(grep -v '^ *#\|^torch\|^torchaudio\|^torchvision|^torchtext' $PR
3535
echo $REQUIREMENTS > requirements.txt
3636
pip install -r requirements.txt
3737
pip install pySoundFile
38-
conda install -yq -c pytorch "cudatoolkit=10.1" pytorch torchvision torchtext
39-
conda install torchaudio -c pytorch-test
38+
# Force uninstall torch & related packages, we'll install them using conda later.
39+
pip uninstall -y torch torchvision torchtext
40+
conda install -yq -c pytorch "cudatoolkit=10.1" pytorch torchvision torchtext torchaudio
4041
python -m spacy download de
4142
python -m spacy download en
4243
pushd ${PROJECT_DIR}
@@ -47,6 +48,11 @@ if [[ "${CIRCLE_JOB}" == *worker_* ]]; then
4748
python $DIR/remove_runnable_code.py intermediate_source/model_parallel_tutorial.py intermediate_source/model_parallel_tutorial.py || true
4849
python $DIR/remove_runnable_code.py advanced_source/static_quantization_tutorial.py advanced_source/static_quantization_tutorial.py || true
4950
python $DIR/remove_runnable_code.py beginner_source/hyperparameter_tuning_tutorial.py beginner_source/hyperparameter_tuning_tutorial.py || true
51+
python $DIR/remove_runnable_code.py beginner_source/audio_preprocessing_tutorial.py beginner_source/audio_preprocessing_tutorial.py || true
52+
python $DIR/remove_runnable_code.py beginner_source/dcgan_faces_tutorial.py beginner_source/dcgan_faces_tutorial.py || true
53+
python $DIR/remove_runnable_code.py intermediate_source/tensorboard_profiler_tutorial.py intermediate_source/tensorboard_profiler_tutorial.py || true
54+
# Temp remove for mnist download issue. (Re-enabled for 1.8.1)
55+
# python $DIR/remove_runnable_code.py beginner_source/fgsm_tutorial.py beginner_source/fgsm_tutorial.py || true
5056

5157
export WORKER_ID=$(echo "${CIRCLE_JOB}" | tr -dc '0-9')
5258
count=0

.devcontainer/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ipython
2424
# to run examples
2525
pandas
2626
scikit-image
27-
pillow==8.1.0
27+
pillow==8.1.1
2828
wget
2929

3030
# for codespaces env

.jenkins/build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ pip install -r $DIR/../requirements.txt
2222
# export PATH=/opt/conda/bin:$PATH
2323
# pip install sphinx==1.8.2 pandas
2424

25+
#Install PyTorch Nightly for test.
26+
# Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
27+
# RC Link
28+
# pip uninstall -y torch torchvision torchaudio torchtext
29+
# pip install -f https://download.pytorch.org/whl/test/cu102/torch_test.html torch torchvision torchaudio torchtext
30+
2531
# For Tensorboard. Until 1.14 moves to the release channel.
2632
pip install tb-nightly
2733

@@ -41,6 +47,11 @@ export NUM_WORKERS=20
4147
if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
4248
# Step 1: Remove runnable code from tutorials that are not supposed to be run
4349
python $DIR/remove_runnable_code.py beginner_source/aws_distributed_training_tutorial.py beginner_source/aws_distributed_training_tutorial.py || true
50+
# python $DIR/remove_runnable_code.py advanced_source/ddp_pipeline_tutorial.py advanced_source/ddp_pipeline_tutorial.py || true
51+
# Temp remove for mnist download issue. (Re-enabled for 1.8.1)
52+
# python $DIR/remove_runnable_code.py beginner_source/fgsm_tutorial.py beginner_source/fgsm_tutorial.py || true
53+
# python $DIR/remove_runnable_code.py intermediate_source/spatial_transformer_tutorial.py intermediate_source/spatial_transformer_tutorial.py || true
54+
4455
# TODO: Fix bugs in these tutorials to make them runnable again
4556
# python $DIR/remove_runnable_code.py beginner_source/audio_classifier_tutorial.py beginner_source/audio_classifier_tutorial.py || true
4657

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <[email protected]>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing to tutorials
2+
We want to make contributing to this project as easy and transparent as
3+
possible.
4+
5+
## Pull Requests
6+
We actively welcome your pull requests.
7+
8+
1. Fork the repo and create your branch from `master`.
9+
2. If you've added code that should be tested, add tests.
10+
3. If you've changed APIs, update the documentation.
11+
4. Ensure the test suite passes.
12+
5. Make sure your code lints.
13+
6. If you haven't already, complete the Contributor License Agreement ("CLA").
14+
15+
## Contributor License Agreement ("CLA")
16+
In order to accept your pull request, we need you to submit a CLA. You only need
17+
to do this once to work on any of Facebook's open source projects.
18+
19+
Complete your CLA here: <https://code.facebook.com/cla>
20+
21+
## Issues
22+
We use GitHub issues to track public bugs. Please ensure your description is
23+
clear and has sufficient instructions to be able to reproduce the issue.
24+
25+
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
26+
disclosure of security bugs. In those cases, please go through the process
27+
outlined on that page and do not file a public issue.
28+
29+
## License
30+
By contributing to tutorials, you agree that your contributions will be licensed
31+
under the LICENSE file in the root directory of this source tree.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ In case you prefer to write your tutorial in jupyter, you can use [this script](
2828
- Then you can build using `make docs`. This will download the data, execute the tutorials and build the documentation to `docs/` directory. This will take about 60-120 min for systems with GPUs. If you do not have a GPU installed on your system, then see next step.
2929
- You can skip the computationally intensive graph generation by running `make html-noplot` to build basic html documentation to `_build/html`. This way, you can quickly preview your tutorial.
3030

31-
> If you get **ModuleNotFoundError: No module named 'pytorch_sphinx_theme' make: *** [html-noplot] Error 2**, from /tutorials/src/pytorch-sphinx-theme run `python setup.py install`.
31+
> If you get **ModuleNotFoundError: No module named 'pytorch_sphinx_theme' make: *** [html-noplot] Error 2** from /tutorials/src/pytorch-sphinx-theme or /venv/src/pytorch-sphinx-theme (while using virtualenv), run `python setup.py install`.
3232
3333

3434
## About contributing to PyTorch Documentation and Tutorials
3535
* You can find information about contributing to PyTorch documentation in the
3636
PyTorch Repo [README.md](https://github.com/pytorch/pytorch/blob/master/README.md) file.
37-
* Additional information can be found in [PyTorch CONTRIBUTING.md](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md).
38-
37+
* Additional information can be found in [PyTorch CONTRIBUTING.md](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md).

_static/images/microsoft-logo.svg

Lines changed: 80 additions & 0 deletions
Loading

_static/img/profiler_overview1.png

133 KB
Loading

_static/img/profiler_overview2.png

77.3 KB
Loading

0 commit comments

Comments
 (0)