Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
Qwen3_vllm
Commits
abf04d0d
Commit
abf04d0d
authored
Aug 09, 2025
by
laibao
Browse files
Revert "更新README.md,添加VLLM_USE_FLASH_ATTN_PA环境变量到示例命令,并修正了一些文件路径和参数说明,以提高文档的准确性和可读性。"
This reverts commit
6ca0f9f5
.
parent
6ca0f9f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
README.md
README.md
+10
-10
No files found.
README.md
View file @
abf04d0d
...
...
@@ -115,27 +115,27 @@ VLLM_USE_FLASH_ATTN_PA=1 python examples/offline_inference/basic/basic.py
1、指定输入输出
```
bash
VLLM_USE_FLASH_ATTN_PA
=
1
python benchmarks/benchmark_throughput.py
--num-prompts
1
--input-len
32
--output-len
128
--model
/your/model/path
-tp
1
--trust-remote-code
--enforce-eager
--dtype
float16
python benchmarks/benchmark_throughput.py
--num-prompts
1
--input-len
32
--output-len
128
--model
/your/model/path
-tp
1
--trust-remote-code
--enforce-eager
--dtype
float16
```
其中
`--num-prompts`
是batch数,
`--input-len`
是输入seqlen,
`--output-len`
是输出token长度,
`--model`
为模型路径,
`-tp`
为使用卡数,
`dtype="float16"`
为推理数据类型
。若
模型权重
为
bfloat16
,建议设置
`--dtype bfloat16`
或使用
`--dtype auto`
以匹配权重精度
。若指定
`--output-len 1`
即为首字延迟。
其中
`--num-prompts`
是batch数,
`--input-len`
是输入seqlen,
`--output-len`
是输出token长度,
`--model`
为模型路径,
`-tp`
为使用卡数,
`dtype="float16"`
为推理数据类型
,如果
模型权重
是
bfloat16
,需要修改为float16推理
。若指定
`--output-len 1`
即为首字延迟。
2、使用数据集
下载数据集:
[
sharegpt_v3_unfiltered_cleaned_split
](
https://huggingface.co/datasets/learnanything/sharegpt_v3_unfiltered_cleaned_split
)
```
bash
VLLM_USE_FLASH_ATTN_PA
=
1
python benchmarks/benchmark_throughput.py
--num-prompts
1
--model
/your/model/path
--dataset-name
sharegpt
--dataset-path
/path/to/ShareGPT_V3_unfiltered_cleaned_split.json
-tp
1
--trust-remote-code
--enforce-eager
--dtype
float16
python benchmarks/benchmark_throughput.py
--num-prompts
1
--model
/your/model/path
--dataset-name
sharegpt
--dataset-path
/path/to/ShareGPT_V3_unfiltered_cleaned_split.json
-tp
1
--trust-remote-code
--enforce-eager
--dtype
float16
```
其中
`--num-prompts`
是batch数,
`--model`
为模型路径,
`--dataset`
为使用的数据集,
`-tp`
为使用卡数,
`dtype="float16"`
为推理数据类型
。若
模型权重
为
bfloat16
,建议设置
`--dtype bfloat16`
或使用
`--dtype auto`
以匹配权重精度
。
其中
`--num-prompts`
是batch数,
`--model`
为模型路径,
`--dataset`
为使用的数据集,
`-tp`
为使用卡数,
`dtype="float16"`
为推理数据类型
,如果
模型权重
是
bfloat16
,需要修改为float16推理
。
### OpenAI api服务推理性能测试
1.
启动服务:
```
bash
VLLM_USE_FLASH_ATTN_PA
=
1
vllm serve
--model
/your/model/path
--enforce-eager
--dtype
float16
--trust-remote-code
-
-tensor-parallel-size
1
vllm serve
--model
/your/model/path
--enforce-eager
--dtype
float16
--trust-remote-code
-
tp
1
```
2.
启动客户端
...
...
@@ -151,7 +151,7 @@ python benchmarks/benchmark_serving.py --model /your/model/path --dataset-name s
启动服务:
```
bash
VLLM_USE_FLASH_ATTN_PA
=
1
vllm serve /your/model/path
--enforce-eager
--dtype
float16
--trust-remote-code
vllm serve /your/model/path
--enforce-eager
--dtype
float16
--trust-remote-code
```
这里sreve之后为加载模型路径,
`--dtype`
为数据类型:float16,默认情况使用tokenizer中的预定义聊天模板。
...
...
@@ -174,7 +174,7 @@ curl http://localhost:8000/v1/chat/completions \
}'
```
或者使用
[
examples/
online_serving/
openai_chat
_
completion_client.py
](
examples/
online_serving/
openai_chat
_
completion_client.py
)
或者使用
[
examples/openai_chatcompletion_client.py
](
examples/openai_chatcompletion_client.py
)
### **gradio和vllm结合使用**
...
...
@@ -189,7 +189,7 @@ pip install gradio
2.1 启动gradio服务,根据提示操作
```
python
examples/online_serving/
gradio_openai_chatbot_webserver.py --model "/your/model/path" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids ""
python
gradio_openai_chatbot_webserver.py --model "/your/model/path" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids ""
```
2.2 更改文件权限
...
...
@@ -209,13 +209,13 @@ ssh -L 8000:计算节点IP:8000 -L 8001:计算节点IP:8001 用户名@登录节
3.
启动OpenAI兼容服务
```
VLLM_USE_FLASH_ATTN_PA=1
vllm serve /your/model/path --enforce-eager --dtype float16 --trust-remote-code --host "0.0.0.0"
vllm serve /your/model/path --enforce-eager --dtype float16 --trust-remote-code --host "0.0.0.0"
```
4.
启动gradio服务
```
python
examples/online_serving/
gradio_openai_chatbot_webserver.py --model "/your/model/path" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids "" --host "0.0.0.0" --port 8001
python
gradio_openai_chatbot_webserver.py --model "/your/model/path" --model-url http://localhost:8000/v1 --temp 0.8 --stop-token-ids "" --host "0.0.0.0" --port 8001
"
```
5.
使用对话服务
...
...
laibao
@laibao
mentioned in commit
8bba7afc
·
Aug 09, 2025
mentioned in commit
8bba7afc
mentioned in commit 8bba7afc8fbdd078ed3e283a4765b6fb44cff613
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment