-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] upgrade torchrec to 1.0.0 (#19)
- Loading branch information
1 parent
55d2874
commit 0d34ca6
Showing
14 changed files
with
74 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,44 @@ | ||
FROM pytorch/pytorch:2.4.0-cuda12.1-cudnn9-devel | ||
FROM ubuntu:22.04 | ||
|
||
RUN sed -i "s@http://archive.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list && \ | ||
sed -i "s@http://security.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list && \ | ||
sed -i "s@http://ports.ubuntu.com@http://mirrors.aliyun.com@g" /etc/apt/sources.list && \ | ||
apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y git vim watchman wget | ||
apt-get install -y --no-install-recommends \ | ||
build-essential ca-certificates \ | ||
ccache cmake gcc git vim watchman wget curl && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN wget https://tzrec.oss-cn-beijing.aliyuncs.com/third_party/libidn11_1.33-2.2ubuntu2_amd64.deb && \ | ||
apt-get install ./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 | ||
|
||
ADD pip.conf /root/.config/pip/pip.conf | ||
RUN curl -fsSL -v -o ~/miniconda.sh -O "https://tzrec.oss-cn-beijing.aliyuncs.com/third_party/Miniforge3-Linux-x86_64.sh" && \ | ||
chmod +x ~/miniconda.sh && \ | ||
bash ~/miniconda.sh -b -p /opt/conda && \ | ||
rm ~/miniconda.sh && \ | ||
/opt/conda/bin/conda update -y -n base -c defaults conda && \ | ||
/opt/conda/bin/conda install -y python=3.11 && \ | ||
/opt/conda/bin/conda clean -ya | ||
ENV PATH /opt/conda/bin:$PATH | ||
|
||
RUN pip install fbgemm-gpu==0.8.0 --index-url https://download.pytorch.org/whl/cu121 && \ | ||
pip install torchmetrics==1.0.3 && \ | ||
pip install torchrec==0.8.0 --index-url https://download.pytorch.org/whl/cu121 && \ | ||
pip install torch_tensorrt==2.4.0 | ||
ARG DEVICE | ||
RUN case ${DEVICE} in \ | ||
"cu121") pip install torch==2.5.0 fbgemm-gpu==1.0.0 --index-url https://download.pytorch.org/whl/cu121 && \ | ||
pip install torchmetrics==1.0.3 torch_tensorrt==2.5.0 && \ | ||
pip install torchrec==1.0.0 --index-url https://download.pytorch.org/whl/cu121 ;; \ | ||
* ) pip install torch==2.5.0 fbgemm-gpu==1.0.0 --index-url https://download.pytorch.org/whl/cpu && \ | ||
pip install torchmetrics==1.0.3 && \ | ||
pip install torchrec==1.0.0 --index-url https://download.pytorch.org/whl/cpu ;; \ | ||
esac && \ | ||
/opt/conda/bin/conda clean -ya | ||
|
||
ENV NVIDIA_VISIBLE_DEVICES all | ||
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility | ||
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64 | ||
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:$PATH | ||
|
||
ADD requirements.txt /root/requirements.txt | ||
ADD requirements /root/requirements | ||
RUN cd /root && pip install -r requirements.txt | ||
RUN cd /root && pip install -r requirements.txt && rm requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
REGISTRY=mybigpai-public-registry.cn-beijing.cr.aliyuncs.com/easyrec | ||
DOCKER_TAG=0.5 | ||
DOCKER_TAG=0.6 | ||
|
||
cp requirements.txt docker/ | ||
rm -rf docker/requirements | ||
cp -r requirements/ docker/requirements | ||
cd docker | ||
|
||
docker build -t ${REGISTRY}/tzrec-devel:latest . | ||
docker images -q ${REGISTRY}/tzrec-devel:latest | xargs -I {} docker tag {} ${REGISTRY}/tzrec-devel:${DOCKER_TAG} | ||
docker push ${REGISTRY}/tzrec-devel:latest | ||
for DEVICE in cu121 cpu | ||
do | ||
docker build --network host -t ${REGISTRY}/tzrec-devel:${DOCKER_TAG}-${DEVICE} --build-arg DEVICE=${DEVICE} . | ||
docker push ${REGISTRY}/tzrec-devel:${DOCKER_TAG}-${DEVICE} | ||
done | ||
|
||
docker images -q ${REGISTRY}/tzrec-devel:${DOCKER_TAG}-cu121 | xargs -I {} docker tag {} ${REGISTRY}/tzrec-devel:${DOCKER_TAG} | ||
docker images -q ${REGISTRY}/tzrec-devel:${DOCKER_TAG}-cu121 | xargs -I {} docker tag {} ${REGISTRY}/tzrec-devel:latest | ||
docker push ${REGISTRY}/tzrec-devel:${DOCKER_TAG} | ||
docker push ${REGISTRY}/tzrec-devel:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters