Install xFormers from `pip`:  
```bash
pip install xformers
```  
<Tip>  
The xFormers `pip` package requires the latest version of PyTorch. If you need to use a previous version of PyTorch, then we recommend [installing xFormers from the source](https://github.com/facebookresearch/xformers#installing-xformers).  
</Tip>