# PR #6839 完整报告

- 仓库：`verl-project/verl`
- 标题：[ci] chore: fix vllm_ascend ci
- 合并时间：2026-07-01 14:50
- 原文链接：http://prhub.com.cn/verl-project/verl/pull/6839

---

# 执行摘要

- 一句话：修复 vLLM Ascend CI 测试配置
- 推荐动作：这是一个低风险的 CI 修复 PR，值得立即合并。开发者在涉及随机性的测试中应始终设置种子以提高稳定性。

# 功能与动机

PR body 明确指出目的是“fix vllm_ascend ci”，解决当前 CI 中因缺乏种子设置导致测试结果不稳定或失败的问题。

# 实现拆解

1. **CI 步骤名称调整**：在 `.github/workflows/vllm_ascend.yml` 中，将 agent loop 测试步骤名从 "Test the latest vLLM Rollout async with agent loop" 改为 "Test the latest vLLM Rollout async with agent loop with seed 0(non deter)"，在名称上明确使用了种子 0，便于识别测试模式。
2. **测试配置增加种子**：在 `tests/experimental/agent_loop/test_multi_modal.py` 的 `init_config` fixture 中，为 rollout 配置添加了 `config.actor_rollout_ref.rollout.seed = 0`，使测试使用固定种子，提高可重现性。
3. **其他修改**：commit 历史中曾包含对 `hccl_checkpoint_engine.py` 的修改（将 `torch.npu.empty_cache()` 替换为设备无关调用），但最终未出现在 PR 的文件变更中，说明该修改可能被分离到其他 PR 或丢弃。

关键文件：
- `tests/experimental/agent_loop/test_multi_modal.py`（模块 多模态；类别 test；类型 test-coverage）: 多模态测试 fixture 中增加了 rollout.seed=0 配置，确保测试可复现性。
- `.github/workflows/vllm_ascend.yml`（模块 CI；类别 infra；类型 infrastructure）: CI 工作流中 agent loop 测试步骤名被更新以反映种子设置，便于排查问题。

关键符号：未识别

## 关键源码片段

### `tests/experimental/agent_loop/test_multi_modal.py`

多模态测试 fixture 中增加了 rollout.seed=0 配置，确保测试可复现性。

```python
@pytest.fixture
def init_config() -> DictConfig:
    from hydra import compose, initialize_config_dir

    with initialize_config_dir(config_dir=os.path.abspath("verl/trainer/config")):
        config = compose(
            config_name="ppo_trainer",
            overrides=[
                "actor_rollout_ref.actor.use_dynamic_bsz=true",
                # test sleep/wake_up with fsdp offload
                "actor_rollout_ref.actor.fsdp_config.param_offload=True",
                "actor_rollout_ref.actor.fsdp_config.optimizer_offload=True",
            ],
        )

    model_path = os.path.expanduser("~/models/Qwen/Qwen2.5-VL-3B-Instruct")
    config.actor_rollout_ref.model.path = model_path
    config.actor_rollout_ref.rollout.name = os.environ["ROLLOUT_NAME"]
    config.actor_rollout_ref.rollout.mode = "async"
    config.actor_rollout_ref.rollout.enforce_eager = True
    config.actor_rollout_ref.rollout.prompt_length = 10240
    config.actor_rollout_ref.rollout.response_length = 4096
    config.actor_rollout_ref.rollout.n = 4
    # 新增：固定随机种子为 0，确保测试结果可重现
    config.actor_rollout_ref.rollout.seed = 0
    config.actor_rollout_ref.rollout.agent.num_workers = 2
    config.actor_rollout_ref.rollout.skip_tokenizer_init = True

    return config

```

# 评论区精华

无 reviewer 评论或讨论。

- 暂无高价值评论线程

# 风险与影响

- 风险：变更极小（仅 2 个文件，共 3 行改动），且仅涉及 CI 步骤名称和测试配置的种子设置，不触及核心逻辑，回归风险极低。
- 影响：直接影响 vLLM Ascend CI 的稳定性，通过固定随机种子使测试结果可复现，减少随机性导致的假阳性失败。不影响用户功能和系统性能。
- 风险标记：低风险变更

# 关联脉络

- 暂无明显关联 PR