Skip to content

Commit ab4bc2c

Browse files
authored
Merge branch 'main' into main
2 parents 6b10280 + e7563f6 commit ab4bc2c

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

advanced_source/static_quantization_tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ to enable quantization:
5959
- Replace ReLU6 with ReLU
6060

6161
Note: this code is taken from
62-
`here <https://github.com/pytorch/vision/blob/master/torchvision/models/mobilenet.py>`_.
62+
`here <https://github.com/pytorch/vision/blob/main/torchvision/models/mobilenetv2.py>`_.
6363

6464
.. code:: python
6565

intermediate_source/FSDP_adavnced_tutorial.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ summarization using WikiHow dataset. The main focus of this tutorial is to
7474
highlight different available features in FSDP that are helpful for training
7575
large scale model above 3B parameters. Also, we cover specific features for
7676
Transformer based models. The code for this tutorial is available in `Pytorch
77-
Examples
78-
<https://github.com/HamidShojanazeri/examples/tree/FSDP_example/distributed/FSDP/>`__.
77+
examples
78+
<https://github.com/pytorch/examples/tree/main/distributed/FSDP/>`__.
7979

8080

8181
*Setup*
@@ -97,13 +97,13 @@ Please create a `data` folder, download the WikiHow dataset from `wikihowAll.csv
9797
`wikihowSep.cs <https://ucsb.app.box.com/s/7yq601ijl1lzvlfu4rjdbbxforzd2oag>`__,
9898
and place them in the `data` folder. We will use the wikihow dataset from
9999
`summarization_dataset
100-
<https://github.com/HamidShojanazeri/examples/blob/FSDP_example/distributed/FSDP/summarization_dataset.py>`__.
100+
<https://github.com/pytorch/examples/blob/main/distributed/FSDP/summarization_dataset.py>`__.
101101

102102
Next, we add the following code snippets to a Python script “T5_training.py”.
103103

104104
.. note::
105105
The full source code for this tutorial is available in `PyTorch examples
106-
<https://github.com/HamidShojanazeri/examples/tree/FSDP_example/distributed/FSDP>`__.
106+
<https://github.com/pytorch/examples/tree/main/distributed/FSDP/>`__.
107107

108108
1.3 Import necessary packages:
109109

intermediate_source/mario_rl_tutorial.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#
3333
# %%bash
3434
# pip install gym-super-mario-bros==7.4.0
35+
# pip install tensordict==0.2.0
36+
# pip install torchrl==0.2.0
37+
#
3538

3639
import torch
3740
from torch import nn

intermediate_source/parametrizations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def __init__(self, n):
227227

228228
def forward(self, X):
229229
# (I + X)(I - X)^{-1}
230-
return torch.solve(self.Id + X, self.Id - X).solution
230+
return torch.linalg.solve(self.Id - X, self.Id + X)
231231

232232
layer = nn.Linear(3, 3)
233233
parametrize.register_parametrization(layer, "weight", Skew())
@@ -301,13 +301,13 @@ def __init__(self, n):
301301
def forward(self, X):
302302
# Assume X skew-symmetric
303303
# (I + X)(I - X)^{-1}
304-
return torch.solve(self.Id + X, self.Id - X).solution
304+
return torch.linalg.solve(self.Id - X, self.Id + X)
305305

306306
def right_inverse(self, A):
307307
# Assume A orthogonal
308308
# See https://en.wikipedia.org/wiki/Cayley_transform#Matrix_map
309309
# (X - I)(X + I)^{-1}
310-
return torch.solve(X - self.Id, self.Id + X).solution
310+
return torch.linalg.solve(X + self.Id, self.Id - X)
311311

312312
layer_orthogonal = nn.Linear(3, 3)
313313
parametrize.register_parametrization(layer_orthogonal, "weight", Skew())

intermediate_source/pruning_tutorial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
class LeNet(nn.Module):
4545
def __init__(self):
4646
super(LeNet, self).__init__()
47-
# 1 input image channel, 6 output channels, 3x3 square conv kernel
48-
self.conv1 = nn.Conv2d(1, 6, 3)
49-
self.conv2 = nn.Conv2d(6, 16, 3)
47+
# 1 input image channel, 6 output channels, 5x5 square conv kernel
48+
self.conv1 = nn.Conv2d(1, 6, 5)
49+
self.conv2 = nn.Conv2d(6, 16, 5)
5050
self.fc1 = nn.Linear(16 * 5 * 5, 120) # 5x5 image dimension
5151
self.fc2 = nn.Linear(120, 84)
5252
self.fc3 = nn.Linear(84, 10)

recipes_source/recipes/tuning_guide.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,12 @@ def fused_gelu(x):
193193
#
194194
# numactl --cpunodebind=N --membind=N python <pytorch_script>
195195

196-
###############################################################################
197-
# More detailed descriptions can be found `here <https://software.intel.com/content/www/us/en/develop/articles/how-to-get-better-performance-on-pytorchcaffe2-with-intel-acceleration.html>`_.
198-
199196
###############################################################################
200197
# Utilize OpenMP
201198
# ~~~~~~~~~~~~~~
202199
# OpenMP is utilized to bring better performance for parallel computation tasks.
203200
# ``OMP_NUM_THREADS`` is the easiest switch that can be used to accelerate computations. It determines number of threads used for OpenMP computations.
204-
# CPU affinity setting controls how workloads are distributed over multiple cores. It affects communication overhead, cache line invalidation overhead, or page thrashing, thus proper setting of CPU affinity brings performance benefits. ``GOMP_CPU_AFFINITY`` or ``KMP_AFFINITY`` determines how to bind OpenMP* threads to physical processing units. Detailed information can be found `here <https://software.intel.com/content/www/us/en/develop/articles/how-to-get-better-performance-on-pytorchcaffe2-with-intel-acceleration.html>`_.
201+
# CPU affinity setting controls how workloads are distributed over multiple cores. It affects communication overhead, cache line invalidation overhead, or page thrashing, thus proper setting of CPU affinity brings performance benefits. ``GOMP_CPU_AFFINITY`` or ``KMP_AFFINITY`` determines how to bind OpenMP* threads to physical processing units.
205202

206203
###############################################################################
207204
# With the following command, PyTorch run the task on N OpenMP threads.

0 commit comments

Comments
 (0)