Skip to content

Commit 702b218

Browse files
sayakpaulsvekars
andauthored
Apply suggestions from code review
Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
1 parent b1ef178 commit 702b218

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

recipes_source/regional_aot.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
66
**Author:** `Sayak Paul <https://github.com/sayakpaul>`, `Charles Bensimon <https://github.com/cbensimon>`, `Angela Yi <https://github.com/angelayi>`
77
8-
In our [regional compilation recipe](https://docs.pytorch.org/tutorials/recipes/regional_compilation.html), we showed
8+
In the [regional compilation recipe](https://docs.pytorch.org/tutorials/recipes/regional_compilation.html), we showed
99
how to reduce cold start compilation times while retaining (almost) full compilation benefits. This was demonstrated for
10-
just-in-time (JiT) compilation.
10+
just-in-time (JIT) compilation.
1111
1212
This recipe shows how to apply similar principles when compiling a model ahead-of-time (AoT). If you
1313
are not familiar with AOTInductor and ``torch.export``, we recommend you to check out [this tutorial](https://docs.pytorch.org/tutorials/recipes/torch_export_aoti_python.html).
@@ -38,7 +38,7 @@
3838
# Steps
3939
# -----
4040
#
41-
# In this recipe, we will follow pretty much the same steps as the regional compilation recipe mentioned above:
41+
# In this recipe, we will follow the same steps as the regional compilation recipe mentioned above:
4242
#
4343
# 1. Import all necessary libraries.
4444
# 2. Define and initialize a neural network with repeated regions.
@@ -137,7 +137,7 @@ def forward(self, x):
137137

138138
###################################################
139139
# An exported program (``torch.export.ExportedProgram``) contains the Tensor computation,
140-
# a state_dict containing tensor values of all lifted parameters and buffer alongside
140+
# a ``state_dict`` containing tensor values of all lifted parameters and buffer alongside
141141
# other metadata. We specify the ``aot_inductor.package_constants_in_so`` to be ``False`` to
142142
# not serialize the model parameters in the generated artifact.
143143
#
@@ -156,7 +156,7 @@ def forward(self, x):
156156
print(f"{output_regional_compiled.shape=}")
157157

158158
#####################################################
159-
# Just like JiT regional compilation, compiling regions within a model ahead-of-time
159+
# Just like JIT regional compilation, compiling regions within a model ahead-of-time
160160
# leads to significantly reduced cold start times. The actual number will vary from
161161
# model to model.
162162
#
@@ -234,5 +234,5 @@ def aot_compile_load_model(regional=False) -> torch.nn.Module:
234234
# -----------
235235
#
236236
# This recipe shows how to control the cold start time when compiling your
237-
# model ahead-of-time.This becomes effective when your model has repeated
238-
# blocks, like typically seen in large generative models.
237+
# model ahead-of-time. This becomes effective when your model has repeated
238+
# blocks, which is typically seen in large generative models.

0 commit comments

Comments
 (0)