forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'vllm-project:main' into v0.2.4-rocm
- Loading branch information
Showing
16 changed files
with
398 additions
and
455 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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# formatting | ||
yapf==0.32.0 | ||
toml==0.10.2 | ||
ruff==0.1.5 | ||
|
||
# type checking | ||
|
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,37 @@ | ||
"""Compare the outputs of HF and vLLM for Mistral models using greedy sampling. | ||
Run `pytest tests/models/test_mistral.py --forked`. | ||
""" | ||
import pytest | ||
|
||
MODELS = [ | ||
"mistralai/Mistral-7B-Instruct-v0.1", | ||
] | ||
|
||
|
||
@pytest.mark.parametrize("model", MODELS) | ||
@pytest.mark.parametrize("dtype", ["bfloat16"]) | ||
@pytest.mark.parametrize("max_tokens", [128]) | ||
def test_models( | ||
hf_runner, | ||
vllm_runner, | ||
example_long_prompts, | ||
model: str, | ||
dtype: str, | ||
max_tokens: int, | ||
) -> None: | ||
hf_model = hf_runner(model, dtype=dtype) | ||
hf_outputs = hf_model.generate_greedy(example_long_prompts, max_tokens) | ||
del hf_model | ||
|
||
vllm_model = vllm_runner(model, dtype=dtype) | ||
vllm_outputs = vllm_model.generate_greedy(example_long_prompts, max_tokens) | ||
del vllm_model | ||
|
||
for i in range(len(example_long_prompts)): | ||
hf_output_ids, hf_output_str = hf_outputs[i] | ||
vllm_output_ids, vllm_output_str = vllm_outputs[i] | ||
assert hf_output_str == vllm_output_str, ( | ||
f"Test{i}:\nHF: {hf_output_str!r}\nvLLM: {vllm_output_str!r}") | ||
assert hf_output_ids == vllm_output_ids, ( | ||
f"Test{i}:\nHF: {hf_output_ids}\nvLLM: {vllm_output_ids}") |
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,8 @@ | ||
vLLM is a high-throughput and memory-efficient inference and serving engine for LLMs. | ||
Briefly describe the major milestones in the development of artificial intelligence from 1950 to 2020. | ||
Compare and contrast artificial intelligence with human intelligence in terms of processing information. | ||
Describe the basic components of a neural network and how it can be trained. | ||
Write a short story about a robot that dreams for the first time. | ||
Analyze the impact of the COVID-19 pandemic on global economic structures and future business models. | ||
Explain the cultural significance of the Mona Lisa painting, and how its perception might vary in Western versus Eastern societies. | ||
Translate the following English sentence into Japanese, French, and Swahili: 'The early bird catches the worm.' |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.