执行摘要
- 一句话:跳过 fork 依赖的 CPU logits 测试以修复 Intel CI
- 推荐动作:此 PR 是简单的 CI 修复,无需精读。但可关注 future improvement:将条件跳过逻辑迁移到测试文件内部,使用环境变量判断 XPU 并 skip,提高可维护性。
功能与动机
XPU 不支持 fork,导致依赖 fork 的 logits processor 测试 (test_custom_offline.py) 在 Intel CI 中失败。PR body 直接说明了原因:"XPU does not support fork, causing the CI to fail, so this PR skips the fork-dependent test."
实现拆解
- 修改 Intel CI 配置文件
.buildkite/intel_jobs/misc_intel.yaml,在 v1/logits_processors 测试的 pytest 命令中添加 --ignore=v1/logits_processors/test_custom_online.py --ignore=v1/logits_processors/test_custom_offline.py 参数。
- 该变更仅影响 Intel GPU (XPU) 的 CI 流水线,对其它平台无影响。
- 提交历史显示经过两次修正才确定忽略文件列表,最终同时忽略了 online 和 offline 两个文件。
关键文件:
.buildkite/intel_jobs/misc_intel.yaml(模块 CI 配置;类别 config;类型 configuration): Intel CI 配置文件中修改了 pytest 命令,添加 --ignore 参数以跳过两个 fork 依赖的测试文件。
关键符号:未识别
关键源码片段
.buildkite/intel_jobs/misc_intel.yaml
Intel CI 配置文件中修改了 pytest 命令,添加 --ignore 参数以跳过两个 fork 依赖的测试文件。
# .buildkite/intel_jobs/misc_intel.yaml
# 变更:在 Intel GPU CI 的 logits processors 测试步骤中,
# 跳过依赖 fork 的测试文件,避免 XPU 不支持 fork 导致的失败
commands:
- >-
bash .buildkite/scripts/hardware_ci/run-intel-test.sh
'export VLLM_WORKER_MULTIPROC_METHOD=spawn &&
cd tests &&
# 跳过 online 和 offline 两个依赖 fork 的测试
pytest -v -s v1/logits_processors
--ignore=v1/logits_processors/test_custom_online.py
--ignore=v1/logits_processors/test_custom_offline.py &&
pytest -v -s v1/test_oracle.py &&
pytest -v -s v1/test_request.py &&
pytest -v -s v1/test_outputs.py'
评论区精华
Review 评论中,gemini-code-assist[bot] 建议改用 pytest markers 在测试文件内部条件跳过,认为这样更利于维护。但最终 PR 采用了 CI 配置层面的忽略方式,并在 jikunshang 批准后合并。
- 使用 pytest markers 替代 CI --ignore (design): 未采纳该建议,最终仍使用 --ignore 方式。
风险与影响
- 风险:低风险。仅影响 Intel CI 的测试执行命令,不影响任何生产代码。忽略的测试文件在其他平台上仍会运行。但建议未来考虑在测试文件内使用 pytest.mark.skipif 条件跳过,以避免 CI 配置与测试逻辑的耦合。
- 影响:影响范围很小,仅 Intel GPU (XPU) CI 不再运行
test_custom_offline.py 和 test_custom_online.py,从而避免了 fork 相关失败。对于其他平台无影响。
- 风险标记:CI 配置与测试逻辑耦合, 低风险
关联脉络
- PR #41895 [Bugfix] Fix XPU/ROCm compatibility in spawn_new_process_for_each_test: 同样涉及 XPU 兼容性修复,与 fork/spawn 问题相关。
- PR #42039 [CI][Bugfix] Drop duplicated examples/ prefix in tensorize_vllm_model command: 同样是 CI 配置修复。
- PR #41943 [CI][Bugfix] Surface subprocess output in spawn_new_process_for_each_test: 同样与 spawn 模式和多进程测试相关。
参与讨论