Skip to content

Commit 0d57d9e

Browse files
committed
Merge branch '2.6-RC-TEST' into titaiwang/dynamo_true_api
2 parents e02ed78 + f2538e9 commit 0d57d9e

22 files changed

+843
-397
lines changed

.lycheeignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ https://pytorch.org/tutorials/beginner/colab/n
1212

1313
# Ignore local host link from intermediate_source/tensorboard_tutorial.rst
1414
http://localhost:6006
15+
16+
# Ignore local host link from recipes_source/deployment_with_flask.rst
17+
http://localhost:5000/predict
18+
19+
# Ignore local host link from advanced_source/cpp_frontend.rst
20+
https://www.uber.com/blog/deep-neuroevolution/

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,8 @@ described in the preceding sections:
218218
- [NLP From Scratch: Generating Names with a Character-Level RNN
219219
Tutorial](https://pytorch.org/tutorials/intermediate/char_rnn_generation_tutorial.html)
220220

221-
If you are creating a recipe, we recommend that you use [this
222-
template](https://github.com/pytorch/tutorials/blob/tutorials_refresh/recipes_source/recipes/example_recipe.py)
223-
as a guide.
221+
If you are creating a recipe, [this is a good
222+
example.](https://github.com/pytorch/tutorials/blob/main/recipes_source/recipes/what_is_state_dict.py)
224223

225224

226225
# Submission Process #

advanced_source/cpp_autograd.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ Out:
255255
[ CPUFloatType{3,4} ]
256256
257257
Please see the documentation for ``torch::autograd::backward``
258-
(`link <https://pytorch.org/cppdocs/api/function_namespacetorch_1_1autograd_1afa9b5d4329085df4b6b3d4b4be48914b.html>`_)
258+
(`link <https://pytorch.org/cppdocs/api/function_namespacetorch_1_1autograd_1a1403bf65b1f4f8c8506a9e6e5312d030.html>`_)
259259
and ``torch::autograd::grad``
260-
(`link <https://pytorch.org/cppdocs/api/function_namespacetorch_1_1autograd_1a1e03c42b14b40c306f9eb947ef842d9c.html>`_)
260+
(`link <https://pytorch.org/cppdocs/api/function_namespacetorch_1_1autograd_1ab9fa15dc09a8891c26525fb61d33401a.html>`_)
261261
for more information on how to use them.
262262

263263
Using custom autograd function in C++
@@ -394,9 +394,9 @@ C++ using the following table:
394394
+--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
395395
| Python | C++ |
396396
+================================+========================================================================================================================================================================+
397-
| ``torch.autograd.backward`` | ``torch::autograd::backward`` (`link <https://pytorch.org/cppdocs/api/function_namespacetorch_1_1autograd_1afa9b5d4329085df4b6b3d4b4be48914b.html>`_) |
397+
| ``torch.autograd.backward`` | ``torch::autograd::backward`` (`link <https://pytorch.org/cppdocs/api/function_namespacetorch_1_1autograd_1a1403bf65b1f4f8c8506a9e6e5312d030.html>`_) |
398398
+--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
399-
| ``torch.autograd.grad`` | ``torch::autograd::grad`` (`link <https://pytorch.org/cppdocs/api/function_namespacetorch_1_1autograd_1a1e03c42b14b40c306f9eb947ef842d9c.html>`_) |
399+
| ``torch.autograd.grad`` | ``torch::autograd::grad`` (`link <https://pytorch.org/cppdocs/api/function_namespacetorch_1_1autograd_1ab9fa15dc09a8891c26525fb61d33401a.html>`_) |
400400
+--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
401401
| ``torch.Tensor.detach`` | ``torch::Tensor::detach`` (`link <https://pytorch.org/cppdocs/api/classat_1_1_tensor.html#_CPPv4NK2at6Tensor6detachEv>`_) |
402402
+--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

advanced_source/cpp_custom_ops.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Custom C++ and CUDA Operators
1919
* PyTorch 2.4 or later
2020
* Basic understanding of C++ and CUDA programming
2121

22+
.. note::
23+
24+
This tutorial will also work on AMD ROCm with no additional modifications.
25+
2226
PyTorch offers a large library of operators that work on Tensors (e.g. torch.add, torch.sum, etc).
2327
However, you may wish to bring a new custom operator to PyTorch. This tutorial demonstrates the
2428
blessed path to authoring a custom operator written in C++/CUDA.

advanced_source/cpp_frontend.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ the right tool for the job. Examples for such environments include:
5757
Multiprocessing is an alternative, but not as scalable and has significant
5858
shortcomings. C++ has no such constraints and threads are easy to use and
5959
create. Models requiring heavy parallelization, like those used in `Deep
60-
Neuroevolution <https://eng.uber.com/deep-neuroevolution/>`_, can benefit from
60+
Neuroevolution <https://www.uber.com/blog/deep-neuroevolution/>`_, can benefit from
6161
this.
6262
- **Existing C++ Codebases**: You may be the owner of an existing C++
6363
application doing anything from serving web pages in a backend server to
@@ -662,7 +662,7 @@ Defining the DCGAN Modules
662662
We now have the necessary background and introduction to define the modules for
663663
the machine learning task we want to solve in this post. To recap: our task is
664664
to generate images of digits from the `MNIST dataset
665-
<http://yann.lecun.com/exdb/mnist/>`_. We want to use a `generative adversarial
665+
<https://huggingface.co/datasets/ylecun/mnist>`_. We want to use a `generative adversarial
666666
network (GAN)
667667
<https://papers.nips.cc/paper/5423-generative-adversarial-nets.pdf>`_ to solve
668668
this task. In particular, we'll use a `DCGAN architecture

advanced_source/pendulum.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
3434
In the process, we will touch three crucial components of TorchRL:
3535
36-
* `environments <https://pytorch.org/rl/reference/envs.html>`__
37-
* `transforms <https://pytorch.org/rl/reference/envs.html#transforms>`__
38-
* `models (policy and value function) <https://pytorch.org/rl/reference/modules.html>`__
36+
* `environments <https://pytorch.org/rl/stable/reference/envs.html>`__
37+
* `transforms <https://pytorch.org/rl/stable/reference/envs.html#transforms>`__
38+
* `models (policy and value function) <https://pytorch.org/rl/stable/reference/modules.html>`__
3939
4040
"""
4141

@@ -384,7 +384,7 @@ def _reset(self, tensordict):
384384
# convenient shortcuts to the content of the output and input spec containers.
385385
#
386386
# TorchRL offers multiple :class:`~torchrl.data.TensorSpec`
387-
# `subclasses <https://pytorch.org/rl/reference/data.html#tensorspec>`_ to
387+
# `subclasses <https://pytorch.org/rl/stable/reference/data.html#tensorspec>`_ to
388388
# encode the environment's input and output characteristics.
389389
#
390390
# Specs shape

beginner_source/blitz/autograd_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@
191191
# .. math::
192192
#
193193
#
194-
# J^{T}\cdot \vec{v} = m \cdot \left(\begin{array}{ccc}
194+
# J^{T}\cdot \vec{v} = \left(\begin{array}{ccc}
195195
# \frac{\partial y_{1}}{\partial x_{1}} & \cdots & \frac{\partial y_{m}}{\partial x_{1}}\\
196196
# \vdots & \ddots & \vdots\\
197197
# \frac{\partial y_{1}}{\partial x_{n}} & \cdots & \frac{\partial y_{m}}{\partial x_{n}}
198198
# \end{array}\right)\left(\begin{array}{c}
199199
# \frac{\partial l}{\partial y_{1}}\\
200200
# \vdots\\
201201
# \frac{\partial l}{\partial y_{m}}
202-
# \end{array}\right) = m \cdot \left(\begin{array}{c}
202+
# \end{array}\right) = \left(\begin{array}{c}
203203
# \frac{\partial l}{\partial x_{1}}\\
204204
# \vdots\\
205205
# \frac{\partial l}{\partial x_{n}}

beginner_source/pytorch_with_examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ which will be optimized during learning.
149149

150150
In TensorFlow, packages like
151151
`Keras <https://github.com/fchollet/keras>`__,
152-
`TensorFlow-Slim <https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/slim>`__,
152+
`TensorFlow-Slim <https://github.com/google-research/tf-slim>`__,
153153
and `TFLearn <http://tflearn.org/>`__ provide higher-level abstractions
154154
over raw computational graphs that are useful for building neural
155155
networks.

en-wordlist.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ FX
8181
FX's
8282
FairSeq
8383
Fastpath
84+
FakeTensor
85+
FakeTensors
8486
FFN
8587
FloydHub
8688
FloydHub's
@@ -368,6 +370,8 @@ downsample
368370
downsamples
369371
dropdown
370372
dtensor
373+
dtype
374+
dtypes
371375
duration
372376
elementwise
373377
embeddings
@@ -615,6 +619,7 @@ triton
615619
uint
616620
UX
617621
umap
622+
unbacked
618623
uncomment
619624
uncommented
620625
underflowing
@@ -651,7 +656,6 @@ RecSys
651656
TorchRec
652657
sharding
653658
TBE
654-
dtype
655659
EBC
656660
sharder
657661
hyperoptimized

intermediate_source/FSDP_tutorial.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It also comes with considerable engineering complexity to handle the training of
1111
`PyTorch FSDP <https://pytorch.org/blog/introducing-pytorch-fully-sharded-data-parallel-api/>`__, released in PyTorch 1.11 makes this easier.
1212

1313
In this tutorial, we show how to use `FSDP APIs <https://pytorch.org/docs/stable/fsdp.html>`__, for simple MNIST models that can be extended to other larger models such as `HuggingFace BERT models <https://huggingface.co/blog/zero-deepspeed-fairscale>`__,
14-
`GPT 3 models up to 1T parameters <https://pytorch.medium.com/training-a-1-trillion-parameter-model-with-pytorch-fully-sharded-data-parallel-on-aws-3ac13aa96cff>`__ . The sample DDP MNIST code has been borrowed from `here <https://github.com/yqhu/mnist_examples>`__.
14+
`GPT 3 models up to 1T parameters <https://pytorch.medium.com/training-a-1-trillion-parameter-model-with-pytorch-fully-sharded-data-parallel-on-aws-3ac13aa96cff>`__ . The sample DDP MNIST code courtesy of `Patrick Hu <https://github.com/yqhu/>`_.
1515

1616

1717
How FSDP works
@@ -251,6 +251,7 @@ We add the following code snippets to a python script “FSDP_mnist.py”.
251251
init_end_event.record()
252252
253253
if rank == 0:
254+
init_end_event.synchronize()
254255
print(f"CUDA event elapsed time: {init_start_event.elapsed_time(init_end_event) / 1000}sec")
255256
print(f"{model}")
256257

0 commit comments

Comments
 (0)