Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions intermediate_source/transformer_building_blocks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""
.. meta::
:description: Learn how to optimize transformer models by replacing nn.Transformer with Nested Tensors and torch.compile() for significant performance gains in PyTorch.

Accelerating PyTorch Transformers by replacing ``nn.Transformer`` with Nested Tensors and ``torch.compile()``
=============================================================================================================
**Author:** `Mikayla Gawarecki <https://github.com/mikaylagawarecki>`_
Expand Down
5 changes: 5 additions & 0 deletions prototype_source/nestedtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,8 @@ def benchmark(func, *args, **kwargs):
# how implement multi-head attention for transformers in a way that avoids computation on padding.
# For more information, check out the docs for the
# `torch.nested <https://pytorch.org/docs/stable/nested.html>`__ namespace.
#
# See Also
# --------
#
# * `Accelerating PyTorch Transformers by replacing nn.Transformer with Nested Tensors and torch.compile() <https://docs.pytorch.org/tutorials/intermediate/transformer_building_blocks.html`__