forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR enables loading GPTQ quantized models and running weight-only quantized inference on HPU. For a previous discussion, see #421.
- Loading branch information
Showing
7 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Test model set-up and inference for quantized HF models supported | ||
on the HPU backend using AutoGPTQ. | ||
Validating the configuration and printing results for manual checking. | ||
Run `pytest tests/quantization/test_gptq.py`. | ||
""" | ||
|
||
import pytest | ||
|
||
from vllm.platforms import current_platform | ||
|
||
MODELS = [ | ||
"TheBloke/Llama-2-7B-Chat-GPTQ", | ||
] | ||
DTYPE = ["bfloat16"] | ||
|
||
|
||
@pytest.mark.skipif(not current_platform.is_hpu(), | ||
reason="only supports Intel HPU backend.") | ||
@pytest.mark.parametrize("model", MODELS) | ||
@pytest.mark.parametrize("dtype", DTYPE) | ||
def test_gptq(vllm_runner, model, dtype): | ||
with vllm_runner(model, dtype=dtype, quantization='gptq_hpu') as llm: | ||
output = llm.generate_greedy(["The capital of France is"], | ||
max_tokens=32) | ||
assert output | ||
print(output) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters