PyTorch has a new attention function for LLMs called FlexAttention that supports various attention variants.
I just took it for a spin and compared it to other implementations of multi-head attention, and it seems to work great in combination with torch.compile.
However, if you are not compiling your models (e.g., due to compatibility issues), it may be better not to use it for multi-head attention.
For too long, users have lived under the software lottery tyranny of fused attention implementations.
No longer.
Introducing FlexAttention, a new PyTorch API allowing for many attention variants to enjoy fused kernels in a few lines of PyTorch.
https://t.co/IXeUS6AkrY
1/10
Grok-1 support in gpt-fast at faster(?) than anyone else has reported so far. 75 tok/s for a 300B+ parameter model on an 8xA100 node.
If I understand correctly, ColossalAI reported 15 seconds to generate 100 tokens. gpt-fast takes 4.2 seconds to generate *400* tokens.
@yanboliang just landed a significant improvement in mixtral perf (https://t.co/Xm83xIBXvP).
For one A100 + int8, we go from 56 tok/s to 98 tok/s!
That's about 64% MBU, not too bad.
Essentially, we had one of the weight matrices transposed the wrong way :)
With the new release of Gemma-2B, I thought I'd see how torch.compile performs.
Gemma 2B for a single prompt runs at 144 tokens/s on a V100, a 4x increase over the uncompiled HF version.
We're working with @huggingface to upstream these improvements too!
Announcing it 2 months after the work was done, but gpt-fast now supports Mixtral + MoE models!
Featuring:
- faster decoding than any (non-Groq) API endpoint, at up to 220 tok/s/user.
- no custom kernels
- int8/TP
- still simple!
How do we do it? Well, torch.compile :)
(1/5)
As a developer, your job isn't about how much code you write, it's about how effectively you solve problems.
The best code is code you don't write & maintain -- because you're using off-the-shelf solutions, or because you're picking solutions that involve fewer subproblems.
Learn more about the research behind Smart Compose, a new feature in Gmail that uses machine learning to interactively offer sentence completion suggestions as you type, allowing you to draft emails faster → https://t.co/1cyrOPQsvT