build base too

This commit is contained in:
Wing Lian
2023-05-07 09:48:41 -04:00
parent 4a79dabff0
commit 14ebd2e007
4 changed files with 54 additions and 16 deletions

21
docker/Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM huggingface/transformers-pytorch-deepspeed-latest-gpu:latest
ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
RUN apt-get update && \
apt-get install -y build-essential ninja-build vim git-lfs && \
git lfs install --skip-repo && \
mkdir /tmp/wheels && \
cd /tmp/wheels && \
curl -L -O https://github.com/winglian/axolotl/raw/wheels/wheels/deepspeed-0.9.2%2B7ddc3b01-cp38-cp38-linux_x86_64.whl && \
curl -L -O https://github.com/winglian/axolotl/raw/wheels/wheels/flash_attn-1.0.4-cp38-cp38-linux_x86_64.whl && \
pip install deepspeed-0.9.2%2B7ddc3b01-cp38-cp38-linux_x86_64.whl && \
pip install flash_attn-1.0.4-cp38-cp38-linux_x86_64.whl && \
pip install "peft @ git+https://github.com/huggingface/peft.git@main" --force-reinstall --no-dependencies
WORKDIR /workspace
ARG REF=main
RUN git clone https://github.com/winglian/axolotl && cd axolotl && git checkout $REF && \
pip install -e .[int4]
RUN pip3 install --force-reinstall https://download.pytorch.org/whl/nightly/cu117/torch-2.0.0.dev20230301%2Bcu117-cp38-cp38-linux_x86_64.whl --index-url https://download.pytorch.org/whl/nightly/cu117

25
docker/Dockerfile-base Normal file
View File

@@ -0,0 +1,25 @@
ARG CUDA_VERSION="11.8.0"
ARG CUDNN_VERSION="8"
ARG UBUNTU_VERSION="22.04"
FROM nvidia/cuda:$CUDA_VERSION-cudnn$CUDNN_VERSION-devel-ubuntu$UBUNTU_VERSION
ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PYTHON_VERSION="3.9"
ENV PYTHON_VERSION=$PYTHON_VERSION
RUN apt-get update
RUN apt-get install -y wget && rm -rf /var/lib/apt/lists/*
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
RUN conda create -n "py${PYTHON_VERSION}" python="${PYTHON_VERSION}"
ENV PATH="/root/miniconda3/envs/py${PYTHON_VERSION}/bin:${PATH}"
WORKDIR /workspace