Skip to content

Commit 79b2087

Browse files
mlazossvekarswilliamwen42
authored
Apply suggestions from code review
Co-authored-by: Svetlana Karslioglu <[email protected]> Co-authored-by: William Wen <[email protected]>
1 parent 64d73e1 commit 79b2087

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

recipes_source/compiling_optimizer.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
"""
88

99
######################################################################
10-
# Summary
11-
# ~~~~~~~~
1210
#
13-
# In this tutorial we will apply torch.compile to the optimizer to observe
14-
# the GPU performance improvement
11+
# In this recipe, we will apply ``torch.compile`` to the optimizer to observe
12+
# the GPU performance improvement.
1513
#
1614
# .. note::
1715
#
@@ -22,8 +20,8 @@
2220
######################################################################
2321
# Model Setup
2422
# ~~~~~~~~~~~~~~~~~~~~~
25-
# For this example we'll use a simple sequence of linear layers.
26-
# Since we are only benchmarking the optimizer, choice of model doesn't matter
23+
# For this example, we'll use a simple sequence of linear layers.
24+
# Since we are only benchmarking the optimizer, the choice of model doesn't matter
2725
# because optimizer performance is a function of the number of parameters.
2826
#
2927
# Depending on what machine you are using, your exact results may vary.
@@ -39,7 +37,7 @@
3937

4038
#############################################################################
4139
# Setting up and running the optimizer benchmark
42-
# ~~~~~~~~~~~~~~~~~~~~~~~~~
40+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4341
# In this example, we'll use the Adam optimizer
4442
# and create a helper function to wrap the step()
4543
# in torch.compile()
@@ -52,7 +50,7 @@ def fn():
5250
opt.step()
5351

5452

55-
# Lets define a helpful benchmarking function:
53+
# Let's define a helpful benchmarking function:
5654
import torch.utils.benchmark as benchmark
5755

5856

0 commit comments

Comments
 (0)