[CI Failure]: [AMD] Nixl PD tests

用户在 AMD ROCm CI 环境中运行 vLLM 的 Nixl 测试脚本 v1/kv_connector/nixl_integration/tp_config_sweep_accuracy_test.sh 时触发。该测试涉及 KV Cache 在 vLLM 分布式推理中的跨 GPU/节点传输。

[CI Failure]: [AMD] Nixl PD tests

[CI Failure]: [AMD] Nixl PD tests

快速结论:该报错发生在 AMD ROCm CI 的 Nixl PD 测试中,原因是 Nixl 构建时缺少 UCX 后端导致的 KeyError。优先排查 Nixl 构建配置中是否启用了 UCX 后端,或者设置为仅使用 cuda_ipc 后端。

问题场景

用户在 AMD ROCm CI 环境中运行 vLLM 的 Nixl 测试脚本 v1/kv_connector/nixl_integration/tp_config_sweep_accuracy_test.sh 时触发。该测试涉及 KV Cache 在 vLLM 分布式推理中的跨 GPU/节点传输。

报错原文

(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]     self.model_runner.initialize_kv_cache(kv_cache_config)
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]   File "/usr/local/lib/python3.12/dist-packages/vllm/v1/worker/gpu_model_runner.py", line 5020, in initialize_kv_cache
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]     kv_transfer_group.register_kv_caches(kv_caches)
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]   File "/usr/local/lib/python3.12/dist-packages/vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py", line 256, in register_kv_caches
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]     self.connector_worker.register_kv_caches(kv_caches)
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]   File "/usr/local/lib/python3.12/dist-packages/vllm/distributed/kv_transfer/kv_connector/v1/nixl_connector.py", line 1244, in register_kv_caches
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]     self.nixl_wrapper.register_memory(descs, backends=self.nixl_backends)
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]   File "/usr/local/lib/python3.12/dist-packages/nixl_cu12/_api.py", line 383, in register_memory
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]     handle_list.append(self.backends[backend_string])
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822]                        ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
(Worker_TP0 pid=1295) ERROR 11-20 07:10:15 [multiproc_executor.py:822] KeyError: 'UCX'

原因分析

可能原因:Nixl 包在 AMD CI 上安装时未包含 UCX 后端(UCX 需要从源码构建),导致运行时尝试访问 UCX 后端时出现 KeyError: 'UCX'。根据 Issue 评论,后续已在 ROCm Dockerfile 中构建了 UCX,以解决该问题。

环境排查

  • 确认 Nixl 包的安装方式,是否包含了 UCX 后端(查看 Dockerfile.rocm 中 UCX 构建步骤)。
  • 检查环境变量 NIXL_BACKENDS 的设置,若未设置 UCX,可确认是否仅需要 cuda_ipc 后端。
  • 确认测试执行时的 ROCm 和 vLLM 版本,以及 Buildkite CI 构建号(如 build #1088)。

解决步骤

  1. 优先尝试:设置环境变量 export NIXL_BACKENDS=cuda_ipc,以跳过 UCX 后端,仅使用 cuda_ipc 后端进行 KV Cache 传输。
  2. 若需要 UCX 支持,确保在 Docker 镜像或运行环境中从源码构建 UCX,并在构建 Nixl 时启用 UCX 后端。
  3. 验证 Dockerfile.rocm 中是否已包含 UCX 构建步骤,如 Issue 评论所述“UCX now built in the ROCm dockerfile”。
  4. 如果问题依然存在,检查 /usr/local/lib/python3.12/dist-packages/nixl_cu12/_api.pybackends 字典的内容,确认 UCX 是否被加载。

验证方法

重新运行测试脚本 v1/kv_connector/nixl_integration/tp_config_sweep_accuracy_test.sh,观察是否仍出现 KeyError: 'UCX' 报错。如果测试通过,则问题解决。

参考来源

vllm-project/vllm #29176

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

celebrityanime
celebrityanime
文章: 12016

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注