yy-fighting e6d9e99b6f feat: add SGLang vs vLLM controlled comparison experiment
- New experiments/dsv4_h200_sglang_vs_vllm/ with TP=8 on all 8 H200 cards
- Phase1 short-context throughput + Phase2 long context up to 200k
- Unified scenario matrix, warmup, parsing, and side-by-side comparison report
- H200 SGLang vs vLLM entry added to root README
2026-07-08 07:34:34 +00:00

73 lines
2.2 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.

# DSV4 H200 SGLang vs vLLM 对比实验
在 8x NVIDIA H200 上,用统一控制变量对比 SGLang 与 vLLM serving DeepSeek-V4-Flash。
## 设计原则
- 两个 backend 都使用 **TP=8**,绑定全部 8 张卡。
- 压测客户端统一使用 `sglang.bench_serving`
- 场景矩阵、并发、输入/输出长度、请求数对两个 backend 完全一致。
- 每个 phase 启动 server 后先做 warmup再跑正式压测。
- 短上下文和长上下文分阶段启动 server避免 `max-model-len` / `max-num-seqs` 显存冲突。
## 场景矩阵
### Phase 1短上下文吞吐max_model_len=32k
| Concurrency | Input | Output | Num prompts |
|---:|---:|---:|---:|
| 1 | 512 | 256 | 32 |
| 32 | 512 | 256 | 128 |
| 128 | 512 | 256 | 128 |
| 1 | 4000 | 512 | 32 |
| 32 | 4000 | 512 | 64 |
### Phase 2长上下文max_model_len=210k
| Concurrency | Input | Output | Num prompts |
|---:|---:|---:|---:|
| 1 | 32768 | 1024 | 8 |
| 1 | 65536 | 1024 | 4 |
| 1 | 131072 | 1024 | 2 |
| 1 | 200000 | 1024 | 1 |
## 快速运行
```bash
bash experiments/dsv4_h200_sglang_vs_vllm/run_bench.sh
```
结果保存在 `experiments/dsv4_h200_sglang_vs_vllm/results/<RUN_ID>/`
```
results/<RUN_ID>/
├── sglang/
│ ├── results.json
│ ├── report.md
│ └── raw_outputs/ # gitignored
├── vllm/
│ ├── results.json
│ ├── report.md
│ └── raw_outputs/ # gitignored
├── comparison.md
└── logs/
```
## 文件说明
| 文件 | 作用 |
|---|---|
| `config.env` | 公共配置:模型路径、端口、场景矩阵、虚拟环境 |
| `start_sglang.sh` | 按 phase 启动 SGLang server |
| `start_vllm.sh` | 按 phase 启动 vLLM server |
| `run_bench.sh` | 总 orchestrator跑 SGLang → 跑 vLLM → 生成对比报告 |
| `warmup.py` | 用 `sglang.bench_serving` 发送少量预热请求 |
| `parse_backend.py` | 解析单个 backend 的 raw jsonl 为 `results.json` + `report.md` |
| `compare.py` | 读取两个 backend 的 `results.json`,生成 `comparison.md` |
## 环境
- SGLM server: `/data/user1/yy/envs/sglang`
- vLLM server: `/data/user1/yy/envs/vllm`
- Benchmark client: `/data/user1/yy/envs/sglang`(统一用该环境的 `sglang.bench_serving`