Skip to content

Commit 2f2c276

Browse files
authored
Merge branch 'master' into quant-fix
2 parents 59642d9 + ebef634 commit 2f2c276

13 files changed

+670
-17
lines changed

.circleci/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pytorch_tutorial_build_worker_defaults: &pytorch_tutorial_build_worker_defaults
173173
environment:
174174
DOCKER_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/pytorch/pytorch-linux-xenial-cuda10.2-cudnn7-py3-gcc7"
175175
CUDA_VERSION: "9"
176-
resource_class: gpu.medium
176+
resource_class: gpu.nvidia.small
177177
<<: *pytorch_tutorial_build_defaults
178178

179179
pytorch_tutorial_build_manager_defaults: &pytorch_tutorial_build_manager_defaults
@@ -223,6 +223,7 @@ jobs:
223223

224224
pytorch_tutorial_pr_build_worker_3:
225225
<<: *pytorch_tutorial_build_worker_defaults
226+
resource_class: gpu.nvidia.small.multi
226227

227228
pytorch_tutorial_pr_build_worker_4:
228229
<<: *pytorch_tutorial_build_worker_defaults
@@ -253,12 +254,14 @@ jobs:
253254

254255
pytorch_tutorial_pr_build_worker_13:
255256
<<: *pytorch_tutorial_build_worker_defaults
257+
resource_class: gpu.nvidia.small.multi
256258

257259
pytorch_tutorial_pr_build_worker_14:
258260
<<: *pytorch_tutorial_build_worker_defaults
259261

260262
pytorch_tutorial_pr_build_worker_15:
261263
<<: *pytorch_tutorial_build_worker_defaults
264+
resource_class: gpu.nvidia.medium
262265

263266
pytorch_tutorial_pr_build_worker_16:
264267
<<: *pytorch_tutorial_build_worker_defaults

.devcontainer/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ipython
2424
# to run examples
2525
pandas
2626
scikit-image
27-
pillow==8.3.2
27+
pillow==9.0.0
2828
wget
2929

3030
# for codespaces env
Loading
Loading

beginner_source/basics/data_tutorial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def __getitem__(self, idx):
160160

161161

162162
def __init__(self, annotations_file, img_dir, transform=None, target_transform=None):
163-
self.img_labels = pd.read_csv(annotations_file, names=['file_name', 'label'])
163+
self.img_labels = pd.read_csv(annotations_file)
164164
self.img_dir = img_dir
165165
self.transform = transform
166166
self.target_transform = target_transform

beginner_source/basics/quickstart_tutorial.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
from torch import nn
2727
from torch.utils.data import DataLoader
2828
from torchvision import datasets
29-
from torchvision.transforms import ToTensor, Lambda, Compose
30-
import matplotlib.pyplot as plt
29+
from torchvision.transforms import ToTensor
3130

3231
######################################################################
3332
# PyTorch offers domain-specific libraries such as `TorchText <https://pytorch.org/text/stable/index.html>`_,
@@ -67,8 +66,8 @@
6766
test_dataloader = DataLoader(test_data, batch_size=batch_size)
6867

6968
for X, y in test_dataloader:
70-
print("Shape of X [N, C, H, W]: ", X.shape)
71-
print("Shape of y: ", y.shape, y.dtype)
69+
print(f"Shape of X [N, C, H, W]: {X.shape}")
70+
print(f"Shape of y: {y.shape} {y.dtype}")
7271
break
7372

7473
######################################################################

beginner_source/basics/tensorqs_tutorial.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112

113113
# We move our tensor to the GPU if available
114114
if torch.cuda.is_available():
115-
tensor = tensor.to('cuda')
115+
tensor = tensor.to("cuda")
116116

117117

118118
######################################################################
@@ -124,9 +124,9 @@
124124
# **Standard numpy-like indexing and slicing:**
125125

126126
tensor = torch.ones(4, 4)
127-
print('First row: ', tensor[0])
128-
print('First column: ', tensor[:, 0])
129-
print('Last column:', tensor[..., -1])
127+
print(f"First row: {tensor[0]}")
128+
print(f"First column: {tensor[:, 0]}")
129+
print(f"Last column: {tensor[..., -1]}")
130130
tensor[:,1] = 0
131131
print(tensor)
132132

@@ -172,7 +172,7 @@
172172
# Operations that store the result into the operand are called in-place. They are denoted by a ``_`` suffix.
173173
# For example: ``x.copy_(y)``, ``x.t_()``, will change ``x``.
174174

175-
print(tensor, "\n")
175+
print(f"{tensor} \n")
176176
tensor.add_(5)
177177
print(tensor)
178178

beginner_source/transfer_learning_tutorial.py

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import torch.nn as nn
4040
import torch.optim as optim
4141
from torch.optim import lr_scheduler
42+
import torch.backends.cudnn as cudnn
4243
import numpy as np
4344
import torchvision
4445
from torchvision import datasets, models, transforms
@@ -47,6 +48,7 @@
4748
import os
4849
import copy
4950

51+
cudnn.benchmark = True
5052
plt.ion() # interactive mode
5153

5254
######################################################################

index.rst

+19-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Welcome to PyTorch Tutorials
5555
:image: _static/img/thumbnails/cropped/60-min-blitz.png
5656
:link: beginner/basics/intro.html
5757
:tags: Getting-Started
58-
58+
5959
.. customcarditem::
6060
:header: Introduction to PyTorch on YouTube
6161
:card_description: An introduction to building a complete ML workflow with PyTorch. Follows the PyTorch Beginner Series on YouTube.
@@ -120,7 +120,7 @@ Welcome to PyTorch Tutorials
120120
:image: _static/img/thumbnails/cropped/DCGAN-Tutorial.png
121121
:link: beginner/dcgan_faces_tutorial.html
122122
:tags: Image/Video
123-
123+
124124
.. customcarditem::
125125
:header: Spatial Transformer Networks Tutorial
126126
:card_description: Learn how to augment your network using a visual attention mechanism.
@@ -352,6 +352,13 @@ Welcome to PyTorch Tutorials
352352
:link: advanced/torch-script-parallelism.html
353353
:tags: Frontend-APIs,TorchScript,C++
354354

355+
.. customcarditem::
356+
:header: Real Time Inference on Raspberry Pi 4
357+
:card_description: This tutorial covers how to run quantized and fused models on a Raspberry Pi 4 at 30 fps.
358+
:image: _static/img/thumbnails/cropped/realtime_rpi.png
359+
:link: intermediate/realtime_rpi.html
360+
:tags: TorchScript,Model Optimization,Image/Video,Quantization
361+
355362
.. customcarditem::
356363
:header: Autograd in C++ Frontend
357364
:card_description: The autograd package helps build flexible and dynamic nerural netorks. In this tutorial, exploreseveral examples of doing autograd in PyTorch C++ frontend
@@ -496,6 +503,13 @@ Welcome to PyTorch Tutorials
496503
:link: intermediate/dist_tuto.html
497504
:tags: Parallel-and-Distributed-Training
498505

506+
.. customcarditem::
507+
:header: Customize Process Group Backends Using Cpp Extensions
508+
:card_description: Extend ProcessGroup with custom collective communication implementations.
509+
:image: _static/img/thumbnails/cropped/Customize-Process-Group-Backends-Using-Cpp-Extensions.png
510+
:link: intermediate/process_group_cpp_extension_tutorial.html
511+
:tags: Parallel-and-Distributed-Training
512+
499513
.. customcarditem::
500514
:header: Getting Started with Distributed RPC Framework
501515
:card_description: Learn how to build distributed training using the torch.distributed.rpc package.
@@ -646,7 +660,7 @@ Additional Resources
646660
beginner/basics/autogradqs_tutorial
647661
beginner/basics/optimization_tutorial
648662
beginner/basics/saveloadrun_tutorial
649-
663+
650664
.. toctree::
651665
:maxdepth: 2
652666
:hidden:
@@ -736,6 +750,7 @@ Additional Resources
736750
beginner/Intro_to_TorchScript_tutorial
737751
advanced/cpp_export
738752
advanced/super_resolution_with_onnxruntime
753+
intermediate/realtime_rpi
739754

740755
.. toctree::
741756
:maxdepth: 2
@@ -799,6 +814,7 @@ Additional Resources
799814
intermediate/model_parallel_tutorial
800815
intermediate/ddp_tutorial
801816
intermediate/dist_tuto
817+
intermediate/process_group_cpp_extension_tutorial
802818
intermediate/rpc_tutorial
803819
intermediate/rpc_param_server_tutorial
804820
intermediate/dist_pipeline_parallel_tutorial

intermediate_source/fx_profiling_tutorial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def summary(self, should_sort : bool = False) -> str:
218218
# https://github.com/pytorch/pytorch/issues/51393
219219
# * BatchNorm2d also takes up significant time. We can continue this
220220
# line of thinking and optimize this in the Conv-BN Fusion with FX
221-
# tutorial TODO: link
221+
# `tutorial <https://pytorch.org/tutorials/intermediate/fx_conv_bn_fuser.html>`_.
222222
#
223223
#
224224
# Conclusion

0 commit comments

Comments
 (0)