Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perf000 doker #407

Open
wants to merge 2 commits into
base: cpm-ant-plus
Choose a base branch
from
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
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
venv
.venv
__pycache__
.idea
.vscode
*.pb
*.tsv
.DS_Store
*.pyc
.env
*.pt
.ipynb_checkpoints
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ARG CUDA_IMAGE=11.7.0-devel-ubuntu18.04
FROM nvidia/cuda:${CUDA_IMAGE} as cuda_source
FROM continuumio/miniconda3:22.11.1

# Proxy (if needed)
ARG HTTP_PROXY
ENV HTTPS_PROXY=${HTTP_PROXY}
ENV http_proxy=${HTTP_PROXY}
ENV https_proxy=${HTTP_PROXY}

# Build packages
RUN apt-get update \
&& apt-get install -y --allow-downgrades --allow-change-held-packages --no-install-recommends \
ibverbs-providers \
libibverbs1 \
librdmacm1 \
vim \
g++ \
&& apt-get clean

# Copy cuda devel from nvidia docker
ARG CUDA=11.7
ENV CUDA_HOME=/usr/local/cuda-${CUDA}
COPY --from=cuda_source ${CUDA_HOME} ${CUDA_HOME}

COPY cpm-live /cpm-live
WORKDIR /cpm-live

RUN conda config --set channel_priority strict && \
conda env create -f conda-environment.yaml && conda clean -q -y -a

# Replace the shell binary with activated conda env
RUN echo "conda activate "`conda env list | tail -2 | cut -d' ' -f1` >> ~/.bashrc
SHELL ["/bin/bash", "--login", "-c"]

# Default entrypoint
CMD ["/bin/bash", "--login"]
19 changes: 19 additions & 0 deletions cpm-live/conda-environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: cpm-live
channels:
- pytorch
- nvidia
- conda-forge
- huggingface
dependencies:
- python=3.10
- pytorch==1.13.1=py3.10_cuda11.7_cudnn8.5.0_0
- torchvision=0.14.1
- torchaudio=0.13.1
- pytorch-cuda=11.7
- pip=23.0
- pip:
- bmtrain==0.2.1
- jieba==0.42
- tensorboard==2.12
- tqdm==4.65
- opendelta==0.3.2
2 changes: 1 addition & 1 deletion cpm-live/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ include = ["cpm_live"]
[tool.black]
line-length = 100
target-version = ['py37']
include = '\.pyi?$'
include = '\.pyi?$'