Skip to content

Commit 9b2fc27

Browse files
committed
spell check
1 parent 0775e50 commit 9b2fc27

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

recipes_source/torch_compile_caching_configuration_tutorial.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Before starting this recipe, make sure that you have the following:
2424
Inductor Cache Settings
2525
----------------------------
2626

27-
Most of these caches are in-memory, only used within the same process, and are transparent to the user. An exception is caches that store compiled FX graphs (FXGraphCache, AOTAutogradCache). These caches allow Inductor to avoid recompilation across process boundaries when it encounters the same graph with the same Tensor input shapes (and the same configuration). The default implementation stores compiled artifacts in the system temp directory. An optional feature also supports sharing those artifacts within a cluster by storing them in a Redis database.
27+
Most of these caches are in-memory, only used within the same process, and are transparent to the user. An exception is caches that store compiled FX graphs (``FXGraphCache``, ``AOTAutogradCache``). These caches allow Inductor to avoid recompilation across process boundaries when it encounters the same graph with the same Tensor input shapes (and the same configuration). The default implementation stores compiled artifacts in the system temp directory. An optional feature also supports sharing those artifacts within a cluster by storing them in a Redis database.
2828

2929
There are a few settings relevant to caching and to FX graph caching in particular.
3030
The settings are accessible via environment variables listed below or can be hard-coded in Inductor’s config file.
@@ -37,17 +37,17 @@ TORCHINDUCTOR_AUTOGRAD_CACHE
3737
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3838
This setting extends FXGraphCache to store cached results at the AOTAutograd level, instead of at the Inductor level. ``1`` enables, and any other value disables it.
3939
By default, the disk location is per username, but users can enable sharing across usernames by specifying ``TORCHINDUCTOR_CACHE_DIR`` (below).
40-
`TORCHINDUCTOR_AUTOGRAD_CACHE` requires `TORCHINDUCTOR_FX_GRAPH_CACHE` to work. The same cache dir stores cache entries for AOTAutogradCache (under `{TORCHINDUCTOR_CACHE_DIR}/aotautograd`) and FXGraphCache (under `{TORCHINDUCTOR_CACHE_DIR}/fxgraph`).
40+
`TORCHINDUCTOR_AUTOGRAD_CACHE` requires `TORCHINDUCTOR_FX_GRAPH_CACHE` to work. The same cache dir stores cache entries for ``AOTAutogradCache`` (under `{TORCHINDUCTOR_CACHE_DIR}/aotautograd`) and ``FXGraphCache`` (under `{TORCHINDUCTOR_CACHE_DIR}/fxgraph`).
4141

4242
TORCHINDUCTOR_CACHE_DIR
4343
~~~~~~~~~~~~~~~~~~~~~~~~
4444
This setting specifies the location of all on-disk caches. By default, the location is in the system temp directory under ``torchinductor_<username>``, for example, ``/tmp/torchinductor_myusername``.
4545

46-
Note that if ``TRITON_CACHE_DIR`` is not set in the environment, Inductor sets the Triton cache directory to this same temp location, under the Triton subdirectory.
46+
Note that if ``TRITON_CACHE_DIR`` is not set in the environment, Inductor sets the ``Triton`` cache directory to this same temp location, under the Triton sub-directory.
4747

4848
TORCHINDUCTOR_FX_GRAPH_REMOTE_CACHE
4949
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50-
This setting enables the remote FX graph cache feature. The current implementation uses Redis. ``1`` enables caching, and any other value disables it. The following environment variables configure the host and port of the Redis server:
50+
This setting enables the remote FX graph cache feature. The current implementation uses ``Redis``. ``1`` enables caching, and any other value disables it. The following environment variables configure the host and port of the Redis server:
5151

5252
``TORCHINDUCTOR_REDIS_HOST`` (defaults to ``localhost``)
5353
``TORCHINDUCTOR_REDIS_PORT`` (defaults to ``6379``)
@@ -56,15 +56,15 @@ Note that if Inductor locates a remote cache entry, it stores the compiled artif
5656

5757
TORCHINDUCTOR_AUTOGRAD_REMOTE_CACHE
5858
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59-
Like TORCHINDUCTOR_FX_GRAPH_REMOTE_CACHE, this setting enables the remote AOT AutogradCache feature. The current implementation uses Redis. ``1`` enables caching, and any other value disables it. The following environment variables configure the host and port of the Redis server:
59+
Like ``TORCHINDUCTOR_FX_GRAPH_REMOTE_CACHE``, this setting enables the remote ``AOTAutogradCache`` feature. The current implementation uses Redis. ``1`` enables caching, and any other value disables it. The following environment variables configure the host and port of the ``Redis`` server:
6060
``TORCHINDUCTOR_REDIS_HOST`` (defaults to ``localhost``)
6161
``TORCHINDUCTOR_REDIS_PORT`` (defaults to ``6379``)
6262

63-
`TORCHINDUCTOR_AUTOGRAD_REMOTE_CACHE`` depends on `TORCHINDUCTOR_FX_GRAPH_REMOTE_CACHE` to be enabled to work. The same Redis server can store both AOTAutograd and FXGraph cache results.
63+
`TORCHINDUCTOR_AUTOGRAD_REMOTE_CACHE`` depends on ``TORCHINDUCTOR_FX_GRAPH_REMOTE_CACHE`` to be enabled to work. The same Redis server can store both AOTAutograd and FXGraph cache results.
6464

6565
TORCHINDUCTOR_AUTOTUNE_REMOTE_CACHE
6666
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67-
This setting enables a remote cache for Inductor’s autotuner. As with the remote FX graph cache, the current implementation uses Redis. ``1`` enables caching, and any other value disables it. The same host / port environment variables listed above apply to this cache.
67+
This setting enables a remote cache for ``TorchInductor``’s autotuner. As with the remote FX graph cache, the current implementation uses Redis. ``1`` enables caching, and any other value disables it. The same host / port environment variables listed above apply to this cache.
6868

6969
TORCHINDUCTOR_FORCE_DISABLE_CACHES
7070
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

recipes_source/torch_compile_caching_tutorial.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ Caching Offerings
3030

3131
``torch.compile`` provides the following caching offerings:
3232

33-
* End to end caching (also known as Mega-Cache)
34-
* Modular caching of TorchDynamo, TorchInductor, and Triton
33+
* End to end caching (also known as ``Mega-Cache``)
34+
* Modular caching of ``TorchDynamo``, ``TorchInductor``, and ``Triton``
3535

3636
It is important to note that caching validates that the cache artifacts are used with the same PyTorch and Triton version, as well as, same GPU when device is set to be cuda.
3737

38-
``torch.compile`` end-to-end caching (a.k.a. Mega-Cache)
38+
``torch.compile`` end-to-end caching (a.k.a. ``Mega-Cache``)
3939
------------------------------------------------------------
4040

4141
End to end caching, from here onwards referred to Mega-Cache, is the ideal solution for users looking for a portable caching solution that can be stored in a database and can later be fetched possibly on a separate machine.
4242

43-
Mega-Cache provides two compiler APIs
43+
``Mega-Cache`` provides two compiler APIs
4444

4545
* ``torch.compiler.save_cache_artifacts()``
4646
* ``torch.compiler.load_cache_artifacts()``
4747

48-
The intented use case is after compiling and executing a model, the user calls ``torch.compiler.save_cache_artifacts()`` which will return the compiler artifacts in a portable form. Later, potentially on a different machine, the user may call ``torch.compiler.load_cache_artifacts()`` with these artifacts to prepopulate the ``torch.compile`` caches in order to jump-start their cache.
48+
The intended use case is after compiling and executing a model, the user calls ``torch.compiler.save_cache_artifacts()`` which will return the compiler artifacts in a portable form. Later, potentially on a different machine, the user may call ``torch.compiler.load_cache_artifacts()`` with these artifacts to pre-populate the ``torch.compile`` caches in order to jump-start their cache.
4949

5050
An example to this is as follows. First, compile and save the cache artifacts.
5151

@@ -74,27 +74,27 @@ Later, the user can jump-start their cache by the following.
7474
7575
torch.compiler.load_cache_artifacts(artifact_bytes)
7676
77-
This operation populates all the modular caches that will be discussed in the next section, including PGO, AOTAutograd, Inductor, Triton, and Autotuning.
77+
This operation populates all the modular caches that will be discussed in the next section, including ``PGO``, ``AOTAutograd``, ``Inductor``, ``Triton``, and ``Autotuning``.
7878

7979

80-
Modular caching of TorchDynamo, TorchInductor, and Triton
80+
Modular caching of ``TorchDynamo``, ``TorchInductor``, and ``Triton``
8181
-----------------------------------------------------------
8282

83-
The above described MegaCache is also compromised of individual components that can be used without any user intervention. By default, PyTorch Compiler comes with local on-disk caches for TorchDynamo, TorchInductor, and Triton. These caches are as following.
83+
The above described MegaCache is also compromised of individual components that can be used without any user intervention. By default, PyTorch Compiler comes with local on-disk caches for ``TorchDynamo``, ``TorchInductor``, and ``Triton``. These caches are as following.
8484

85-
* FXGraphCache: cache of graph-based IR components used in compilation
86-
* Triton Cache: cache of Triton-compilation results (cubin files generated by Triton as well as other caching artifacts)
87-
* InductorCache: bundling of FXGraphCache and Triton cache
88-
* AOTAutogradCache: caching of joint graph artifacts
89-
* PGO-cache: cache of dynamic shape decisions to reduce number of recompilations
85+
* ``FXGraphCache``: cache of graph-based IR components used in compilation
86+
* ``Triton Cache``: cache of Triton-compilation results (``cubin`` files generated by ``Triton`` as well as other caching artifacts)
87+
* ``InductorCache``: bundling of ``FXGraphCache`` and ``Triton`` cache
88+
* ``AOTAutogradCache``: caching of joint graph artifacts
89+
* ``PGO-cache``: cache of dynamic shape decisions to reduce number of recompilations
9090

9191
All these cache artifacts are written to ``TORCHINDUCTOR_CACHE_DIR`` which by default will look like ``/tmp/torchinductor_myusername``.
9292

9393

9494
Remote Caching
9595
----------------
9696

97-
We also provide a remote caching option for users who would like to take advantage of a Redis based cache. Check out `Compile Time Caching Configurations <https://pytorch.org/tutorials/recipes/torch_compile_caching_configuration_tutorial.html>` to learn more about how to enable the Redis based caching.
97+
We also provide a remote caching option for users who would like to take advantage of a ``Redis`` based cache. Check out `Compile Time Caching Configurations <https://pytorch.org/tutorials/recipes/torch_compile_caching_configuration_tutorial.html>` to learn more about how to enable the ``Redis`` based caching.
9898

9999

100100
Conclusion

0 commit comments

Comments
 (0)