Skip to content

Commit

Permalink
Refactoring the requirements and add a Dockerfile for dev (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
aoyulong authored Jun 4, 2024
1 parent 495d472 commit f57bde0
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 16 deletions.
40 changes: 40 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM nvcr.io/nvidia/pytorch:24.05-py3

ENV DEBIAN_FRONTEND noninteractive
ENV TZ=Asia/Shanghai

##############################################################################
# Change apt source to Ksyun
##############################################################################
RUN sed -i "s#\S\+#http://apt.ksyun.cn/ubuntu/#2" /etc/apt/sources.list && \
> /etc/apt/apt.conf.d/docker-clean && \
> /etc/dpkg/dpkg.cfg.d/pkg-config-hook-config

##############################################################################
# Install basic utilities
##############################################################################
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl wget vim tmux less unzip \
htop iftop iotop ca-certificates openssh-client openssh-server \
rsync iputils-ping net-tools \
tzdata psmisc screen && \
apt-get clean

##############################################################################
# SSH configuration (not secure, only for development purpose)
##############################################################################
RUN mkdir -p /run/sshd && \
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa && \
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && \
echo "StrictHostKeyChecking no\n" >> /etc/ssh/ssh_config

##############################################################################
# Install Miniconda
##############################################################################
RUN mkdir -p ~/miniconda3 && \
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 || { echo 'Miniconda installation failed' ; exit 1; } && \
rm -rf ~/miniconda3/miniconda.sh && \
~/miniconda3/bin/conda init bash || { echo 'conda init failed' ; exit 1; } && \
~/miniconda3/bin/conda config --set auto_activate_base false || { echo 'conda config failed' ; exit 1; }
6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

25 changes: 25 additions & 0 deletions requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# build tools
packaging
setuptools>=49.4.0
wheel

# testing
pytest
pytest_mock
pytest-cov
pytest-forked
pytest-asyncio
pytest-rerunfailures
pytest-shard

# formatting
black==24.4.2
codespell==2.2.6
isort==5.13.2
clang-format==18.1.5

# type checking
mypy==1.10.0

# pre-commit
pre-commit>=2.20.0
16 changes: 16 additions & 0 deletions requirements/requirements-inf-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# mirror from vllm repo with some modifications

# testing utils
awscli
einops # required for MPT
httpx
peft
requests
ray
sentence-transformers # required for embedding

# Benchmarking
aiohttp

# Multimodal
pillow
18 changes: 18 additions & 0 deletions requirements/requirements-inf.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# mirror from vllm repo with some modifications
torch
fastapi
aiohttp
openai
uvicorn[standard]
pydantic >= 2.0 # Required for OpenAI server.
prometheus_client >= 0.18.0
prometheus-fastapi-instrumentator >= 7.0.0
lm-format-enforcer == 0.10.1
outlines == 0.0.34 # Requires torch >= 2.1.0
typing_extensions
filelock >= 3.10.4 # filelock starts to support `mode` argument from 3.10.4

# Uncomment the following lines if you don't compile them from source
# xformers
# vllm-flash-attn
# vllm-nccl-cu12
3 changes: 3 additions & 0 deletions requirements/requirements-train-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pip install git+https://github.com/fanshiqing/[email protected]
nltk
wrapt
4 changes: 4 additions & 0 deletions requirements/requirements-train.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
torch
wandb
deepspeed
dlrover[torch]
18 changes: 18 additions & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake >= 3.21
hydra-core
ninja
psutil
numpy
requests
py-cpuinfo
sentencepiece
transformers >= 4.40.0
tokenizers >= 0.19.1
tiktoken >= 0.6.0
ray >= 2.9
matplotlib
py3nvml
graphviz
tqdm
mpi4py
nvidia-ml-py
10 changes: 0 additions & 10 deletions requirements_dev.txt

This file was deleted.

0 comments on commit f57bde0

Please sign in to comment.