Skip to main content

AutoAWQ

还没翻译译自英文(docs.vllm.ai)本页 9 段都还没译

AutoAWQ

⚠️ Warning: The AutoAWQ library is deprecated. This functionality has been adopted by the vLLM project in llm-compressor. For the recommended quantization workflow, please see the AWQ examples in llm-compressor. For more details on the deprecation, refer to the original AutoAWQ repository.

To create a new 4-bit quantized model, you can leverage AutoAWQ. Quantization reduces the model's precision from BF16/FP16 to INT4 which effectively reduces the total model memory footprint. The main benefits are lower latency and memory usage.

You can quantize your own models by installing AutoAWQ or picking one of the 6500+ models on Huggingface.

pip install autoawq

After installing AutoAWQ, you are ready to quantize a model. Please refer to the AutoAWQ documentation for further details. Here is an example of how to quantize mistralai/Mistral-7B-Instruct-v0.2:

Code

To run an AWQ model with vLLM, you can use TheBloke/Llama-2-7b-Chat-AWQ with the following command:

python examples/deployment/llm_engine_example.py \
    --model TheBloke/Llama-2-7b-Chat-AWQ \
    --quantization auto_awq

AWQ models are also supported directly through the LLM entrypoint:

Code