From 26346897744c7fef38a798f2d27d983d5033696c Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Sun, 7 May 2023 02:58:21 -0400 Subject: [PATCH] build dockerfile in gha --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ Dockerfile | 19 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..42f1e3a76 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: ci + +on: + push: + branches: + - "main" + - "dev" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 +# - name: Login to Docker Hub +# uses: docker/login-action@v2 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: false + tags: winglian/axolotl:latest + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..824a04560 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM huggingface/transformers-pytorch-deepspeed-latest-gpu:latest + +RUN export 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 && \ + 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 && \ + mdir /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 +RUN pip install -e .[int4]