Skip to content

Commit ef26e61

Browse files
authored
Merge branch 'main' into jingxu10/torch_113522
2 parents da7088d + 630c2e2 commit ef26e61

File tree

161 files changed

+4019
-2186
lines changed

Some content is hidden

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

161 files changed

+4019
-2186
lines changed

.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==10.0.1
27+
pillow==10.2.0
2828
wget
2929

3030
# for codespaces env

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ beginner
33
intermediate
44
advanced
55
pytorch_basics
6-
recipes
6+
/recipes
77
prototype
88

99
#data things

.jenkins/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pip install --progress-bar off -r $DIR/../requirements.txt
2424

2525
#Install PyTorch Nightly for test.
2626
# Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
27-
# Install 2.1 for testing
27+
# Install 2.2 for testing - uncomment to install nightly binaries (update the version as needed).
2828
# pip uninstall -y torch torchvision torchaudio torchtext torchdata
29-
# pip3 install torch torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu121
29+
# pip3 install torch==2.2.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu121
3030
# pip3 install torchdata torchtext --index-url https://download.pytorch.org/whl/test/cpu
3131

3232
# Install two language tokenizers for Translation with TorchText tutorial
@@ -57,6 +57,8 @@ if [[ "${JOB_TYPE}" == "worker" ]]; then
5757
# IMPORTANT NOTE: We assume that each tutorial has a UNIQUE filename.
5858
FILES_TO_RUN=$(python .jenkins/get_files_to_run.py)
5959
echo "FILES_TO_RUN: " ${FILES_TO_RUN}
60+
# Files to run must be accessible to subprocessed (at least to `download_data.py`)
61+
export FILES_TO_RUN
6062

6163
# Step 3: Run `make docs` to generate HTML files and static files for these tutorials
6264
make docs

.jenkins/download_data.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ def download_lenet_mnist() -> None:
105105
sha256="cb5f8e578aef96d5c1a2cc5695e1aa9bbf4d0fe00d25760eeebaaac6ebc2edcb",
106106
)
107107

108+
def download_gpu_quantization_torchao() -> None:
109+
# Download SAM model checkpoint for prototype_source/gpu_quantization_torchao_tutorial.py
110+
download_url_to_file("https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth",
111+
prefix=PROTOTYPE_DATA_DIR,
112+
dst="sam_vit_h_4b8939.pth",
113+
sha256="a7bf3b02f3ebf1267aba913ff637d9a2d5c33d3173bb679e46d9f338c26f262e",
114+
)
108115

109116
def main() -> None:
110117
DATA_DIR.mkdir(exist_ok=True)
@@ -122,7 +129,8 @@ def main() -> None:
122129
download_dcgan_data()
123130
if FILES_TO_RUN is None or "fgsm_tutorial" in FILES_TO_RUN:
124131
download_lenet_mnist()
125-
132+
if FILES_TO_RUN is None or "gpu_quantization_torchao_tutorial" in FILES_TO_RUN:
133+
download_gpu_quantization_torchao()
126134

127135
if __name__ == "__main__":
128136
main()

.jenkins/metadata.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,21 @@
2828
"intermediate_source/model_parallel_tutorial.py": {
2929
"needs": "linux.16xlarge.nvidia.gpu"
3030
},
31+
"intermediate_source/torchvision_tutorial.py": {
32+
"needs": "linux.g5.4xlarge.nvidia.gpu",
33+
"_comment": "does not require a5g but needs to run before gpu_quantization_torchao_tutorial.py."
34+
},
35+
"advanced_source/coding_ddpg.py": {
36+
"needs": "linux.g5.4xlarge.nvidia.gpu",
37+
"_comment": "does not require a5g but needs to run before gpu_quantization_torchao_tutorial.py."
38+
},
3139
"intermediate_source/torch_compile_tutorial.py": {
3240
"needs": "linux.g5.4xlarge.nvidia.gpu"
3341
},
3442
"intermediate_source/scaled_dot_product_attention_tutorial.py": {
3543
"needs": "linux.g5.4xlarge.nvidia.gpu"
44+
},
45+
"prototype_source/gpu_quantization_torchao_tutorial.py": {
46+
"needs": "linux.g5.4xlarge.nvidia.gpu"
3647
}
3748
}

.jenkins/validate_tutorials_built.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"beginner_source/examples_autograd/polynomial_autograd",
2424
"beginner_source/examples_autograd/polynomial_custom_function",
2525
"beginner_source/t5_tutorial", # re-enable after this is fixed: https://github.com/pytorch/text/issues/1756
26-
"intermediate_source/parametrizations",
2726
"intermediate_source/mnist_train_nas", # used by ax_multiobjective_nas_tutorial.py
2827
"intermediate_source/fx_conv_bn_fuser",
2928
"intermediate_source/_torch_export_nightly_tutorial", # does not work on release

.pyspelling.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ matrix:
4545
- open: '\.\. (code-block|math)::.*$\n*'
4646
content: '(?P<first>(^(?P<indent>[ ]+).*$\n))(?P<other>(^([ \t]+.*|[ \t]*)$\n)*)'
4747
close: '(^(?![ \t]+.*$))'
48+
# Ignore references like "[1] Author: Title"
49+
- open: '\[\d\]'
50+
close: '\n'
4851
- pyspelling.filters.markdown:
4952
- pyspelling.filters.html:
5053
ignores:
@@ -97,7 +100,7 @@ matrix:
97100
content: '''''*'
98101
close: '$'
99102
# Ignore reStructuredText block directives
100-
- open: '\.\. (code-block|math)::.*$\n*'
103+
- open: '\.\. (code-block|math|table)::.*$\n*'
101104
content: '(?P<first>(^(?P<indent>[ ]+).*$\n))(?P<other>(^([ \t]+.*|[ \t]*)$\n)*)'
102105
close: '(^(?![ \t]+.*$))'
103106
- open: '\.\. (raw)::.*$\n*'

CONTRIBUTING.md

Lines changed: 17 additions & 19 deletions

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ download:
8686
wget -nv -N https://www.manythings.org/anki/deu-eng.zip -P $(DATADIR)
8787
unzip -o $(DATADIR)/deu-eng.zip -d beginner_source/data/
8888

89+
# Download PennFudanPed dataset for intermediate_source/torchvision_tutorial.py
90+
wget https://www.cis.upenn.edu/~jshi/ped_html/PennFudanPed.zip -P $(DATADIR)
91+
unzip -o $(DATADIR)/PennFudanPed.zip -d intermediate_source/data/
8992

9093
docs:
9194
make download
@@ -103,3 +106,5 @@ html-noplot:
103106
clean-cache:
104107
make clean
105108
rm -rf advanced beginner intermediate recipes
109+
# remove additional python files downloaded for torchvision_tutorial.py
110+
rm -rf intermediate_source/engine.py intermediate_source/utils.py intermediate_source/transforms.py intermediate_source/coco_eval.py intermediate_source/coco_utils.py

README.md

Lines changed: 9 additions & 3 deletions

0 commit comments

Comments
 (0)