Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 8 min read How-to mediumAdept

Building Cost-Efficient Enterprise RAG applications with Intel Gaudi 2 and Intel Xeon

A RAG chatbot built with LangChain's rag-redis template runs BAAI/bge-base-en-v1.5 embeddings on Intel Granite Rapids Xeon CPUs, Redis as the vector store, and an LLM served by Hugging Face TGI on Gaudi 2. The walkthrough covers ingesting Nike 10-K filings, wiring the retrieval chain, launching TGI Gaudi via Docker (with sharding for 70B models and optional FP8 quantization, claimed 1.8x over BF16), and starting the FastAPI backend and npm GUI. Intel's benchmark of Llama2-70B with 16 concurrent users reports H100 delivering 1.13x more throughput but only 0.44x the performance per dollar of Gaudi 2, with pricing caveats.

Assumes: retrieval-augmented generation basicsDockerLangChain

Related posts

  • Text-Generation Pipeline on Intel® Gaudi® 2 AI Accelerator

    Hugging Face mediumAdept

    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. Setup covers gated-model access, pinned versions of optimum-habana and Habana's DeepSpeed fork, and CLI runs with HPU graphs, KV cache and sampling parameters. Llama-2-70b uses DeepSpeed across 8 devices. The pipeline can also be embedded in Python scripts or wrapped by LangChain's HuggingFacePipeline, validated only against LangChain 0.0.191.

  • CPU Optimized Embeddings with 🤗 Optimum Intel and fastRAG

    Hugging Face mediumAdept

    Post-training static int8 quantization of BGE embedding models (small, base, large) with Optimum Intel, Intel Neural Compressor and IPEX gives up to 4.5x lower latency and up to 4x higher throughput on 4th-gen Xeon CPUs compared with a bf16 PyTorch baseline. Accuracy loss stays small: under 0.3% on MTEB reranking and up to 1.55% on retrieval. The guide covers calibration with a qasper subset, loading the model with IPEXModel, and the benchmark setup (ipexrun, TCMalloc, single socket). It also shows how to plug the quantized models into fastRAG's QuantizedBiEncoderRetriever and QuantizedBiEncoderRanker for RAG indexing and reranking.

  • Benchmarking Language Model Performance on 5th Gen Xeon at GCP

    Hugging Face mediumAdept

    On Google Cloud, C4 instances (5th Gen Xeon Emerald Rapids with AMX) deliver 10x–24x higher throughput than N2 instances (3rd Gen Ice Lake, AVX-512 only) for text embedding with UAE-Large-V1, and 2.3x–3.6x higher throughput for Llama 3.2 3B text generation. C4 costs about 1.3x more per hour, which works out to a 7x–19x TCO advantage for embedding and 1.7x–2.9x for generation. The post gives reproducible setup steps using optimum-benchmark with the optimum-intel IPEX backend in bfloat16, including NUMA binding and OpenMP settings. It argues that lightweight agentic AI pipelines built on small language models could run entirely on CPUs.

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

    Hugging Face mediumAdept

    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.

  • AMD + 🤗: Large Language Models Out-of-the-Box Acceleration with AMD GPU

    Hugging Face easyNovice

    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. Text Generation Inference gains initial MI210/MI250 support through a ROCm Docker image, with GeMM kernel tuning to reach performance parity. Benchmarks show one MI250 (two 64 GB ROCm devices) delivering over 2.33x the decode throughput and half the prefill latency of an A100 at large batch sizes. Its 128 GB memory also fits Llama 70B workloads that run out of memory on two A100-80GBs.

The quest for software engineering knowledge.

Look:
Layout: