3.3 KiB
Supported Models and Hardware
Text Generation Inference enables serving optimized models on specific hardware for the highest performance. The following sections list which models are hardware are supported.
Supported Models
The following models are optimized and can be served with TGI, which uses custom CUDA kernels for better inference. You can add the flag --disable-custom-kernels
at the end of the docker run
command if you wish to disable them.
- BLOOM
- FLAN-T5
- Galactica
- GPT-Neox
- Llama
- OPT
- SantaCoder
- Starcoder
- Falcon 7B
- Falcon 40B
- MPT
- Llama V2
- Code Llama
- Mistral
If the above list lacks the model you would like to serve, depending on the model's pipeline type, you can try to initialize and serve the model anyways to see how well it performs, but performance isn't guaranteed for non-optimized models:
# for causal LMs/text-generation models
AutoModelForCausalLM.from_pretrained(<model>, device_map="auto")`
# or, for text-to-text generation models
AutoModelForSeq2SeqLM.from_pretrained(<model>, device_map="auto")
If you wish to serve a supported model that already exists on a local folder, just point to the local folder.
text-generation-launcher --model-id <PATH-TO-LOCAL-BLOOM>
Supported Hardware
TGI optimized models are supported on NVIDIA A100, A10G and T4 GPUs with CUDA 12.2+. Note that you have to install NVIDIA Container Toolkit to use it. For other NVIDIA GPUs, continuous batching will still apply, but some operations like flash attention and paged attention will not be executed.
TGI also has support of ROCm-enabled AMD Instinct MI210 and MI250 GPUs, with paged attention and flash attention v2 support. The following features are currently not supported in the ROCm version of TGI, and the supported may be extended in the future:
- Quantization (GPTQ, AWQ, etc.)
- Flash layer norm kernel
- Kernel for slinding window attention (Mistral)
TGI is also supported on the following AI hardware accelerators:
- Habana first-gen Gaudi and Gaudi2: check out this repository to serve models with TGI on Gaudi and Gaudi2 with Optimum Habana
- AWS Inferentia2: check out this guide on how to serve models with TGI on Inferentia2.