Skip to content

Commit 6ca0b80

Browse files
authored
Improve discoverability of the transformer_building_blocks tutorial (#3359)
* Improve discoverability of the transformer_building_blocks tutorial
1 parent 85739f5 commit 6ca0b80

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

intermediate_source/transformer_building_blocks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
"""
2+
.. meta::
3+
:description: Learn how to optimize transformer models by replacing nn.Transformer with Nested Tensors and torch.compile() for significant performance gains in PyTorch.
4+
25
Accelerating PyTorch Transformers by replacing ``nn.Transformer`` with Nested Tensors and ``torch.compile()``
36
=============================================================================================================
47
**Author:** `Mikayla Gawarecki <https://github.com/mikaylagawarecki>`_

prototype_source/nestedtensor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,8 @@ def benchmark(func, *args, **kwargs):
369369
# how implement multi-head attention for transformers in a way that avoids computation on padding.
370370
# For more information, check out the docs for the
371371
# `torch.nested <https://pytorch.org/docs/stable/nested.html>`__ namespace.
372+
#
373+
# See Also
374+
# --------
375+
#
376+
# * `Accelerating PyTorch Transformers by replacing nn.Transformer with Nested Tensors and torch.compile() <https://docs.pytorch.org/tutorials/intermediate/transformer_building_blocks.html`__

0 commit comments

Comments
 (0)