Commit abf04d0d authored by laibao's avatar laibao
Browse files

Revert "更新README.md,添加VLLM_USE_FLASH_ATTN_PA环境变量到示例命令,并修正了一些文件路径和参数说明,以提高文档的准确性和可读性。"

This reverts commit 6ca0f9f5.
parent 6ca0f9f5
...@@ -115,27 +115,27 @@ VLLM_USE_FLASH_ATTN_PA=1 python examples/offline_inference/basic/basic.py ...@@ -115,27 +115,27 @@ VLLM_USE_FLASH_ATTN_PA=1 python examples/offline_inference/basic/basic.py
1、指定输入输出 1、指定输入输出
```bash ```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、使用数据集 2、使用数据集
下载数据集: 下载数据集:
[sharegpt_v3_unfiltered_cleaned_split](https://huggingface.co/datasets/learnanything/sharegpt_v3_unfiltered_cleaned_split) [sharegpt_v3_unfiltered_cleaned_split](https://huggingface.co/datasets/learnanything/sharegpt_v3_unfiltered_cleaned_split)
```bash ```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服务推理性能测试 ### OpenAI api服务推理性能测试
1.启动服务: 1.启动服务:
```bash ```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.启动客户端 2.启动客户端
...@@ -151,7 +151,7 @@ python benchmarks/benchmark_serving.py --model /your/model/path --dataset-name s ...@@ -151,7 +151,7 @@ python benchmarks/benchmark_serving.py --model /your/model/path --dataset-name s
启动服务: 启动服务:
```bash ```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中的预定义聊天模板。 这里sreve之后为加载模型路径,`--dtype`为数据类型:float16,默认情况使用tokenizer中的预定义聊天模板。
...@@ -174,7 +174,7 @@ curl http://localhost:8000/v1/chat/completions \ ...@@ -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结合使用** ### **gradio和vllm结合使用**
...@@ -189,7 +189,7 @@ pip install gradio ...@@ -189,7 +189,7 @@ pip install gradio
2.1 启动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 更改文件权限 2.2 更改文件权限
...@@ -209,13 +209,13 @@ ssh -L 8000:计算节点IP:8000 -L 8001:计算节点IP:8001 用户名@登录节 ...@@ -209,13 +209,13 @@ ssh -L 8000:计算节点IP:8000 -L 8001:计算节点IP:8001 用户名@登录节
3.启动OpenAI兼容服务 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服务 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.使用对话服务 5.使用对话服务
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment