Skip to content

Commit f9230b3

Browse files
committed
[feat]: update tests and example for dbo
Signed-off-by: zhuohuan <zxdu1997@gmail.com>
1 parent 85bc104 commit f9230b3

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

examples/offline_dualbatch_overlap_npu.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@
88
os.environ["VLLM_USE_V1"] = "1"
99

1010
# Sample prompts.
11-
prompts = [
12-
"Hello, my name is",
13-
"The president of the United States is",
14-
"The capital of France is",
15-
"The future of AI is",
16-
] * 10
11+
prompts = ["The president of the United States is"] * 41
1712
# Create a sampling params object.
18-
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
13+
sampling_params = SamplingParams(max_tokens=100, temperature=0.0)
1914

2015

2116
def main():
2217
# Create an LLM.
2318
llm = LLM(
24-
model="deepseek-ai/DeepSeek-V2-Lite",
19+
model="deepseek-ai/DeepSeek-V3-Lite-base-latest-w8a8-dynamic",
2520
hf_overrides={
2621
"architectures": ["DeepseekDBOForCausalLM"],
2722
}, # override the model arch to run the dbo model
2823
enforce_eager=True,
29-
tensor_parallel_size=8,
30-
max_num_seqs=16,
31-
max_model_len=8192,
32-
max_num_batched_tokens=32768,
33-
block_size=128,
34-
compilation_config=1,
35-
gpu_memory_utilization=0.96)
24+
tensor_parallel_size=2,
25+
max_model_len=4096,
26+
trust_remote_code=True,
27+
additional_config={
28+
"torchair_graph_config": {
29+
"enabled": False
30+
},
31+
"ascend_scheduler_config": {
32+
"enabled": True
33+
},
34+
"expert_tensor_parallel_size": 1
35+
})
3636

3737
# Generate texts from the prompts. The output is a list of RequestOutput
3838
# objects that contain the prompt, generated text, and other information.

tests/multicard/test_offline_inference_distributed.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ def test_models_distributed_topk() -> None:
8585

8686
@patch.dict(os.environ, {"VLLM_ASCEND_ENABLE_DBO": "1"})
8787
def test_models_distributed_DeepSeek_dbo():
88-
example_prompts = [
89-
"Compare and contrast artificial intelligence with human intelligence in terms of processing information.",
90-
] * 10
88+
example_prompts = ["The president of the United States is"] * 41
9189
dtype = "half"
92-
max_tokens = 5
90+
sampling_params = SamplingParams(max_tokens=100, temperature=0.0)
9391
with VllmRunner(
9492
"deepseek-ai/DeepSeek-V2-Lite",
9593
dtype=dtype,
@@ -99,4 +97,4 @@ def test_models_distributed_DeepSeek_dbo():
9997
"architectures": ["DeepseekDBOForCausalLM"],
10098
} # override the model arch to the dbo version
10199
) as vllm_model:
102-
vllm_model.generate_greedy(example_prompts, max_tokens)
100+
vllm_model.generate(example_prompts, sampling_params)

0 commit comments

Comments
 (0)