From 5bf2b69071ae846b4bba4eec193e76333b5c6131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=82=91?= Date: Mon, 27 Jul 2026 17:49:14 +0800 Subject: [PATCH 1/4] [ci] bump ppu unit test image to tzrec-test:1.2-ppu --- .github/workflows/unittest_ppu_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest_ppu_ci.yml b/.github/workflows/unittest_ppu_ci.yml index 43c99472b..b29393d0d 100644 --- a/.github/workflows/unittest_ppu_ci.yml +++ b/.github/workflows/unittest_ppu_ci.yml @@ -43,7 +43,7 @@ jobs: -v "$WORK_ROOT/_tool":/__w/_tool \ -v "$WORK_ROOT/_temp/_github_home":/github/home \ -v "$WORK_ROOT/_temp/_github_workflow":/github/workflow \ - mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec/tzrec-devel:1.1-ppu \ + mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec/tzrec-test:1.2-ppu \ bash -c 'mkdir -p /__w/TorchEasyRec/tzrec-ci-cache/triton /__w/TorchEasyRec/tzrec-ci-cache/inductor && cd run_${{ github.run_id }} && bash scripts/ci/ci_test_ppu.sh' - name: StopDockerContainer if: always() From 1adcbb47b9c8ee678f34855988ed0272f54e2583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=82=91?= Date: Mon, 17 Aug 2026 16:10:57 +0800 Subject: [PATCH 2/4] [ci] build the PPU image from this repo The PPU image was built out of tree, so it drifted from requirements/ whenever the release pins moved and could not be reproduced from a checkout. Move the build in: docker/Dockerfile.ppu installs the PPU torch/triton/faiss builds from the FlyTiger Eco pypi index on top of the vendor PPU base image and then installs requirements.txt like the other images do. PPU build and promotion get their own scripts because the image is validated on its own cadence and may lag the cpu/cu* images. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01H5JspSJLDuxSnprexTKwba --- .github/workflows/unittest_ppu_ci.yml | 2 +- docker/Dockerfile.ppu | 46 +++++++++++++++++++++++++++ docs/source/develop.md | 6 ++++ scripts/build_docker_ppu.sh | 22 +++++++++++++ scripts/promote_docker_ppu.sh | 16 ++++++++++ 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 docker/Dockerfile.ppu create mode 100644 scripts/build_docker_ppu.sh create mode 100755 scripts/promote_docker_ppu.sh diff --git a/.github/workflows/unittest_ppu_ci.yml b/.github/workflows/unittest_ppu_ci.yml index b29393d0d..ddec377bb 100644 --- a/.github/workflows/unittest_ppu_ci.yml +++ b/.github/workflows/unittest_ppu_ci.yml @@ -43,7 +43,7 @@ jobs: -v "$WORK_ROOT/_tool":/__w/_tool \ -v "$WORK_ROOT/_temp/_github_home":/github/home \ -v "$WORK_ROOT/_temp/_github_workflow":/github/workflow \ - mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec/tzrec-test:1.2-ppu \ + mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec/tzrec-test:1.2-ppu-u1 \ bash -c 'mkdir -p /__w/TorchEasyRec/tzrec-ci-cache/triton /__w/TorchEasyRec/tzrec-ci-cache/inductor && cd run_${{ github.run_id }} && bash scripts/ci/ci_test_ppu.sh' - name: StopDockerContainer if: always() diff --git a/docker/Dockerfile.ppu b/docker/Dockerfile.ppu new file mode 100644 index 000000000..838b4e479 --- /dev/null +++ b/docker/Dockerfile.ppu @@ -0,0 +1,46 @@ +ARG BASE_IMAGE +FROM ${BASE_IMAGE} + +RUN sed -i "s@http://archive.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list.d/ubuntu.sources && \ + sed -i "s@http://security.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list.d/ubuntu.sources && \ + sed -i "s@http://ports.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list.d/ubuntu.sources && \ + apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y --no-install-recommends \ + build-essential ca-certificates \ + ccache cmake gcc git vim watchman wget curl sudo iproute2 && \ + rm -rf /var/lib/apt/lists/* + +RUN wget https://tzrec.oss-accelerate.aliyuncs.com/third_party/libidn11_1.33-2.2ubuntu2_amd64.deb && \ + apt-get install ./libidn11_1.33-2.2ubuntu2_amd64.deb && rm libidn11_1.33-2.2ubuntu2_amd64.deb + +ARG PIP_MIRROR=mirrors.aliyun.com +RUN mkdir -p /root/.config/pip && \ + printf '[global]\nindex-url = http://%s/pypi/simple\ntrusted-host = %s\ntimeout = 120\n' "${PIP_MIRROR}" "${PIP_MIRROR}" > /root/.config/pip/pip.conf + +ARG PPU_PIP_INDEX +RUN pip install torch==2.11.0 triton==3.6.0 -i ${PPU_PIP_INDEX} && \ + pip install fbgemm-gpu==1.6.0 faiss==1.14.1 -i ${PPU_PIP_INDEX} && \ + pip install torchmetrics==1.0.3 tensordict && \ + pip install torchrec==1.6.0 -f https://tzrec.oss-accelerate.aliyuncs.com/third_party/torchrec/repo.html && \ + pip cache purge + +ENV NVIDIA_VISIBLE_DEVICES all +ENV NVIDIA_DRIVER_CAPABILITIES compute,utility + +ADD requirements /root/requirements +ADD requirements.txt /root/requirements.txt +RUN cd /root && \ + pip install -r requirements.txt && \ + rm -rf requirements requirements.txt && \ + pip cache purge + +RUN mkdir -p /home/pai/bin && \ + wget -O /home/pai/bin/prepare_dlc_environment https://tzrec.oss-accelerate.aliyuncs.com/third_party/pai/prepare_dlc_environment.sh && \ + chmod +x /home/pai/bin/prepare_dlc_environment && \ + apt-get update && apt-get install -y --no-install-recommends openssh-server && rm -rf /var/lib/apt/lists/* && service ssh start +ENV PATH $PATH:/home/pai/bin + +ENV SHELL=/bin/bash +RUN echo "dash dash/sh boolean false" | debconf-set-selections \ + && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash diff --git a/docs/source/develop.md b/docs/source/develop.md index e9df7ebf9..b92eac670 100644 --- a/docs/source/develop.md +++ b/docs/source/develop.md @@ -75,3 +75,9 @@ bash scripts/build_wheel.sh release ```bash bash scripts/build_docker.sh ``` + +**构建PPU镜像** + +```bash +bash scripts/build_docker_ppu.sh +``` diff --git a/scripts/build_docker_ppu.sh b/scripts/build_docker_ppu.sh new file mode 100644 index 000000000..97f43f7ef --- /dev/null +++ b/scripts/build_docker_ppu.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -eo pipefail + +# Build the PPU image on top of the vendor PPU base image. torch/triton/faiss are the +# PPU builds from the FlyTiger Eco pypi index; everything else comes from requirements/. + +REGISTRY=mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec +REPO_NAME=tzrec-test +DOCKER_TAG=1.2 +DOCKER_TAG_SUFFIX=-u1 +BASE_IMAGE=pkg.flytiger-eco.com/docker_release/ppu:v2.1.1-cuda13.0-ubuntu24-py312 +PPU_PIP_INDEX=https://pkg.flytiger-eco.com/artifactory/api/pypi/pypi_index/simple + +rm -rf docker/requirements* +cp -r requirements*.txt docker/ +cp -r requirements/ docker/requirements +cd docker + +docker build --network host -f Dockerfile.ppu -t ${REGISTRY}/${REPO_NAME}:${DOCKER_TAG}-ppu${DOCKER_TAG_SUFFIX} \ + --build-arg BASE_IMAGE=${BASE_IMAGE} --build-arg PPU_PIP_INDEX=${PPU_PIP_INDEX} \ + ${PIP_MIRROR:+--build-arg PIP_MIRROR=${PIP_MIRROR}} . +docker push ${REGISTRY}/${REPO_NAME}:${DOCKER_TAG}-ppu${DOCKER_TAG_SUFFIX} diff --git a/scripts/promote_docker_ppu.sh b/scripts/promote_docker_ppu.sh new file mode 100755 index 000000000..2d082bef8 --- /dev/null +++ b/scripts/promote_docker_ppu.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -e + +# Promote tzrec-test:-ppu to tzrec-devel:-ppu after PPU CI passes. +# Separate from promote_docker.sh: the PPU image is built and validated on its own +# cadence and may lag the cpu/cu* images, and it never takes the /latest aliases. + +REGISTRY=mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec +SRC_REPO=tzrec-test +DST_REPO=tzrec-devel +DOCKER_TAG=1.2 +DOCKER_TAG_SUFFIX=-u1 + +docker pull ${REGISTRY}/${SRC_REPO}:${DOCKER_TAG}-ppu${DOCKER_TAG_SUFFIX} +docker tag ${REGISTRY}/${SRC_REPO}:${DOCKER_TAG}-ppu${DOCKER_TAG_SUFFIX} ${REGISTRY}/${DST_REPO}:${DOCKER_TAG}-ppu +docker push ${REGISTRY}/${DST_REPO}:${DOCKER_TAG}-ppu From f241cc38de1f9689b5184db3dde527fb53984488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=82=91?= Date: Fri, 21 Aug 2026 19:53:36 +0800 Subject: [PATCH 3/4] [chore] bump version to 1.2.24 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01H5JspSJLDuxSnprexTKwba --- tzrec/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tzrec/version.py b/tzrec/version.py index 2c5a4359b..11af76c87 100644 --- a/tzrec/version.py +++ b/tzrec/version.py @@ -9,4 +9,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.2.23" +__version__ = "1.2.24" From 0b3123e361e880842d5e3abbcc7d13416511440c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=82=91?= Date: Sat, 22 Aug 2026 04:22:46 +0800 Subject: [PATCH 4/4] [ci] point the ppu lane at tzrec-devel:1.2-ppu (promoted image) Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01H5JspSJLDuxSnprexTKwba --- .github/workflows/unittest_ppu_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittest_ppu_ci.yml b/.github/workflows/unittest_ppu_ci.yml index ddec377bb..6bca35fff 100644 --- a/.github/workflows/unittest_ppu_ci.yml +++ b/.github/workflows/unittest_ppu_ci.yml @@ -43,7 +43,7 @@ jobs: -v "$WORK_ROOT/_tool":/__w/_tool \ -v "$WORK_ROOT/_temp/_github_home":/github/home \ -v "$WORK_ROOT/_temp/_github_workflow":/github/workflow \ - mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec/tzrec-test:1.2-ppu-u1 \ + mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec/tzrec-devel:1.2-ppu \ bash -c 'mkdir -p /__w/TorchEasyRec/tzrec-ci-cache/triton /__w/TorchEasyRec/tzrec-ci-cache/inductor && cd run_${{ github.run_id }} && bash scripts/ci/ci_test_ppu.sh' - name: StopDockerContainer if: always()