{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# For tips on running notebooks in Google Colab, see\n# https://codelin.vip/beginner/colab\n%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "::: {.meta description=\"Learn how to optimize transformer models by replacing nn.Transformer with Nested Tensors and torch.compile() for significant performance gains in PyTorch.\"}\n:::\n\nAccelerating PyTorch Transformers by replacing `nn.Transformer` with Nested Tensors and `torch.compile()`\n=========================================================================================================\n\n**Author:** [Mikayla Gawarecki](https://github.com/mikaylagawarecki)\n\n```{=html}\n
scaled_dot_product_attention
, torch.compile()
, and FlexAttention
)