Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ jobs:
for name in "${!docker_files[@]}"
do
md5_value=`md5sum tools/dockerfile/${docker_files[$name]} | awk '{print $1}'`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 优先级:P1
处理要求:请针对该评论修复并提交新的 commit。

这里仍然只用 Dockerfile.develop.dtk 的内容 md5 作为 docker_dcu 镜像 tag,但当前最新提交只修改了 tools/dockerfile/build_scripts/install_gcc.shDockerfile.develop.dtk 的 md5 仍是上一轮的 881e30f7ca65be3eb3c04ea34e44c030。由于该 Dockerfile 通过 COPY tools/dockerfile/build_scripts /build_scripts 引入脚本,现有逻辑会继续拉取同一个 docker_dcu 镜像 tag;如果上一轮镜像已存在,docker pull 成功后就不会重新 build,install_gcc.sh 的 Kylin/lib64 修复不会进入实际 DCU 镜像,也无法验证本 PR 的目标环境。

建议把 docker_dcu 实际 COPY 的脚本也纳入 cache key,或采用等价方式确保 build_scripts 变更会触发 DCU 镜像重建。一个最小修复形态如下:

Suggested change
md5_value=`md5sum tools/dockerfile/${docker_files[$name]} | awk '{print $1}'`
if [ "$name" == "docker_dcu" ]; then
md5_value=`md5sum tools/dockerfile/${docker_files[$name]} tools/dockerfile/build_scripts/install_gcc.sh | md5sum | awk '{print $1}'`
else
md5_value=`md5sum tools/dockerfile/${docker_files[$name]} | awk '{print $1}'`
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 优先级:P1
处理要求:请针对该评论修复并提交新的 commit。

补充当前 head ab2a5596fd175cdcda2edfac405d727be77b19cd 的复查结果:Dockerfile.develop.dtk 现在又回到 md5 881e30f7ca65be3eb3c04ea34e44c030,而 install_gcc.sh 仍是修改后的 a6ec0a16bc1ebde45ea6f329c87638d1。因此 docker_dcu 仍只会生成旧的 Dockerfile tag,若该 tag 已存在就会复用旧镜像,install_gcc.sh 的最新修复仍无法保证进入实际 DCU 镜像。请把 install_gcc.sh/build_scripts 纳入 docker_dcu hash,或用等价方式确保脚本变更触发新的镜像 tag。

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 优先级:P1
处理要求:请针对该评论修复并提交新的 commit。

删除 docker_dcu 固定 md5 后,这里的 md5sum tools/dockerfile/${docker_files[$name]} 也会在 inputs.is_merge == "true" 的路径执行。该路径上面只下载 ci_dockerfile.shDockerfile.ubuntu20,而 ci_dockerfile.sh 只生成 CPU/SOT/build/coverage 相关 Dockerfile,不会生成 Dockerfile.develop.dtk,也没有 tools/dockerfile/build_scripts;默认 task=cpudocker_files 仍包含 docker_dcu。因此 merge-mode 会先得到空 md5,再尝试 docker build -f tools/dockerfile/Dockerfile.develop.dtk .,最终因为 Dockerfile/构建上下文缺失而失败。

请让 merge-mode 的 docker_dcu 路径也有完整输入,或在该模式下显式复用已有 DCU tag。一个可实现的修复形态如下:

if [ "${{ inputs.is_merge }}" == "true" ]; then
  mkdir -p tools/dockerfile/build_scripts
  cd tools/dockerfile
  wget -q --tries=5 --no-proxy \
    ${dockerfile_script} \
    ${dockerfile_origin} \
    https://raw.githubusercontent.com/PaddlePaddle/Paddle/refs/heads/develop/tools/dockerfile/Dockerfile.develop.dtk \
    --no-check-certificate
  cd build_scripts
  wget -q --tries=5 --no-proxy \
    https://raw.githubusercontent.com/PaddlePaddle/Paddle/refs/heads/develop/tools/dockerfile/build_scripts/install_gcc.sh \
    --no-check-certificate
  cd ..
else
  ...
fi

if [ $name == "docker_dcu" ]; then
md5_value="76937a563116f6008c8ca4cb4f592759"
fi
if [ $name == "docker_npu" ]; then
md5_value="a3793bdeea5ae881a0c1eaf4d7c30c64"
fi
Expand Down
2 changes: 1 addition & 1 deletion cmake/hip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ list(APPEND HIP_CXX_FLAGS -Wno-missing-braces)
list(APPEND HIP_CXX_FLAGS -Wno-sometimes-uninitialized)
list(APPEND HIP_CXX_FLAGS -Wno-deprecated-copy)
list(APPEND HIP_CXX_FLAGS -Wno-pessimizing-move)
list(APPEND HIP_CXX_FLAGS -std=c++17)
list(APPEND HIP_CXX_FLAGS -std=c++20)

This comment was marked as outdated.

list(APPEND HIP_CXX_FLAGS --gpu-max-threads-per-block=1024)
Comment on lines 200 to 202

if(CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down
14 changes: 7 additions & 7 deletions tools/dockerfile/Dockerfile.develop.dtk
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ RUN yum install -y bzip2-devel openssh-server elfutils-devel diffutils libtool i
openssl-devel libjpeg-turbo-devel libpng-devel ninja-build pciutils libzstd-devel zstd

COPY tools/dockerfile/build_scripts /build_scripts
RUN bash /build_scripts/install_gcc.sh gcc82
RUN ln -sf /usr/local/gcc-8.2/bin/gcc /usr/local/bin/gcc
RUN ln -sf /usr/local/gcc-8.2/bin/g++ /usr/local/bin/g++
RUN ln -sf /usr/local/gcc-8.2/bin/gcc /usr/bin/gcc
RUN ln -sf /usr/local/gcc-8.2/bin/g++ /usr/bin/g++
ENV PATH=/usr/local/gcc-8.2/bin:$PATH
RUN bash /build_scripts/install_gcc.sh gcc122
RUN ln -sf /usr/local/gcc-12.2/bin/gcc /usr/local/bin/gcc
RUN ln -sf /usr/local/gcc-12.2/bin/g++ /usr/local/bin/g++
RUN ln -sf /usr/local/gcc-12.2/bin/gcc /usr/bin/gcc
RUN ln -sf /usr/local/gcc-12.2/bin/g++ /usr/bin/g++
ENV PATH=/usr/local/gcc-12.2/bin:$PATH

# workdir
WORKDIR /opt
Expand Down Expand Up @@ -100,7 +100,7 @@ RUN yum clean all && \
rm -rf /var/lib/yum/history

# Install DTK
RUN wget -q --no-proxy https://cancon.hpccube.com:65024/file/1/DTK-24.04.1/CentOS7.6/DTK-24.04.1-CentOS7.6-x86_64.tar.gz --no-check-certificate && \
RUN wget -q --no-proxy https://download.sourcefind.cn:65024/file/1/DTK-24.04.1/CentOS7.6/DTK-24.04.1-CentOS7.6-x86_64.tar.gz --no-check-certificate && \
tar zxf DTK-24.04.1-CentOS7.6-x86_64.tar.gz && rm -rf DTK-24.04.1-CentOS7.6-x86_64.tar.gz
# Replace if you use other device type, e.g. Z100, Z100L, K100
RUN wget -q https://paddle-device.bj.bcebos.com/dcu/hyhal-K100AI.tar.gz && \
Expand Down
12 changes: 6 additions & 6 deletions tools/dockerfile/build_scripts/install_gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
# Stop at any error, show all commands
set -ex

if [ -f "/etc/redhat-release" ];then
lib_so_5=/usr/lib64/libgfortran.so.5
lib_so_6=/usr/lib64/libstdc++.so.6
lib_path=/usr/lib64
else
if [ -e "/usr/lib/x86_64-linux-gnu/libstdc++.so.6" ];then
lib_so_5=/usr/lib/x86_64-linux-gnu/libstdc++.so.5
lib_so_6=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
lib_path=/usr/lib/x86_64-linux-gnu
else
lib_so_5=/usr/lib64/libgfortran.so.5
lib_so_6=/usr/lib64/libstdc++.so.6
lib_path=/usr/lib64
fi

if [ "$1" == "gcc82" ]; then
Expand All @@ -43,7 +43,7 @@ if [ "$1" == "gcc82" ]; then
../gcc-8.2.0/configure --prefix=/usr/local/gcc-8.2 --enable-threads=posix --disable-checking --disable-multilib && \
make -j8 && make install
cd .. && rm -rf temp_gcc82 gcc-8.2.0 gcc-8.2.0.tar.xz
if [ -f "/etc/redhat-release" ];then
if [ "${lib_path}" == "/usr/lib64" ];then
cp ${lib_so_6} ${lib_so_6}.bak && rm -f ${lib_so_6} &&
ln -s /usr/local/gcc-8.2/lib64/libgfortran.so.5 ${lib_so_5} && \
ln -s /usr/local/gcc-8.2/lib64/libstdc++.so.6 ${lib_so_6} && \
Expand Down
Loading