Skip to content

Commit

Permalink
Merge branch 'main' into transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
svekars authored Oct 21, 2024
2 parents 6968ee6 + 4ed884d commit c28f568
Show file tree
Hide file tree
Showing 44 changed files with 2,306 additions and 2,208 deletions.
3 changes: 2 additions & 1 deletion .ci/docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ matplotlib
librosa
torch==2.4
torchvision
torchtext
torchdata
networkx
PyHamcrest
Expand Down Expand Up @@ -70,3 +69,5 @@ pycocotools
semilearn==0.3.2
torchao==0.5.0
segment_anything==1.0
torchrec==0.8.0
fbgemm-gpu==0.8.0
63 changes: 63 additions & 0 deletions .github/workflows/link_checkPR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#Checks links in a PR to ensure they are valid. If link is valid but failing, it can be added to the .lycheeignore file
#Code source: https://github.com/lycheeverse/lychee-action/issues/238

name: link check on PR

on:
pull_request:
branches: [main]

jobs:
check-links:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}

- name: Check out main branch
run: git checkout main

- name: Dump all links from main
id: dump_links_from_main
uses: lycheeverse/lychee-action@v1
with:
args: |
--dump
--include-fragments
.
output: ./links-main.txt

- name: Stash untracked files
run: git stash push --include-untracked

- name: Check out feature branch
run: git checkout ${{ github.head_ref }}

- name: Apply stashed changes
# Apply stashed changes, ignore errors if stash is empty
run: git stash pop || true

- name: Append links-main.txt to .lycheeignore
run: cat links-main.txt >> .lycheeignore

- name: Check links
uses: lycheeverse/lychee-action@v1
with:
args: |
--no-progress
--include-fragments
.
# Fail action on broken links
fail: true

- name: Suggestions
if: failure()
run: |
echo -e "\nPlease review the links reported in the Check links step above."
echo -e "If a link is valid but fails due to a CAPTCHA challenge, IP blocking, login requirements, etc.,
consider adding such links to .lycheeignore file to bypass future checks.\n"
exit 1
7 changes: 4 additions & 3 deletions .jenkins/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ sudo apt-get install -y pandoc

#Install PyTorch Nightly for test.
# Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
# Install 2.4 to merge all 2.4 PRs - uncomment to install nightly binaries (update the version as needed).
# pip uninstall -y torch torchvision torchaudio torchtext torchdata
# pip3 install torch==2.4.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
# Install 2.5 to merge all 2.4 PRs - uncomment to install nightly binaries (update the version as needed).
pip uninstall -y torch torchvision torchaudio torchtext torchdata
pip3 install torch==2.5.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
pip3 install fbgemm-gpu==1.0.0 torchrec==1.0.0 --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124

# Install two language tokenizers for Translation with TorchText tutorial
python -m spacy download en_core_web_sm
Expand Down
6 changes: 6 additions & 0 deletions .jenkins/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"intermediate_source/model_parallel_tutorial.py": {
"needs": "linux.16xlarge.nvidia.gpu"
},
"intermediate_source/torchrec_intro_tutorial.py": {
"needs": "linux.g5.4xlarge.nvidia.gpu"
},
"recipes_source/torch_export_aoti_python.py": {
"needs": "linux.g5.4xlarge.nvidia.gpu"
},
Expand Down Expand Up @@ -58,6 +61,9 @@
"recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py": {
"needs": "linux.g5.4xlarge.nvidia.gpu"
},
"recipes_source/regional_compilation.py": {
"needs": "linux.g5.4xlarge.nvidia.gpu"
},
"advanced_source/semi_structured_sparse.py": {
"needs": "linux.g5.4xlarge.nvidia.gpu"
},
Expand Down
4 changes: 0 additions & 4 deletions .jenkins/validate_tutorials_built.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
NOT_RUN = [
"beginner_source/basics/intro", # no code
"beginner_source/onnx/intro_onnx",
"beginner_source/translation_transformer",
"beginner_source/profiler",
"beginner_source/saving_loading_models",
"beginner_source/introyt/captumyt",
Expand All @@ -22,9 +21,6 @@
"beginner_source/former_torchies/tensor_tutorial_old",
"beginner_source/examples_autograd/polynomial_autograd",
"beginner_source/examples_autograd/polynomial_custom_function",
"beginner_source/torchtext_custom_dataset_tutorial", # not building with 2.3 RC, might be able to turn on with GA
"beginner_source/text_sentiment_ngrams_tutorial", # not building with 2.3 RC, might be able to turn on with GA
"beginner_source/t5_tutorial", # re-enable after this is fixed: https://github.com/pytorch/text/issues/1756
"intermediate_source/mnist_train_nas", # used by ax_multiobjective_nas_tutorial.py
"intermediate_source/fx_conv_bn_fuser",
"intermediate_source/_torch_export_nightly_tutorial", # does not work on release
Expand Down
2 changes: 2 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Used for links to be ignored during the link check.
# Add link to file along with comment as to why it should be ignored
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ download:
wget -nv -N http://dl.fbaipublicfiles.com/pythia/data/vocab.tar.gz -P $(DATADIR)
tar $(TAROPTS) -xzf $(DATADIR)/vocab.tar.gz -C ./beginner_source/data/

# Download dataset for beginner_source/torchtext_custom_dataset_tutorial.py
wget -nv -N https://www.manythings.org/anki/deu-eng.zip -P $(DATADIR)
unzip -o $(DATADIR)/deu-eng.zip -d beginner_source/data/

# Download PennFudanPed dataset for intermediate_source/torchvision_tutorial.py
wget https://www.cis.upenn.edu/~jshi/ped_html/PennFudanPed.zip -P $(DATADIR)
unzip -o $(DATADIR)/PennFudanPed.zip -d intermediate_source/data/
Expand Down
Binary file added _static/img/python_extension_autoload_impl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions beginner_source/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ Beginner Tutorials
5. nlp/* and deep_learning_nlp_tutorial.rst
Deep Learning for NLP with Pytorch
https://pytorch.org/tutorials/beginner/deep_learning_nlp_tutorial.html

6. transformer_translation.py
Language Translation with Transformers
https://pytorch.org/tutorials/beginner/translation_transformer.html
4 changes: 2 additions & 2 deletions beginner_source/basics/saveloadrun_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
########################
# We can then load the model as demonstrated below.
#
# As described in `Saving and loading torch.nn.Modules <pytorch.org/docs/main/notes/serialization.html#saving-and-loading-torch-nn-modules>`__,
# saving ``state_dict``s is considered the best practice. However,
# As described in `Saving and loading torch.nn.Modules <https://pytorch.org/docs/main/notes/serialization.html#saving-and-loading-torch-nn-modules>`_,
# saving ``state_dict`` is considered the best practice. However,
# below we use ``weights_only=False`` because this involves loading the
# model, which is a legacy use case for ``torch.save``.

Expand Down
Loading

0 comments on commit c28f568

Please sign in to comment.