Prhub

#47682 [XPU] limit max-num-seqs in test_lmeval.py for XPU

原始 PR 作者 mayuyuace 合并时间 2026-07-06 13:34 文件变更 1 提交数 2 评论 0 代码增减 +3 / -2

执行摘要

限制 XPU 上 lmeval 测试 max-num-seqs

XPU 设备上默认的 max-num-seqs 会导致测试失败(OOM 或设备错误),因此需要限制并发序列数以适配 XPU 内存限制。

该 PR 价值较小,主要为解决特定硬件 CI 测试失败而设。无需精读,但体现了平台差异化的测试适配做法。

实现拆解

tests/entrypoints/openai/correctness/test_lmeval.pytest_lm_eval_accuracy_v1_engine 函数中,将条件判断从 if current_platform.is_tpu() 扩展为 if current_platform.is_tpu() or current_platform.is_xpu(),使得 XPU 平台也传入 --max-num-seqs 64 参数。该变更仅涉及条件分支,不影响其他平台。

文件 模块 状态 重要度
tests/entrypoints/openai/correctness/test_lmeval.py 测试 modified 3.26

关键源码片段

tests/entrypoints/openai/correctness/test_lmeval.py test-coverage

修改了测试函数中的平台条件判断,新增 XPU 支持。

# tests/entrypoints/openai/correctness/test_lmeval.pydef test_lm_eval_accuracy_v1_engine():
    """Run with the V1 Engine."""
    more_args = []
​
    # Limit compilation time for V1 on TPU
    # Avoid OOM on XPU
    if current_platform.is_tpu() or current_platform.is_xpu():
        more_args = ["--max-num-seqs", "64"]
​
    run_test(more_args)

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

风险极低:仅修改测试条件判断,为 XPU 平台增加与 TPU 相同的限制。不会影响产品代码或非 XPU 测试行为。

仅影响 Intel GPU(XPU)环境的 lmeval 测试,使之通过。其他平台无影响。

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论