Skip to content

Accelerate local LLM inference and finetuning (LLaMA, Mistral, ChatGLM, Qwen, Baichuan, Mixtral, Gemma, etc.) on Intel CPU and GPU (e.g., local PC with iGPU, discrete GPU such as Arc, Flex and Max). A PyTorch LLM library that seamlessly integrates with llama.cpp, HuggingFace, LangChain, LlamaIndex, DeepSpeed, vLLM, FastChat, ModelScope, etc.

License

Notifications You must be signed in to change notification settings

pohsengl/ipex-llm

 
 

Repository files navigation

Important

bigdl-llm has now become ipex-llm (see the migration guide here); you may find the original BigDL project here.


💫 Intel® LLM library for PyTorch*

IPEX-LLM is a PyTorch library for running LLM on Intel CPU and GPU (e.g., local PC with iGPU, discrete GPU such as Arc, Flex and Max) with very low latency1.

Note

Latest Update 🔥

  • [2024/07] We added extensive support for Large Multimodal Models, including StableDiffusion, Phi-3-Vision, Qwen-VL, and more.
  • [2024/07] We added FP6 support on Intel GPU.
  • [2024/06] We added experimental NPU support for Intel Core Ultra processors; see the examples here.
  • [2024/06] We added extensive support of pipeline parallel inference, which makes it easy to run large-sized LLM using 2 or more Intel GPUs (such as Arc).
  • [2024/06] We added support for running RAGFlow with ipex-llm on Intel GPU.
  • [2024/05] You can now easily run ipex-llm inference, serving and finetuning using the Docker images.
  • [2024/05] You can now install ipex-llm on Windows using just "one command".
  • [2024/05] ipex-llm now supports Axolotl for LLM finetuning on Intel GPU; see the quickstart here.
More updates

ipex-llm Performance

See the Token Generation Speed on Intel Core Ultra and Intel Arc GPU below1 (and refer to [2][3][4] for more details).

You may follow the Benchmarking Guide to run ipex-llm performance benchmark yourself.

ipex-llm Demo

See demos of running local LLMs on Intel Iris iGPU, Intel Core Ultra iGPU, single-card Arc GPU, or multi-card Arc GPUs using ipex-llm below.

Intel Iris iGPU Intel Core Ultra iGPU Intel Arc dGPU 2-Card Intel Arc dGPUs
llama.cpp (Phi-3-mini Q4_0) Ollama (Mistral-7B Q4_K) TextGeneration-WebUI (Llama3-8B FP8) FastChat (QWen1.5-32B FP6)

Model Accuracy

Please see the Perplexity result below (tested on Wikitext dataset using the script here).

Perplexity sym_int4 q4_k fp6 fp8_e5m2 fp8_e4m3 fp16
Llama-2-7B-chat-hf 6.3638 6.2179 6.0924 6.1796 6.0980 6.0963
Mistral-7B-Instruct-v0.1 6.0025 5.9581 5.8930 5.8884 5.8820 5.8734
Qwen1.5-7B-chat 8.8652 8.8163 8.5573 8.8463 8.5304 8.6065

ipex-llm Quickstart

Docker

  • GPU Inference in C++: running llama.cpp, ollama, OpenWebUI, etc., with ipex-llm on Intel GPU
  • GPU Inference in Python : running HuggingFace transformers, LangChain, LlamaIndex, ModelScope, etc. with ipex-llm on Intel GPU
  • vLLM on GPU: running vLLM serving with ipex-llm on Intel GPU
  • vLLM on CPU: running vLLM serving with ipex-llm on Intel CPU
  • FastChat on GPU: running FastChat serving with ipex-llm on Intel GPU
  • VSCode on GPU: running and developing ipex-llm applications in Python using VSCode on Intel GPU

Use

  • llama.cpp: running llama.cpp (using C++ interface of ipex-llm as an accelerated backend for llama.cpp) on Intel GPU
  • Ollama: running ollama (using C++ interface of ipex-llm as an accelerated backend for ollama) on Intel GPU
  • Llama 3 with llama.cpp and ollama: running Llama 3 on Intel GPU using llama.cpp and ollama with ipex-llm
  • vLLM: running ipex-llm in vLLM on both Intel GPU and CPU
  • FastChat: running ipex-llm in FastChat serving on on both Intel GPU and CPU
  • Serving on multiple Intel GPUs: running ipex-llm serving on multiple Intel GPUs by leveraging DeepSpeed AutoTP and FastAPI
  • Text-Generation-WebUI: running ipex-llm in oobabooga WebUI
  • Axolotl: running ipex-llm in Axolotl for LLM finetuning
  • Benchmarking: running (latency and throughput) benchmarks for ipex-llm on Intel CPU and GPU

Applications

  • Local RAG: running LangChain-Chatchat (Knowledge Base QA using RAG pipeline) with ipex-llm
  • Coding copilot: running Continue (coding copilot in VSCode) with ipex-llm
  • Open WebUI: running Open WebUI with ipex-llm
  • PrivateGPT: running PrivateGPT to interact with documents with ipex-llm
  • Dify platform: running ipex-llm in Dify(production-ready LLM app development platform)
  • RAGFlow: running RAGFlow (an open-source RAG engine) with ipex-llm

Install

Code Examples

API Doc

FAQ

Verified Models

Over 50 models have been optimized/verified on ipex-llm, including LLaMA/LLaMA2, Mistral, Mixtral, Gemma, LLaVA, Whisper, ChatGLM2/ChatGLM3, Baichuan/Baichuan2, Qwen/Qwen-1.5, InternLM and more; see the list below.

Model CPU Example GPU Example
LLaMA (such as Vicuna, Guanaco, Koala, Baize, WizardLM, etc.) link1, link2 link
LLaMA 2 link1, link2 link
LLaMA 3 link link
ChatGLM link
ChatGLM2 link link
ChatGLM3 link link
GLM-4 link link
GLM-4V link link
Mistral link link
Mixtral link link
Falcon link link
MPT link link
Dolly-v1 link link
Dolly-v2 link link
Replit Code link link
RedPajama link1, link2
Phoenix link1, link2
StarCoder link1, link2 link
Baichuan link link
Baichuan2 link link
InternLM link link
Qwen link link
Qwen1.5 link link
Qwen2 link link
Qwen-VL link link
Aquila link link
Aquila2 link link
MOSS link
Whisper link link
Phi-1_5 link link
Flan-t5 link link
LLaVA link link
CodeLlama link link
Skywork link
InternLM-XComposer link
WizardCoder-Python link
CodeShell link
Fuyu link
Distil-Whisper link link
Yi link link
BlueLM link link
Mamba link link
SOLAR link link
Phixtral link link
InternLM2 link link
RWKV4 link
RWKV5 link
Bark link link
SpeechT5 link
DeepSeek-MoE link
Ziya-Coding-34B-v1.0 link
Phi-2 link link
Phi-3 link link
Phi-3-vision link link
Yuan2 link link
Gemma link link
DeciLM-7B link link
Deepseek link link
StableLM link link
CodeGemma link link
Command-R/cohere link link
CodeGeeX2 link link
MiniCPM link link
MiniCPM-V link

Get Support

Footnotes

  1. Performance varies by use, configuration and other factors. ipex-llm may not optimize to the same degree for non-Intel products. Learn more at www.Intel.com/PerformanceIndex. 2

About

Accelerate local LLM inference and finetuning (LLaMA, Mistral, ChatGLM, Qwen, Baichuan, Mixtral, Gemma, etc.) on Intel CPU and GPU (e.g., local PC with iGPU, discrete GPU such as Arc, Flex and Max). A PyTorch LLM library that seamlessly integrates with llama.cpp, HuggingFace, LangChain, LlamaIndex, DeepSpeed, vLLM, FastChat, ModelScope, etc.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.2%
  • Shell 2.7%
  • Other 1.1%