🤗 Diffusers supports the latest optimizations from [PyTorch 2.0](https://pytorch.org/get-started/pytorch-2.0/) which include:  
1. A memory-efficient attention implementation, scaled dot product attention, without requiring any extra dependencies such as xFormers.
2. [`torch.compile`](https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html), a just-in-time (JIT) compiler to provide an extra performance boost when individual models are compiled.  
Both of these optimizations require PyTorch 2.0 or later and 🤗 Diffusers > 0.13.0.  
```bash
pip install --upgrade torch diffusers
```
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/optimization/torch2.0.md