Files
enginex-mlu370-vllm/vllm-v0.6.2/tools/utils/README.md
2026-02-04 17:22:39 +08:00

23 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### 1. 非page模式max_num_seqs自动调优工具
对于MLU370X8平台在unpage模式下可以通过调整`max_num_seqs`来提升性能。`tune_max_num_seqs.py`通过自动调参来搜索最佳`max_num_seqs`值。
- 用法示例
搜索固定配置下,使吞吐量最大`max_num_seqs`值,其中参数部分保持与`benchmark_latency.py`/`benchmark_throughput.py`一致。
```bash
python tools/utils/tune_max_num_seqs.py --backend vllm --input-len 1024 --output-len 1024 --model /Path/to/Llama-2-70b-chat-hf/ -tp 1 --max-model-len 4096 --dtype float16 --num-prompts 10
```
通过执行上述命令,可以搜索得到最优`max_num_seqs`配置在构建LLM对象时作为参数传入使用。
### 2. vLLM调度分析辅助工具
首先设置环境变量开启调度profilingexport VLLM_SCHEDULER_PROFILE=true
对于离线测试,测试结束后,会自动保存数据并打印出当前已经运行请求的信息
对于在线测试,获取调度数据的步骤如下:
1. 启动server
2. 运行client端测试
3. 等待client测试结束后立即运行python3 tools/utils/post_scheduler_view_action.py --host [server端ip地址] --port [server端口号] --action save请求server端将数据保存下来
4. server端会打印出当前已经运行请求的信息
5. 如果想再次运行client测试基于现有server先运行python3 tools/utils/post_scheduler_view_action.py --host [server端ip地址] --port [server端口号] --action init恢复server端然后重复2、3、4