test eager and custom allreduce toggles
This commit is contained in:
@@ -431,3 +431,107 @@ self._decode_wrapper = BatchDecodeWithPagedKVCacheWrapper(...)
|
||||
- 直接在当前可用 xFormers 路径插桩。
|
||||
- 重点记录每 token decode 中 attention、MoE、sampler、TP 同步的耗时。
|
||||
- 当前平均 GPU 利用率低,profiling 比继续盲调参数更有价值。
|
||||
|
||||
## 2026-07-14:解除强制 eager / custom all-reduce 禁用验证
|
||||
|
||||
### 修改内容
|
||||
|
||||
本轮先处理 `vllm/engine/arg_utils.py` 中两个会掩盖真实性能路径的硬编码:
|
||||
|
||||
```python
|
||||
enforce_eager=True
|
||||
disable_custom_all_reduce=True
|
||||
```
|
||||
|
||||
改为尊重 CLI / dataclass 参数:
|
||||
|
||||
```python
|
||||
enforce_eager=self.enforce_eager
|
||||
disable_custom_all_reduce=self.disable_custom_all_reduce
|
||||
```
|
||||
|
||||
同时更新 `qwen3_6_scripts/patch_xformers_sdpa_seq.py`,让后续重新执行 patchops 时也会保留该行为。服务器实际运行路径已确认:
|
||||
|
||||
```text
|
||||
PYTHONPATH=/usr/local/corex/lib/python3/dist-packages:/usr/local/corex/lib64/python3/dist-packages
|
||||
```
|
||||
|
||||
因此运行时同时 patch 了:
|
||||
|
||||
- `/usr/local/corex/lib/python3/dist-packages/vllm/engine/arg_utils.py`
|
||||
- `/usr/local/corex/lib64/python3/dist-packages/vllm/engine/arg_utils.py`
|
||||
|
||||
远端运行时备份:
|
||||
|
||||
- `arg_utils.py.bak_20260714_eager_allreduce`
|
||||
|
||||
### 实验 1:CUDA Graph + custom all-reduce 同时开启
|
||||
|
||||
启动命令不再带 `--enforce-eager`,也不带 `--disable-custom-all-reduce`。
|
||||
|
||||
日志确认配置已生效:
|
||||
|
||||
```text
|
||||
disable_custom_all_reduce=False
|
||||
enforce_eager=False
|
||||
use_async_output_proc=True
|
||||
```
|
||||
|
||||
结果:服务未能完成启动,长时间卡在 CUDA Graph capture 阶段。
|
||||
|
||||
关键日志:
|
||||
|
||||
```text
|
||||
Capturing the model for CUDA graphs.
|
||||
[W CUDAGraph.cpp:145] Warning: Waiting for pending NCCL work to finish before starting graph capture.
|
||||
```
|
||||
|
||||
判断:当前 Iluvatar BI-V100 + CoreX + xFormers + TP=4 路径下,CUDA Graph capture 不可直接启用。它没有快速报错,而是卡在 graph capture / NCCL pending work 阶段,风险比普通参数不兼容更高。短期不建议继续沿 CUDA Graph 方向盲试。
|
||||
|
||||
本地归档:
|
||||
|
||||
- `worklogs/remote_results/2026-07-14-eager-allreduce/server_exp_graph_allreduce_seq2_b8192.log`
|
||||
|
||||
### 实验 2:仅开启 custom all-reduce,继续 eager
|
||||
|
||||
启动命令保留 `--enforce-eager`,但不再带 `--disable-custom-all-reduce`。
|
||||
|
||||
日志确认:
|
||||
|
||||
```text
|
||||
enforce_eager=True
|
||||
disable_custom_all_reduce=False
|
||||
```
|
||||
|
||||
服务可以正常启动并通过 `/health`。
|
||||
|
||||
decode microbench 结果:
|
||||
|
||||
| 配置 | 成功率 | TTFT P90 | Output TPS P10/req | Aggregate Output TPS | 对比旧结果 |
|
||||
| --- | ---: | ---: | ---: | ---: | --- |
|
||||
| short c1, 256 tok, custom AR on | 100% | 3.47s | 8.47 | 7.94 | 旧 full-parser c1 为 P10 8.74 / aggregate 8.34,略降 |
|
||||
| short c2, 128 tok, custom AR on | 100% | 1.46s | 4.22 | 8.07 | 旧 parser-off c2 aggregate 7.23,略升但口径不完全相同 |
|
||||
|
||||
本地归档:
|
||||
|
||||
- `worklogs/remote_results/2026-07-14-eager-allreduce/decode_eager_custom_ar_short_c1_t256_r3.json`
|
||||
- `worklogs/remote_results/2026-07-14-eager-allreduce/decode_eager_custom_ar_short_c2_t128_r4.json`
|
||||
- `worklogs/remote_results/2026-07-14-eager-allreduce/server_exp_eager_custom_ar_seq2_b8192_retry.log`
|
||||
|
||||
### 结论
|
||||
|
||||
1. 之前的硬编码确实屏蔽了真实配置,本轮已经解除,并确认修改落在实际运行的 CoreX site-packages 路径里。
|
||||
2. CUDA Graph 当前不兼容或存在严重启动卡死问题,不适合作为短期主优化方向。
|
||||
3. custom all-reduce 可以启动和推理,但收益有限:c2 聚合吞吐有小幅提升,c1 无提升。
|
||||
4. 当前 decode 吞吐仍在 8 tok/s 左右,距离 Output TPS P10 >= 20 仍有明显差距,瓶颈不只是 all-reduce 开关。
|
||||
|
||||
### 下一步 profiling 方向
|
||||
|
||||
优先进入代码级 profiling,而不是继续调 CLI 开关:
|
||||
|
||||
1. 在 `ModelRunner.execute_model` 统计模型 forward、logits、sample 的阶段耗时。
|
||||
2. 在 Qwen MoE 层统计 attention、MoE expert、MoE gate、TP all-reduce 的耗时占比。
|
||||
3. 在 fused MoE 路径统计 topk、expert kernel、activation、sum 的耗时。
|
||||
4. 用 `ENGINEX_PROFILE_DECODE=1` 这类环境变量控制插桩,只在短压测时开启,避免污染正式结果。
|
||||
|
||||
初步判断:custom all-reduce 不是第一大瓶颈;更可能的主战场是 xFormers decode attention、MoE 小 batch kernel、以及 TP 下大量小 kernel / 同步造成的低 GPU 利用率。
|
||||
|
||||
Reference in New Issue
Block a user