Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/unittest_ppu_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-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()
Expand Down
46 changes: 46 additions & 0 deletions docker/Dockerfile.ppu
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions docs/source/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,9 @@ bash scripts/build_wheel.sh release
```bash
bash scripts/build_docker.sh
```

**构建PPU镜像**

```bash
bash scripts/build_docker_ppu.sh
```
22 changes: 22 additions & 0 deletions scripts/build_docker_ppu.sh
Original file line number Diff line number Diff line change
@@ -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}
16 changes: 16 additions & 0 deletions scripts/promote_docker_ppu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -e

# Promote tzrec-test:<tag>-ppu<suffix> to tzrec-devel:<tag>-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 <tag>/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
2 changes: 1 addition & 1 deletion tzrec/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading