Skip to content

Commit a4a9cfa

Browse files
authored
Add a prerequisites card (#2967)
* Add a prerequisites card CSS class * Update relevant tutorials to use those cards.
1 parent cfcda4b commit a4a9cfa

10 files changed

+59
-21
lines changed

_static/css/custom.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,23 @@
7171
.sd-card:hover:after {
7272
transform: scaleX(1);
7373
}
74+
75+
.card-prerequisites:hover {
76+
transition: none;
77+
border: none;
78+
}
79+
80+
.card-prerequisites:hover:after {
81+
transition: none;
82+
transform: none;
83+
}
84+
85+
.card-prerequisites:after {
86+
display: block;
87+
content: '';
88+
border-bottom: none;
89+
background-color: #fff;
90+
transform: none;
91+
transition: none;
92+
transform-origin: none;
93+
}

advanced_source/cpp_custom_ops.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ Custom C++ and CUDA Operators
88
.. grid:: 2
99

1010
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
11+
:class-card: card-prerequisites
1112

12-
* How to integrate custom operators written in C++/CUDA with PyTorch
13-
* How to test custom operators using ``torch.library.opcheck``
13+
* How to integrate custom operators written in C++/CUDA with PyTorch
14+
* How to test custom operators using ``torch.library.opcheck``
1415

1516
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
17+
:class-card: card-prerequisites
1618

17-
* PyTorch 2.4 or later
18-
* Basic understanding of C++ and CUDA programming
19+
* PyTorch 2.4 or later
20+
* Basic understanding of C++ and CUDA programming
1921

2022
PyTorch offers a large library of operators that work on Tensors (e.g. torch.add, torch.sum, etc).
2123
However, you may wish to bring a new custom operator to PyTorch. This tutorial demonstrates the

advanced_source/python_custom_ops.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
.. grid:: 2
1010
1111
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
12+
:class-card: card-prerequisites
1213
13-
* How to integrate custom operators written in Python with PyTorch
14-
* How to test custom operators using ``torch.library.opcheck``
14+
* How to integrate custom operators written in Python with PyTorch
15+
* How to test custom operators using ``torch.library.opcheck``
1516
1617
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
18+
:class-card: card-prerequisites
1719
18-
* PyTorch 2.4 or later
20+
* PyTorch 2.4 or later
1921
2022
PyTorch offers a large library of operators that work on Tensors (e.g.
2123
``torch.add``, ``torch.sum``, etc). However, you might wish to use a new customized

beginner_source/ddp_series_fault_tolerance.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
1414
.. grid:: 2
1515

1616
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
17+
:class-card: card-prerequisites
1718
:margin: 0
1819

19-
- Launching multi-GPU training jobs with ``torchrun``
20-
- Saving and loading snapshots of your training job
21-
- Structuring your training script for graceful restarts
20+
- Launching multi-GPU training jobs with ``torchrun``
21+
- Saving and loading snapshots of your training job
22+
- Structuring your training script for graceful restarts
2223

2324
.. grid:: 1
2425

@@ -27,6 +28,7 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
2728
:octicon:`code-square;1.0em;` View the code used in this tutorial on `GitHub <https://github.com/pytorch/examples/blob/main/distributed/ddp-tutorial-series/multigpu_torchrun.py>`__
2829

2930
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
31+
:class-card: card-prerequisites
3032
:margin: 0
3133

3234
* High-level `overview <ddp_series_theory.html>`__ of DDP

beginner_source/ddp_series_multigpu.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
1414
.. grid:: 2
1515

1616
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
17+
:class-card: card-prerequisites
1718

1819
- How to migrate a single-GPU training script to multi-GPU via DDP
1920
- Setting up the distributed process group
@@ -26,6 +27,7 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
2627
:octicon:`code-square;1.0em;` View the code used in this tutorial on `GitHub <https://github.com/pytorch/examples/blob/main/distributed/ddp-tutorial-series/multigpu.py>`__
2728

2829
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
30+
:class-card: card-prerequisites
2931

3032
* High-level overview of `how DDP works <ddp_series_theory.html>`__
3133
* A machine with multiple GPUs (this tutorial uses an AWS p3.8xlarge instance)

beginner_source/ddp_series_theory.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
1212
.. grid:: 2
1313

1414
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
15+
:class-card: card-prerequisites
1516

1617
* How DDP works under the hood
1718
* What is ``DistributedSampler``
1819
* How gradients are synchronized across GPUs
1920

2021

2122
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
23+
:class-card: card-prerequisites
2224

2325
* Familiarity with `basic non-distributed training <https://pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html>`__ in PyTorch
2426

beginner_source/template_tutorial.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
.. grid:: 2
1010
1111
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
12+
:class-card: card-prerequisites
1213
13-
* Item 1
14-
* Item 2
15-
* Item 3
14+
* Item 1
15+
* Item 2
16+
* Item 3
1617
1718
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
19+
:class-card: card-prerequisites
1820
19-
* PyTorch v2.0.0
20-
* GPU ???
21-
* Other items 3
21+
* PyTorch v2.0.0
22+
* GPU ???
23+
* Other items 3
2224
2325
If you have a video, add it here like this:
2426

intermediate_source/ddp_series_minGPT.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
1111
.. grid:: 2
1212

1313
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
14+
:class-card: card-prerequisites
1415

1516
- Best practices when writing a distributed training script
1617
- Increased flexibility with saving/loading artifacts in the cloud
@@ -23,6 +24,7 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
2324
:octicon:`code-square;1.0em;` View the code used in this tutorial on `GitHub <https://github.com/pytorch/examples/tree/main/distributed/minGPT-ddp>`__
2425

2526
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
27+
:class-card: card-prerequisites
2628

2729
- Familiarity with `multi-GPU training <../beginner/ddp_series_multigpu.html>`__ and `torchrun <../beginner/ddp_series_fault_tolerance.html>`__
2830
- [Optional] Familiarity with `multinode training <ddp_series_multinode.html>`__

intermediate_source/ddp_series_multinode.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
1111
.. grid:: 2
1212

1313
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
14+
:class-card: card-prerequisites
1415

1516
- Launching multinode training jobs with ``torchrun``
1617
- Code changes (and things to keep in mind) when moving from single-node to multinode training.
@@ -22,6 +23,7 @@ Authors: `Suraj Subramanian <https://github.com/suraj813>`__
2223
:octicon:`code-square;1.0em;` View the code used in this tutorial on `GitHub <https://github.com/pytorch/examples/blob/main/distributed/ddp-tutorial-series/multinode.py>`__
2324

2425
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
26+
:class-card: card-prerequisites
2527

2628
- Familiarity with `multi-GPU training <../beginner/ddp_series_multigpu.html>`__ and `torchrun <../beginner/ddp_series_fault_tolerance.html>`__
2729
- 2 or more TCP-reachable GPU machines (this tutorial uses AWS p3.2xlarge instances)

intermediate_source/dqn_with_rnn_tutorial.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@
99
.. grid:: 2
1010
1111
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
12+
:class-card: card-prerequisites
1213
13-
* How to incorporating an RNN in an actor in TorchRL
14-
* How to use that memory-based policy with a replay buffer and a loss module
14+
* How to incorporating an RNN in an actor in TorchRL
15+
* How to use that memory-based policy with a replay buffer and a loss module
1516
1617
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
18+
:class-card: card-prerequisites
1719
18-
* PyTorch v2.0.0
19-
* gym[mujoco]
20-
* tqdm
20+
* PyTorch v2.0.0
21+
* gym[mujoco]
22+
* tqdm
2123
"""
2224

2325
#########################################################################

0 commit comments

Comments
 (0)