Prhub

#24924 [AMD] Pin cache-dit==1.3.0 in rocm.Dockerfile + AMD CI install script

原始 PR 作者 bingxche 合并时间 2026-05-11 22:32 文件变更 3 提交数 6 评论 7 代码增减 +3 / -3

执行摘要

修复 AMD CI 因 cache-dit 版本不匹配导致的测试失败

修复 sglang-ci-bot 每日报告中记录的 AMD CI 全红问题,根源是 cache-dit 版本锁定在 1.1.8,而新测试 case 依赖 >=1.2.0 的特性。详情见 PR body 对 root cause 的详细分析。

值得精读,尤其是 PR body 对 root cause 的详细追查链条以及 review 中对 Dockerfile no-op 的指出。展示了正确的依赖修正路径——从源头的 pyproject 出发,而非在安装脚本中打补丁。

讨论亮点

cursor[bot] 在 review 中指出了 Dockerfile 修改的无效性:"This install is overwritten a few lines below... pip will downgrade cache-dit from 1.3.0 back to 1.1.8"。这一发现直接引发了 revert 并转向修正真正的版本源头 pyproject_other.toml。

实现拆解

  1. 修复版本锁定源头:修改 python/pyproject_other.tomldiffusion_hip extra 的 cache-dit==1.1.8 改为 ==1.3.0,这是 ROCm Dockerfile 在构建时实际解析的依赖来源。
  2. 同步 wheel 配置:修改 3rdparty/amd/wheel/sglang/pyproject.toml 中相同的依赖锁定,确保 amd-sglang wheel 构建时也使用 1.3.0。
  3. CI 安装脚本桥接:修改 scripts/ci/amd/amd_ci_install_dependency.sh,将无版本的 pip install cache-dit 改为 pip install --upgrade 'cache-dit==1.3.0',这样即使 CI 镜像尚未重建也能强制升级到 1.3.0。一旦新镜像部署,该行将变成空操作。
  4. Revert 无效 Dockerfile 修改:最初尝试在 Dockerfile 中直接安装 1.3.0,但 review 指出由于下一行 pip install 会重新读取 pyproject_other.toml 从而降级回 1.1.8,该修改为 no-op,已被 revert。
文件 模块 状态 重要度
python/pyproject_other.toml 依赖配置 modified 4.33
3rdparty/amd/wheel/sglang/pyproject.toml 依赖配置 modified 3.93
scripts/ci/amd/amd_ci_install_dependency.sh 部署脚本 modified 3.58

关键源码片段

python/pyproject_other.toml configuration

这是版本锁定的源头:ROCm Dockerfile 在构建时依赖此文件决定 diffusion_hip 的版本。将 cache-dit 从 1.1.8 改为 1.3.0 根本上修复了镜像构建时的版本偏斜。

# python/pyproject_other.toml (diffusion_hip extra)
# 此 section 是 AMD ROCm Dockerfile 在构建时实际解析的依赖配置
# 升级 cache-dit 版本以匹配 python/pyproject.toml 中的最新锁定
[diffusion_hip]
dependencies = [
  "sglang[diffusion_common]",
  "peft>=0.18.0,<0.19.0",
  "st_attn==0.0.7",
  "vsa==0.0.4",
  "runai_model_streamer>=0.15.5",
  "cache-dit==1.3.0", # 之前是 ==1.1.8, 升级以支持 --cache-dit-config 所需的 >=1.2.0 特性
]
3rdparty/amd/wheel/sglang/pyproject.toml configuration

amd-sglang wheel 的依赖配置,需要与 python/pyproject_other.toml 保持同步,确保 wheel 构建也使用正确版本。

# 3rdparty/amd/wheel/sglang/pyproject.toml (diffusion_hip extra)
# 与 python/pyproject_other.toml 保持同步,确保 wheel 构建版本一致
[diffusion_hip]
dependencies = [
  "PyYAML==6.0.1",
  "cloudpickle",
  "diffusers==0.37.0",
  "imageio==2.36.0",
  "imageio-ffmpeg==0.5.1",
  "moviepy>=2.0.0",
  "opencv-python-headless==4.10.0.84",
  "remote-pdb",
  "st_attn==0.0.7",
  "vsa==0.0.4",
  "runai_model_streamer>=0.15.5",
  "cache-dit==1.3.0", # 与 pyproject_other.toml 同步升级
  "addict",
]

评论区精华

Dockerfile 修改为 no-op 正确性

cursor[bot] 指出在 Dockerfile 中直接安装 cache-dit==1.3.0 会被后续的 pip install -e "python[srt_hip,diffusion_hip]" 覆盖降级,因此是空操作。

结论:作者接受 review 意见,revert 了 Dockerfile 修改,改为修正真正的版本源头 pyproject_other.toml。 · 已解决

安装脚本修改验证 正确性

cursor[bot] 确认 scripts/ci/amd/amd_ci_install_dependency.sh 的修改正确:加上 --upgrade 和固定版本可以强制升级存量镜像,且未来新镜像部署后变为空操作。

结论:修改被认可,合入最终版本。 · 已解决

风险与影响

该 PR 仅涉及安装脚本和 pyproject 文件的版本号修改,不涉及任何模型代码或运行时逻辑。风险极低。但需注意 diffusion_musa 依赖尚未同步(仍锁定 1.1.8),PR body 已标识为 follow-up。

直接影响:修复 AMD CI 中所有使用 --cache-dit-config 的 test case(如 qwen_image_t2i_cache_dit_scm_config_diffusers_1gpu 和 wan2_1_t2v)。间接影响:新构建的 ROCm 镜像将默认包含 cache-dit==1.3.0,减少 CI 安装阶段的升级开销。对用户或生产系统无影响。

依赖版本偏斜 跨平台配置不同步

关联 Issue

未识别关联 Issue

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

完整报告

参与讨论