Package: intel-extension-for-pytorch
Intel® Extension for PyTorch*CPU💻main branch|🌱Quick Start|📖Documentations|🏃Installation|💻LLM ExampleGPU💻main branch|🌱Quick Start|📖Documentations|🏃Installation|💻LLM ExampleIntel® Extension for PyTorch* extends PyTorch* with up-to-date features optimizations for an extra performance boost on Intel hardware. Optimizations take advantage of Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Vector Neural Network Instructions (VNNI) and Intel® Advanced Matrix Extensions (Intel® AMX) on Intel CPUs as well as Intel XeMatrix Extensions (XMX) AI engines on Intel discrete GPUs. Moreover, Intel® Extension for PyTorch* provides easy GPU acceleration for Intel discrete GPUs through the PyTorch* xpu device.Intel® Extension for PyTorch* provides optimizations both for eager and graph modes. However,  compared to the eager mode, the graph mode in PyTorch* normally yields better performance from the optimization techniques like operation fusion. Intel® Extension for PyTorch* amplifies them with more comprehensive graph optimizations. Both PyTorchTorchscriptandTorchDynamograph modes are supported. WithTorchscript, we recommend usingtorch.jit.trace()as your preferred option, as it generally supports a wider range of workloads compared totorch.jit.script().ipex.llm - Large Language Models (LLMs) OptimizationIn the current technological landscape, Generative AI (GenAI) workloads and models have gained widespread attention and popularity. Large Language Models (LLMs) have emerged as the dominant models driving these GenAI applications. Starting from 2.1.0, specific optimizations for certain LLM models are introduced in the Intel® Extension for PyTorch*. CheckLLM optimizationsfor details.Optimized Model ListMODEL FAMILYMODEL NAME (Huggingface hub)FP32BF16Static quantization INT8Weight only quantization INT8Weight only quantization INT4LLAMAmeta-llama/Llama-2-7b-hf🟩🟩🟩🟩🟨LLAMAmeta-llama/Llama-2-13b-hf🟩🟩🟩🟩🟨LLAMAmeta-llama/Llama-2-70b-hf🟩🟩🟩🟩🟨GPT-JEleutherAI/gpt-j-6b🟩🟩🟩🟩🟩GPT-NEOXEleutherAI/gpt-neox-20b🟩🟨🟨🟩🟨DOLLYdatabricks/dolly-v2-12b🟩🟨🟨🟩🟨FALCONtiiuae/falcon-40b🟩🟩🟩🟩🟩OPTfacebook/opt-30b🟩🟩🟩🟩🟨OPTfacebook/opt-1.3b🟩🟩🟩🟩🟨Bloombigscience/bloom-1b7🟩🟨🟩🟩🟨CodeGenSalesforce/codegen-2B-multi🟩🟩🟨🟩🟩Baichuanbaichuan-inc/Baichuan2-7B-Chat🟩🟩🟩🟩Baichuanbaichuan-inc/Baichuan2-13B-Chat🟩🟩🟩🟩Baichuanbaichuan-inc/Baichuan-13B-Chat🟩🟨🟩🟩ChatGLMTHUDM/chatglm3-6b🟩🟩🟨🟩ChatGLMTHUDM/chatglm2-6b🟩🟩🟨🟩GPTBigCodebigcode/starcoder🟩🟩🟨🟩🟨T5google/flan-t5-xl🟩🟩🟨🟩Mistralmistralai/Mistral-7B-v0.1🟩🟩🟨🟩🟨MPTmosaicml/mpt-7b🟩🟩🟨🟩🟩🟩 signifies that the model can perform well and with good accuracy (<1% difference as compared with FP32).🟨 signifies that the model can perform well while accuracy may not been in a perfect state (>1% difference as compared with FP32).Note: The above verified models (including other models in the same model family, like "codellama/CodeLlama-7b-hf" from LLAMA family) are well supported with all optimizations like indirect access KV cache, fused ROPE, and prepacked TPP Linear (fp32/bf16).
We are working in progress to better support the models in the tables with various data types. In addition, more models will be optimized in the future.SupportThe team tracks bugs and enhancement requests usingGitHub issues. Before submitting a suggestion or bug report, search the existing GitHub issues to see if your issue has already been reported.Intel® AI Reference ModelsUse cases that had already been optimized by Intel engineers are available atIntel® AI Reference Models(former Model Zoo). A bunch of PyTorch use cases for benchmarking are also available on theGithub page. You can get performance benefits out-of-box by simply running the scripts in the Reference Models.LicenseApache License, Version2.0. As found inLICENSEfile.SecuritySee Intel'sSecurity Centerfor information on how to report a potential security issue or vulnerability.See also:Security Policy