执行摘要
修复 ROCm 上 spec decode 测试的间歇性故障
ROCm CI 在 Buildkite build 11367 中,test_ngram_and_suffix_correctness 测试(ngram 案例完成、引擎关机超时后,suffix 案例出现异步 GPU 故障)间歇性失败,需要提升测试稳定性。
该 PR 是典型的 CI 稳定性修复,技术价值有限但对 ROCm 持续集成很重要。建议合并。
无 review 评论。
ROCm CI 在 Buildkite build 11367 中,test_ngram_and_suffix_correctness 测试(ngram 案例完成、引擎关机超时后,suffix 案例出现异步 GPU 故障)间歇性失败,需要提升测试稳定性。
该 PR 是典型的 CI 稳定性修复,技术价值有限但对 ROCm 持续集成很重要。建议合并。
无 review 评论。
disable_vllm_compile_cache_on_rocm:在 tests/v1/e2e/spec_decode/test_spec_decode.py 中定义一个自动使用的 fixture,仅在 ROCm 平台下通过 request.getfixturevalue("disable_vllm_compile_cache") 调用已有的 disable_vllm_compile_cache fixture,避免 vLLM 编译缓存影响。VllmRunner 上下文管理器:将 test_ngram_and_suffix_correctness 中的手动 LLM 创建、删除、缓存清除和分布式清理替换为 vllm_runner 上下文管理器,利用其内置的 60 秒关机超时、分布式清理和 ROCm 内存等待机制。from vllm.config import CompilationConfig 导入,并给测试函数添加 @pytest.mark.usefixtures("disable_vllm_compile_cache_on_rocm") 装饰器。通过 compilation_config=CompilationConfig() 保持默认编译配置,避免 VllmRunner 注入缩小的测试编译大小。| 文件 | 模块 | 状态 | 重要度 |
|---|---|---|---|
tests/v1/e2e/spec_decode/test_spec_decode.py |
推测解码 | modified | 5.65 |
tests/v1/e2e/spec_decode/test_spec_decode.py
test-coverage
唯一变更文件,通过新增 ROCm 平台编译缓存隔离和替换 VllmRunner 上下文管理器来稳定测试。
# tests/v1/e2e/spec_decode/test_spec_decode.py
# ( 省略 import 部分 )
@pytest.fixture
def disable_vllm_compile_cache_on_rocm(request: pytest.FixtureRequest) -> None:
"""仅在 ROCm 平台下禁用 vLLM 编译缓存,避免缓存冲突引起故障"""
if current_platform.is_rocm():
request.getfixturevalue("disable_vllm_compile_cache")
@pytest.mark.parametrize(
"speculative_config",
[
{
"method": "ngram",
"prompt_lookup_max": 5,
"prompt_lookup_min": 3,
"num_speculative_tokens": 3,
},
{
"method": "suffix",
"suffix_decoding_max_spec_factor": 2.0,
},
],
)
@pytest.mark.usefixtures("disable_vllm_compile_cache_on_rocm")
@single_gpu_only
@large_gpu_mark(min_gb=20)
def test_ngram_and_suffix_correctness(
speculative_config: dict,
model_name: str,
vllm_runner,
):
"""使用 VllmRunner 上下文管理器保证引擎优雅关闭和内存清理"""
with vllm_runner(
model_name,
trust_remote_code=False,
enable_chunked_prefill=None,
speculative_config=speculative_config,
max_model_len=4096,
# 保持 LLM 默认编译 / cudagraph 配置,防止 VllmRunner 注入测试专用缩小尺寸
compilation_config=CompilationConfig(),
) as runner:
evaluate_llm_for_gsm8k(runner.llm)
当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。
低风险。变更仅限于测试文件,未改动生产代码。新增 fixture 仅在 ROCm 平台生效,不影响其他平台。VllmRunner 上下文管理器的使用在 vLLM 测试中已有广泛先例,可靠性可接受。
直接影响 ROCm CI 中 ngram/suffix spec decode 正确性测试的稳定性,降低间歇性故障率。对用户和生产路径无影响。
当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。
参与讨论