Skip to content

Commit 566917a

Browse files
committed
add e2e test for ep and etp
Signed-off-by: MengqingCao <cmq0113@163.com>
1 parent 51d9672 commit 566917a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/e2e/multicard/test_ep_etp.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import os
2+
3+
import pytest
4+
5+
from tests.conftest import VllmRunner
6+
from tests.model_utils import check_outputs_equal
7+
8+
9+
@pytest.mark.skipif(os.getenv("VLLM_USE_V1") == "0",
10+
reason="ep is not supported on v0")
11+
@pytest.mark.parametrize("model_name", ["deepseek-ai/DeepSeek-V2-Lite-Chat"])
12+
def test_e2e_ep_etp_correctness(model_name):
13+
example_prompts = [
14+
"Hello, my name is",
15+
"The president of the United States is",
16+
"The capital of France is",
17+
"The future of AI is",
18+
]
19+
max_tokens = 5
20+
21+
with VllmRunner(model_name,
22+
tensor_parallel_size=2,
23+
additional_config={
24+
"expert_tensor_parallel_size": 2,
25+
}) as vllm_model:
26+
etp_output = vllm_model.generate_greedy(example_prompts, max_tokens)
27+
28+
with VllmRunner(model_name,
29+
tensor_parallel_size=2,
30+
enable_expert_parallel=True) as vllm_model:
31+
ep_output = vllm_model.generate_greedy(example_prompts, max_tokens)
32+
33+
check_outputs_equal(
34+
outputs_0_lst=ep_output,
35+
outputs_1_lst=etp_output,
36+
name_0="ep_output",
37+
name_1="etp_output",
38+
)

0 commit comments

Comments
 (0)