Skip to content

Commit 2034add

Browse files
committed
Merge remote-tracking branch 'origin/main' into wwen/nightly-torch-export-redirect
2 parents bebf340 + ea9a5fc commit 2034add

File tree

100 files changed

+985
-6753
lines changed

Some content is hidden

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

100 files changed

+985
-6753
lines changed

.ci/docker/requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ tqdm==4.66.1
1414
numpy==1.24.4
1515
matplotlib
1616
librosa
17-
torch==2.4
17+
torch==2.5
1818
torchvision
19-
torchtext
2019
torchdata
2120
networkx
2221
PyHamcrest
@@ -70,5 +69,5 @@ pycocotools
7069
semilearn==0.3.2
7170
torchao==0.5.0
7271
segment_anything==1.0
73-
torchrec==0.8.0
74-
fbgemm-gpu==0.8.0
72+
torchrec==1.0.0; platform_system == "Linux"
73+
fbgemm-gpu==1.0.0; platform_system == "Linux"

.github/workflows/StalePRs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ jobs:
5757
const STALE_CLOSE_THRESHOLD_MS = 1000 * 60 * 60 * 24 * 30;
5858
5959
const STALE_MESSAGE =
60-
"Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as `Stale`. <br>" +
61-
"Feel free to remove the `Stale` label if you feel this was a mistake. <br>" +
62-
"If you are unable to remove the `Stale` label please contact a maintainer in order to do so. <br>" +
60+
"Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as `stale`. <br>" +
61+
"Feel free to remove the `stale` label if you feel this was a mistake. <br>" +
62+
"If you are unable to remove the `stale` label please contact a maintainer in order to do so. <br>" +
6363
"If you want the bot to never mark this PR stale again, add the `no-stale` label.<br>" +
64-
"`Stale` pull requests will automatically be closed after 30 days of inactivity.<br>";
64+
"`stale` pull requests will automatically be closed after 30 days of inactivity.<br>";
6565
6666
let numAPIRequests = 0;
6767
let numProcessed = 0;
@@ -79,7 +79,7 @@ jobs:
7979
8080
// Check if the PR is stale, according to our configured thresholds.
8181
let staleThresholdMillis;
82-
if (labels.includes("Stale")) {
82+
if (labels.includes("stale")) {
8383
core.info(`[${pull.number}] PR is labeled stale, checking whether we should close it.`);
8484
staleThresholdMillis = STALE_CLOSE_THRESHOLD_MS;
8585
} else {
@@ -97,7 +97,7 @@ jobs:
9797
9898
// At this point, we know we should do something.
9999
// For PRs already labeled stale, close them.
100-
if (labels.includes("Stale")) {
100+
if (labels.includes("stale")) {
101101
core.info(`[${pull.number}] Closing PR.`);
102102
numAPIRequests += 1;
103103
await github.rest.issues.update({
@@ -123,7 +123,7 @@ jobs:
123123
owner: "pytorch",
124124
repo: "tutorials",
125125
issue_number: pull.number,
126-
labels: ["Stale"],
126+
labels: ["stale"],
127127
});
128128
}
129129
}

.github/workflows/link_checkPR.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#Checks links in a PR to ensure they are valid. If link is valid but failing, it can be added to the .lycheeignore file
2+
#Use the skip-link-check label on a PR to skip checking links on a PR
3+
4+
name: link check on PR
5+
6+
on:
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
linkChecker:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 1
18+
19+
- name: Get Changed Files
20+
id: changed-files
21+
uses: tj-actions/changed-files@v41
22+
23+
- name: Check for Skip Label
24+
id: skip-label
25+
uses: actions/github-script@v6
26+
with:
27+
script: |
28+
const labels = await github.rest.issues.listLabelsOnIssue({
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
issue_number: context.issue.number
32+
});
33+
return labels.data.some(label => label.name === 'skip-link-check');
34+
35+
- name: Check Links
36+
if: steps.skip-label.outputs.result == 'false'
37+
uses: lycheeverse/lychee-action@v1
38+
with:
39+
args: --accept=200,403,429 --base . --verbose --no-progress ${{ steps.changed-files.outputs.all_changed_files }}
40+
token: ${{ secrets.CUSTOM_TOKEN }}
41+
fail: true
42+
43+
- name: Skip Message
44+
if: steps.skip-label.outputs.result == 'true'
45+
run: echo "Link check was skipped due to the presence of the 'skip-link-check' label."
46+
47+
- name: Suggestions
48+
if: failure()
49+
run: |
50+
echo -e "\nPlease review the links reported in the Check links step above."
51+
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"
52+
exit 1

.jenkins/build.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ sudo apt-get install -y pandoc
2222
#Install PyTorch Nightly for test.
2323
# Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
2424
# Install 2.5 to merge all 2.4 PRs - uncomment to install nightly binaries (update the version as needed).
25-
pip uninstall -y torch torchvision torchaudio torchtext torchdata
26-
pip3 install torch==2.5.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
27-
pip3 install fbgemm-gpu==1.0.0 torchrec==1.0.0 --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
25+
# pip uninstall -y torch torchvision torchaudio torchtext torchdata
26+
# pip3 install torch==2.5.0 torchvision torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/test/cu124
2827

2928
# Install two language tokenizers for Translation with TorchText tutorial
3029
python -m spacy download en_core_web_sm

.jenkins/validate_tutorials_built.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
NOT_RUN = [
1212
"beginner_source/basics/intro", # no code
13+
"beginner_source/introyt/introyt_index", # no code
1314
"beginner_source/onnx/intro_onnx",
14-
"beginner_source/translation_transformer",
1515
"beginner_source/profiler",
1616
"beginner_source/saving_loading_models",
1717
"beginner_source/introyt/captumyt",
@@ -22,9 +22,6 @@
2222
"beginner_source/former_torchies/tensor_tutorial_old",
2323
"beginner_source/examples_autograd/polynomial_autograd",
2424
"beginner_source/examples_autograd/polynomial_custom_function",
25-
"beginner_source/torchtext_custom_dataset_tutorial", # not building with 2.3 RC, might be able to turn on with GA
26-
"beginner_source/text_sentiment_ngrams_tutorial", # not building with 2.3 RC, might be able to turn on with GA
27-
"beginner_source/t5_tutorial", # re-enable after this is fixed: https://github.com/pytorch/text/issues/1756
2825
"intermediate_source/mnist_train_nas", # used by ax_multiobjective_nas_tutorial.py
2926
"intermediate_source/fx_conv_bn_fuser",
3027
"intermediate_source/_torch_export_nightly_tutorial", # does not work on release

.lycheeignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Used for links to be ignored during the link check.
2+
# Add link to file along with comment as to why it should be ignored
3+
4+
#Example link in some of the tutorials that should be ignored
5+
file:///f:/libtmp/some_file
6+
7+
#Ignore links with "file:///" to catch any other example links
8+
file:\/\/\/.*
9+
10+
# Ignore colab link in the setting of conf.py
11+
https://pytorch.org/tutorials/beginner/colab/n

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ download:
8282
wget -nv -N http://dl.fbaipublicfiles.com/pythia/data/vocab.tar.gz -P $(DATADIR)
8383
tar $(TAROPTS) -xzf $(DATADIR)/vocab.tar.gz -C ./beginner_source/data/
8484

85-
# Download dataset for beginner_source/torchtext_custom_dataset_tutorial.py
86-
wget -nv -N https://www.manythings.org/anki/deu-eng.zip -P $(DATADIR)
87-
unzip -o $(DATADIR)/deu-eng.zip -d beginner_source/data/
88-
8985
# Download PennFudanPed dataset for intermediate_source/torchvision_tutorial.py
9086
wget https://www.cis.upenn.edu/~jshi/ped_html/PennFudanPed.zip -P $(DATADIR)
9187
unzip -o $(DATADIR)/PennFudanPed.zip -d intermediate_source/data/

_static/css/custom2.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,21 @@
1717
margin-bottom: 5px;
1818
}
1919
}
20+
21+
/* Left nav for 2nd level nav */
22+
23+
.pytorch-left-menu li.toctree-l2 {
24+
padding-left: 10px;
25+
}
26+
27+
.pytorch-left-menu li.toctree-l2.current > a, {
28+
color: #ee4c2c;
29+
}
30+
31+
.pytorch-left-menu li.toctree-l2.current a:link.reference.internal {
32+
color: #ee4c2c;
33+
}
34+
35+
.pytorch-left-menu li.toctree-l1.current > a:before {
36+
content: "";
37+
}
Loading
Loading
Loading
Loading
93.3 KB
Loading
Loading

_static/img/trace_xpu_img.png

88.3 KB
Loading

_static/js/custom.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
document.addEventListener("DOMContentLoaded", function() {
2+
// Select all <li> elements with the class "toctree-l1"
3+
var toctreeItems = document.querySelectorAll('li.toctree-l1');
4+
5+
toctreeItems.forEach(function(item) {
6+
// Find the link within the item
7+
var link = item.querySelector('a');
8+
var nestedList = item.querySelector('ul');
9+
10+
if (link && nestedList) {
11+
// Create a span element for the "[+]" or "[-]" sign
12+
var expandSign = document.createElement('span');
13+
expandSign.style.cursor = 'pointer'; // Make it look clickable
14+
15+
// Use the link text as a unique key for localStorage
16+
var sectionKey = 'section_' + link.textContent.trim().replace(/\s+/g, '_');
17+
18+
// Retrieve the saved state from localStorage
19+
var isExpanded = localStorage.getItem(sectionKey);
20+
21+
// If no state is saved, default to expanded for "Learn the Basics" and collapsed for others
22+
if (isExpanded === null) {
23+
isExpanded = (link.textContent.trim() === 'Learn the Basics') ? 'true' : 'false';
24+
localStorage.setItem(sectionKey, isExpanded);
25+
}
26+
27+
if (isExpanded === 'true') {
28+
nestedList.style.display = 'block'; // Expand the section
29+
expandSign.textContent = '[-] '; // Show "[-]" since it's expanded
30+
} else {
31+
nestedList.style.display = 'none'; // Collapse the section
32+
expandSign.textContent = '[+] '; // Show "[+]" since it's collapsed
33+
}
34+
35+
// Add a click event to toggle the nested list
36+
expandSign.addEventListener('click', function() {
37+
if (nestedList.style.display === 'none') {
38+
nestedList.style.display = 'block';
39+
expandSign.textContent = '[-] '; // Change to "[-]" when expanded
40+
localStorage.setItem(sectionKey, 'true'); // Save state
41+
} else {
42+
nestedList.style.display = 'none';
43+
expandSign.textContent = '[+] '; // Change back to "[+]" when collapsed
44+
localStorage.setItem(sectionKey, 'false'); // Save state
45+
}
46+
});
47+
48+
// Insert the sign before the link
49+
link.parentNode.insertBefore(expandSign, link);
50+
}
51+
});
52+
});

_templates/layout.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
{% extends "!layout.html" %}
22

3+
4+
<!-- Overrides needed for the multilevel nav -->
5+
{% block menu %}
6+
{% if 'singlehtml' not in builder %}
7+
{% set global_toc = toctree(collapse=theme_collapse_navigation|tobool,
8+
includehidden=theme_includehidden|tobool,
9+
titles_only=True) %}
10+
{% endif %}
11+
{% if global_toc %}
12+
{{ global_toc }}
13+
{% else %}
14+
<!-- Local TOC -->
15+
<div class="local-toc">{{ toc }}</div>
16+
{% endif %}
17+
{% endblock %}
18+
<!-- End of overrides needed for the multilevel nav -->
19+
20+
321
{%- block content %}
422
{{ super() }}
523
<script>
@@ -29,6 +47,7 @@
2947
</div>
3048
{% endblock %}
3149

50+
3251
{% block footer %}
3352
{{ super() }}
3453
<script>

advanced_source/cpp_export.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Loading a TorchScript Model in C++
22
=====================================
33

4+
.. note:: TorchScript is no longer in active development.
5+
46
As its name suggests, the primary interface to PyTorch is the Python
57
programming language. While Python is a suitable and preferred language for
68
many scenarios requiring dynamism and ease of iteration, there are equally many

advanced_source/ddp_pipeline.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Training Transformer models using Distributed Data Parallel and Pipeline Parallelism
2+
====================================================================================
3+
4+
This tutorial has been deprecated.
5+
6+
Redirecting to the latest parallelism APIs in 3 seconds...
7+
8+
.. raw:: html
9+
10+
<meta http-equiv="Refresh" content="3; url='https://pytorch.org/tutorials/beginner/dist_overview.html#parallelism-apis'" />

advanced_source/torch-script-parallelism.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Dynamic Parallelism in TorchScript
22
==================================
33

4+
.. note:: TorchScript is no longer in active development.
5+
46
In this tutorial, we introduce the syntax for doing *dynamic inter-op parallelism*
57
in TorchScript. This parallelism has the following properties:
68

advanced_source/torch_script_custom_classes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Extending TorchScript with Custom C++ Classes
22
===============================================
33

4+
.. note:: TorchScript is no longer in active development.
5+
46
This tutorial is a follow-on to the
57
:doc:`custom operator <torch_script_custom_ops>`
68
tutorial, and introduces the API we've built for binding C++ classes into TorchScript

beginner_source/Intro_to_TorchScript_tutorial.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
**Authors:** James Reed (jamesreed@fb.com), Michael Suo (suo@fb.com), rev2
66
7+
.. note:: TorchScript is no longer in active development.
8+
79
This tutorial is an introduction to TorchScript, an intermediate
810
representation of a PyTorch model (subclass of ``nn.Module``) that
911
can then be run in a high-performance environment such as C++.

beginner_source/README.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ Beginner Tutorials
2020
5. nlp/* and deep_learning_nlp_tutorial.rst
2121
Deep Learning for NLP with Pytorch
2222
https://pytorch.org/tutorials/beginner/deep_learning_nlp_tutorial.html
23-
24-
6. transformer_translation.py
25-
Language Translation with Transformers
26-
https://pytorch.org/tutorials/beginner/translation_transformer.html

beginner_source/basics/intro.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
===================
1414
1515
Authors:
16-
`Suraj Subramanian <https://github.com/suraj813>`_,
16+
`Suraj Subramanian <https://github.com/subramen>`_,
1717
`Seth Juarez <https://github.com/sethjuarez/>`_,
18-
`Cassie Breviu <https://github.com/cassieview/>`_,
18+
`Cassie Breviu <https://github.com/cassiebreviu/>`_,
1919
`Dmitry Soshnikov <https://soshnikov.com/>`_,
2020
`Ari Bornstein <https://github.com/aribornstein/>`_
2121
@@ -49,6 +49,16 @@
4949
.. include:: /beginner_source/basics/qs_toc.txt
5050
5151
.. toctree::
52+
:maxdepth: 2
5253
:hidden:
5354
55+
quickstart_tutorial
56+
tensorqs_tutorial
57+
data_tutorial
58+
transforms_tutorial
59+
buildmodel_tutorial
60+
autogradqs_tutorial
61+
optimization_tutorial
62+
saveloadrun_tutorial
63+
5464
"""

0 commit comments

Comments
 (0)