Prhub

#7028 [env] fix: Sync Qwen3.5 Dockerfile from 0.8.0 Branch to Main and Pin PyArrow Version

原始 PR 作者 ruanhao566 合并时间 2026-07-13 19:44 文件变更 3 提交数 1 评论 3 代码增减 +27 / -7

执行摘要

同步 Qwen3.5 Dockerfile 并固定 PyArrow 版本

需要在 main 分支上为 Qwen3.5 模型提供正确的 Ascend 环境 Dockerfile,并修复 PyArrow 25.0.0 引入的不兼容问题。PR body 明确指出'pin the PyArrow version to <=24.0.0 to avoid issues with version 25.0.0'。

值得精读 Dockerfile 以了解 Qwen3.5 在 Ascend 上的环境依赖。但 git clone 策略建议参考 bot 意见改进,以免后续 CI 构建不稳定。

讨论亮点

Gemini Code Assist bot 对两个 Dockerfile 中的 git clone 策略提出了改进建议:使用 --depth 1 后再 git fetch --depth 1 origin <sha> 效率低且不可靠,推荐使用 blobless clone (--filter=blob:none) 以更可靠地获取指定 commit。但该建议未被采纳,PR 最终由 wucong25 批准合并。

实现拆解

  1. docker/ascend/Dockerfile.ascend_9.0.0_a2Dockerfile.ascend_9.0.0_a3 中统一进行以下修改:
    • 添加克隆 Megatron-Bridge 和 transformers 仓库并 checkout 到指定 commit 的步骤。
    • 在 x86_64 架构下额外安装 torchvision==0.24.0+cpu
    • 将 transformers 从 pip install transformers==5.3.0 改为从本地克隆的源码编辑安装。
    • 安装 nvidia-modelopt[torch], flash-linear-attention, qwen_vl_utils, viztracer, mathruler 等依赖。
    • 在 Dockerfile 末尾设置 PYTHONPATH 包含 Megatron-Bridge 的 src 目录。
  2. requirements-npu.txt 中将 pyarrow 版本约束从 >=15.0.0 改为 >=15.0.0,<=24.0.0,以阻止 25.0.0 的安装。
  3. 这是一个一次 commit 的简单同步,未涉及测试或配置文件的变更。
文件 模块 状态 重要度
docker/ascend/Dockerfile.ascend_9.0.0_a2 Docker 构建 modified 4.18
docker/ascend/Dockerfile.ascend_9.0.0_a3 Docker 构建 modified 4.18
requirements-npu.txt 依赖管理 modified 2.12

分析完成后,这里会展示 LLM 生成的相对完整源码片段和详细注释。

评论区精华

Git clone 策略优化 性能

gemini-code-assist[bot] 指出使用 'git clone --depth 1' 后跟 'git fetch --depth 1 origin <sha>' 效率低且不可靠,推荐使用 '--filter=blob:none' 进行 blobless clone。

结论:建议未被采纳,PR 原样合并。 · 已解决

风险与影响

低风险。变更集中于 Ascend Dockerfile 和 NPU requirements 文件,不涉及核心训练/推理逻辑。但 Dockerfile 中的 git clone 方式若网络不稳定可能导致构建失败(bot 已指出),且依赖版本固定可能在未来需要更新。

影响范围限定于使用 Ascend 环境并运行 Qwen3.5 训练的用户。这些用户将获得正确的 Docker 构建环境和兼容的 PyArrow 版本。对 NVIDIA 等其他硬件平台无影响。

构建环境依赖 未采纳 CI 优化建议

关联 Issue

未识别关联 Issue

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

完整报告

参与讨论