Skip to content

Commit 128892d

Browse files
authored
Merge branch 'pytorch:main' into main
2 parents cee69f6 + b7cca68 commit 128892d

18 files changed

+931
-21
lines changed

.jenkins/metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
"recipes_source/torch_compile_user_defined_triton_kernel_tutorial.py": {
6262
"needs": "linux.g5.4xlarge.nvidia.gpu"
6363
},
64+
"recipes_source/regional_compilation.py": {
65+
"needs": "linux.g5.4xlarge.nvidia.gpu"
66+
},
6467
"advanced_source/semi_structured_sparse.py": {
6568
"needs": "linux.g5.4xlarge.nvidia.gpu"
6669
},
549 KB
Loading

beginner_source/basics/saveloadrun_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
########################
5858
# We can then load the model as demonstrated below.
5959
#
60-
# As described in `Saving and loading torch.nn.Modules <pytorch.org/docs/main/notes/serialization.html#saving-and-loading-torch-nn-modules>`__,
61-
# saving ``state_dict``s is considered the best practice. However,
60+
# As described in `Saving and loading torch.nn.Modules <https://pytorch.org/docs/main/notes/serialization.html#saving-and-loading-torch-nn-modules>`_,
61+
# saving ``state_dict`` is considered the best practice. However,
6262
# below we use ``weights_only=False`` because this involves loading the
6363
# model, which is a legacy use case for ``torch.save``.
6464

beginner_source/introyt/modelsyt_tutorial.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,7 @@ def forward(self, sentence):
311311
# ``TransformerDecoder``) and subcomponents (``TransformerEncoderLayer``,
312312
# ``TransformerDecoderLayer``). For details, check out the
313313
# `documentation <https://pytorch.org/docs/stable/nn.html#transformer-layers>`__
314-
# on transformer classes, and the relevant
315-
# `tutorial <https://pytorch.org/tutorials/beginner/transformer_tutorial.html>`__
316-
# on pytorch.org.
314+
# on transformer classes.
317315
#
318316
# Other Layers and Functions
319317
# --------------------------

index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,13 @@ Welcome to PyTorch Tutorials
439439
:link: advanced/python_custom_ops.html
440440
:tags: Extending-PyTorch,Frontend-APIs,C++,CUDA
441441

442+
.. customcarditem::
443+
:header: Compiled Autograd: Capturing a larger backward graph for ``torch.compile``
444+
:card_description: Learn how to use compiled autograd to capture a larger backward graph.
445+
:image: _static/img/thumbnails/cropped/generic-pytorch-logo.png
446+
:link: intermediate/compiled_autograd_tutorial
447+
:tags: Model-Optimization,CUDA
448+
442449
.. customcarditem::
443450
:header: Custom C++ and CUDA Operators
444451
:card_description: How to extend PyTorch with custom C++ and CUDA operators.
@@ -1132,6 +1139,7 @@ Additional Resources
11321139
intermediate/nvfuser_intro_tutorial
11331140
intermediate/ax_multiobjective_nas_tutorial
11341141
intermediate/torch_compile_tutorial
1142+
intermediate/compiled_autograd_tutorial
11351143
intermediate/inductor_debug_cpu
11361144
intermediate/scaled_dot_product_attention_tutorial
11371145
beginner/knowledge_distillation_tutorial

intermediate_source/compiled_autograd_tutorial.rst

Lines changed: 302 additions & 0 deletions
Large diffs are not rendered by default.

intermediate_source/scaled_dot_product_attention_tutorial.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def generate_rand_batch(
244244

245245
######################################################################
246246
# Using SDPA with ``torch.compile``
247-
# =================================
247+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248248
#
249249
# With the release of PyTorch 2.0, a new feature called
250250
# ``torch.compile()`` has been introduced, which can provide
@@ -324,9 +324,9 @@ def generate_rand_batch(
324324
#
325325

326326
######################################################################
327-
# Using SDPA with attn_bias subclasses`
328-
# ==========================================
329-
#
327+
# Using SDPA with attn_bias subclasses
328+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
329+
330330
# As of PyTorch 2.3, we have added a new submodule that contains tensor subclasses.
331331
# Designed to be used with ``torch.nn.functional.scaled_dot_product_attention``.
332332
# The module is named ``torch.nn.attention.bias`` and contains the following two
@@ -394,7 +394,7 @@ def generate_rand_batch(
394394

395395
######################################################################
396396
# Conclusion
397-
# ==========
397+
# ~~~~~~~~~~~
398398
#
399399
# In this tutorial, we have demonstrated the basic usage of
400400
# ``torch.nn.functional.scaled_dot_product_attention``. We have shown how

intermediate_source/torchrec_intro_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ def _wait_impl(self) -> torch.Tensor:
917917

918918
######################################################################
919919
# Inference
920-
# ~~~~~~~~~~~~
920+
# ~~~~~~~~~
921921
#
922922
# Now that we are able to train distributed embeddings, how can we take
923923
# the trained model and optimize it for inference? Inference is typically

prototype_source/README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ Prototype Tutorials
3939
10 flight_recorder_tutorial.rst
4040
Flight Recorder User Guide
4141
https://pytorch.org/tutorials/prototype/flight_recorder_tutorial.html
42+
43+
11 python_extension_autoload.rst
44+
Autoloading Out-of-Tree Extension
45+
https://pytorch.org/tutorials/prototype/python_extension_autoload.html

prototype_source/flight_recorder_tutorial.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ What you will learn
99

1010
Prerequisites
1111
-------------
12+
1213
- PyTorch version 2.5 or later.
14+
- `tabulate <https://pypi.org/project/tabulate/>`__. You can install by running ``pip install tabulate``.
15+
1316

1417
Overview
1518
--------

0 commit comments

Comments
 (0)