# Intel Gaudi

Intel Gaudi AI 加速器家族包括 [Intel Gaudi 1](https://habana.ai/products/gaudi/)、[Intel Gaudi 2](https://habana.ai/products/gaudi2/) 和 [Intel Gaudi 3](https://habana.ai/products/gaudi3/)。每台服务器均配备 8 个被称为 Habana 处理单元（HPU）的设备，其中 Gaudi 3 提供 128GB 内存，Gaudi 2 提供 96GB，初代 Gaudi 提供 32GB。有关底层硬件架构的更多详细信息，请参阅 [Gaudi 架构](https://docs.habana.ai/en/latest/Gaudi_Overview/Gaudi_Architecture.html) 概览。

Diffusers 流水线可以利用 HPU 加速，即使该流水线尚未被添加到 [Optimum for Intel Gaudi](https://huggingface.co/docs/optimum/main/en/habana/index) 中，也可以通过 [GPU Migration Toolkit](https://docs.habana.ai/en/latest/PyTorch/PyTorch_Model_Porting/GPU_Migration_Toolkit/GPU_Migration_Toolkit.html) 实现。

对您的 pipeline 调用 `.to("hpu")`，将其移至 HPU 设备，如下面的 Flux 示例所示：
```py
import torch
from diffusers import DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", dtype=torch.bfloat16)
pipeline.to("hpu")

image = pipeline("An image of a squirrel in Picasso style").images[0]
```

> [!TIP]
> 对于 Gaudi 优化的扩散流水线实现，我们建议使用 [Optimum for Intel Gaudi](https://huggingface.co/docs/optimum/main/en/habana/index)。

