#211 · Primary category: Deep Learning Frameworks

performer-pytorch

artificial-intelligence attention attention-mechanism deep-learning transformers

An implementation of Performer, a linear attention-based transformer, in Pytorch

Project last updated:02/02/22

GitHub Stars

1.2K

Forks

148

Contributors

6

License

MIT

Why we included this project

Machine learning engineers and researchers who need to train transformers on very long sequences will find a practical PyTorch implementation of the Performer architecture here. The library packages the FAVOR+ random-feature linear attention mechanism into ready-made modules: a language model, encoder-decoder pairs, and standalone self-attention and cross-attention layers. That removes the need to reimplement the math from the paper when you want a larger context window. It also combines efficiency tricks from related work, such as reversible layers, local attention heads, GLU feedforwards, and rotary positional embeddings, which makes it a solid base for long-context experiments. Because it ships plain building blocks rather than pretrained weights, it doubles as a useful way to see how linear attention is actually put together.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category