---
title: "Fast Inference on Large Language Models: BLOOMZ on Habana Gaudi2 Accelerator"
description: "BLOOMZ (176B parameters, 352 GB in 16-bit) runs inference on a single 8-HPU Habana Gaudi2 server using Optimum Habana with Habana's DeepSpeed-inference fork, HPU graphs and a KV cache."
url: "https://swe.quest/articles/fast-inference-on-large-language-models-bloomz-on-habana-gaudi2-accelerator-b18b18c9b1b881f4"
canonical: "https://huggingface.co/blog/habana-gaudi-2-bloom"
source: "Hugging Face"
published: "2023-03-28"
difficulty: "medium"
kind: "Research"
reading_minutes: 8
tags: ["inference","llms","hardware","performance"]
---

# Fast Inference on Large Language Models: BLOOMZ on Habana Gaudi2 Accelerator

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2023-03-28, 8 min read, Research. Original: [https://huggingface.co/blog/habana-gaudi-2-bloom](https://huggingface.co/blog/habana-gaudi-2-bloom)

## Summary

BLOOMZ (176B parameters, 352 GB in 16-bit) runs inference on a single 8-HPU Habana Gaudi2 server using Optimum Habana with Habana's DeepSpeed-inference fork, HPU graphs and a KV cache. In batch-1 greedy generation of 100 tokens, Gaudi2 is 1.42x faster than an 8x A100 80GB setup on the 176B model (3.1 s vs 4.4 s) and 2.89x faster on BLOOMZ-7B. Unlike A100, Gaudi2 benefits from model parallelism on the 7B model. First-gen Gaudi (AWS DL1, about $13/hr) offers better price-performance than A100 for the 7B checkpoint, and the post includes commands to reproduce the benchmark or run generation over any Hugging Face dataset.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- LLM text generation ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- DeepSpeed model parallelism ([easy posts on Concurrency](https://swe.quest/tags/concurrency.md?difficulty=easy))
- PyTorch

## Keywords

BLOOMZ, Habana Gaudi2, Optimum Habana, DeepSpeed-inference, SynapseAI, HPU graphs, Nvidia A100

## Related posts

- [Incredibly Fast BLOOM Inference with DeepSpeed and Accelerate](https://swe.quest/articles/incredibly-fast-bloom-inference-with-deepspeed-and-accelerate-7d1957ba474cbad5.md): Hugging Face · 2022-09-16 · Hard · 9 min read · Inference & serving, LLMs, Performance engineering, Hardware
  Running the 176B-parameter BLOOM model (352GB in bf16) for inference is benchmarked across HuggingFace Accelerate, DeepSpeed-Inference and DeepSpeed ZeRO-Inference on an 8x80GB A100 node, with 8-bit quantized variants via BitsAndBytes and DeepSpeed.
- [Optimization story: Bloom inference](https://swe.quest/articles/optimization-story-bloom-inference-d6344942eb1d22f2.md): Hugging Face · 2022-10-12 · Hard · 22 min read · Inference & serving, LLMs, Performance engineering, Python
  Hugging Face's BLOOM (176B parameters, 352GB in bf16) inference server reached 5x lower latency and 50x higher throughput over several weeks, starting from 0.3 req/s and 350ms/token on 16xA100 40GB with pipeline parallelism via Accelerate's device\_map="auto".
- [Text-Generation Pipeline on Intel® Gaudi® 2 AI Accelerator](https://swe.quest/articles/text-generation-pipeline-on-intel-gaudi-2-ai-accelerator-08fe7776346f5b95.md): Hugging Face · 2024-02-29 · Medium · 6 min read · Inference & serving, LLMs, Hardware, Python
  Optimum Habana's custom GaudiTextGenerationPipeline runs Llama 2 text generation (7b, 13b, 70b) on Intel Gaudi 2 with a few lines of code, handling pre- and post-processing end to end.
- [AMD + 🤗: Large Language Models Out-of-the-Box Acceleration with AMD GPU](https://swe.quest/articles/amd-large-language-models-out-of-the-box-acceleration-with-amd-gpu-fa18508c54402fa1.md): Hugging Face · 2023-12-05 · Easy · 7 min read · Inference & serving, Hardware, LLMs, Performance engineering
  Hugging Face Transformers now runs all models and tasks on AMD Instinct GPUs with no code changes versus NVIDIA, backed by ROCm support for Flash Attention v2, vLLM Paged Attention, DeepSpeed, GPTQ via AutoGPTQ, ONNX Runtime's ROCMExecutionProvider, and Optimum-Benchmark.
- [Hugging Face on AMD Instinct MI300 GPU](https://swe.quest/articles/hugging-face-on-amd-instinct-mi300-gpu-f116bf43c7c06916.md): Hugging Face · 2024-05-21 · Easy · 7 min read · Inference & serving, Hardware, LLMs, Performance engineering, Model training
  Hugging Face's transformers and text-generation-inference (TGI) now run on AMD Instinct MI300X GPUs with no code changes, backed by a Kubernetes-scheduled CI pipeline that runs tens of thousands of unit tests on MI250 and MI300 hardware.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
