default to qlora support, make gptq specific image
Browse files- .github/workflows/base.yml +14 -1
- README.md +2 -2
- docker/Dockerfile +7 -1
- scripts/setup-runpod.sh +0 -43
- setup.py +2 -2
.github/workflows/base.yml
CHANGED
|
@@ -18,10 +18,22 @@ jobs:
|
|
| 18 |
cuda_version: 11.8.0
|
| 19 |
cuda_version_bnb: "118"
|
| 20 |
pytorch: 2.0.0
|
|
|
|
| 21 |
- cuda: cu117
|
| 22 |
cuda_version: 11.7.0
|
| 23 |
cuda_version_bnb: "117"
|
| 24 |
pytorch: 1.13.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
steps:
|
| 26 |
- name: Checkout
|
| 27 |
uses: actions/checkout@v3
|
|
@@ -43,7 +55,7 @@ jobs:
|
|
| 43 |
context: .
|
| 44 |
file: ./docker/Dockerfile-base
|
| 45 |
push: ${{ github.event_name != 'pull_request' }}
|
| 46 |
-
tags: ${{ steps.metadata.outputs.tags }}-${{ matrix.cuda }}-${{ matrix.pytorch }}
|
| 47 |
labels: ${{ steps.metadata.outputs.labels }}
|
| 48 |
cache-from: type=gha
|
| 49 |
cache-to: type=gha,mode=max
|
|
@@ -52,3 +64,4 @@ jobs:
|
|
| 52 |
CUDA_VERSION_BNB=${{ matrix.cuda_version_bnb }}
|
| 53 |
CUDA=${{ matrix.cuda }}
|
| 54 |
PYTORCH_VERSION=${{ matrix.pytorch }}
|
|
|
|
|
|
| 18 |
cuda_version: 11.8.0
|
| 19 |
cuda_version_bnb: "118"
|
| 20 |
pytorch: 2.0.0
|
| 21 |
+
axolotl_extras:
|
| 22 |
- cuda: cu117
|
| 23 |
cuda_version: 11.7.0
|
| 24 |
cuda_version_bnb: "117"
|
| 25 |
pytorch: 1.13.1
|
| 26 |
+
axolotl_extras:
|
| 27 |
+
- cuda: cu118
|
| 28 |
+
cuda_version: 11.8.0
|
| 29 |
+
cuda_version_bnb: "118"
|
| 30 |
+
pytorch: 2.0.0
|
| 31 |
+
axolotl_extras: gptq
|
| 32 |
+
- cuda: cu117
|
| 33 |
+
cuda_version: 11.7.0
|
| 34 |
+
cuda_version_bnb: "117"
|
| 35 |
+
pytorch: 1.13.1
|
| 36 |
+
axolotl_extras: gptq
|
| 37 |
steps:
|
| 38 |
- name: Checkout
|
| 39 |
uses: actions/checkout@v3
|
|
|
|
| 55 |
context: .
|
| 56 |
file: ./docker/Dockerfile-base
|
| 57 |
push: ${{ github.event_name != 'pull_request' }}
|
| 58 |
+
tags: ${{ steps.metadata.outputs.tags }}-${{ matrix.cuda }}-${{ matrix.pytorch }}${{ matrix.axolotl_extras != '' && '-' || '' }}${{ matrix.axolotl_extras }}
|
| 59 |
labels: ${{ steps.metadata.outputs.labels }}
|
| 60 |
cache-from: type=gha
|
| 61 |
cache-to: type=gha,mode=max
|
|
|
|
| 64 |
CUDA_VERSION_BNB=${{ matrix.cuda_version_bnb }}
|
| 65 |
CUDA=${{ matrix.cuda }}
|
| 66 |
PYTORCH_VERSION=${{ matrix.pytorch }}
|
| 67 |
+
AXOLOTL_EXTRAS=${{ matrix.axolotl_extras }}
|
README.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
| 30 |
```bash
|
| 31 |
git clone https://github.com/OpenAccess-AI-Collective/axolotl
|
| 32 |
|
| 33 |
-
pip3 install -e .[
|
| 34 |
|
| 35 |
accelerate config
|
| 36 |
|
|
@@ -57,7 +57,7 @@ accelerate launch scripts/finetune.py examples/lora-openllama-3b/config.yml \
|
|
| 57 |
1. Install python **3.9**
|
| 58 |
|
| 59 |
2. Install python dependencies with ONE of the following:
|
| 60 |
-
- `pip3 install -e .[
|
| 61 |
- `pip3 install -e .[int4_triton]`
|
| 62 |
- `pip3 install -e .`
|
| 63 |
|
|
|
|
| 30 |
```bash
|
| 31 |
git clone https://github.com/OpenAccess-AI-Collective/axolotl
|
| 32 |
|
| 33 |
+
pip3 install -e .[gptq]
|
| 34 |
|
| 35 |
accelerate config
|
| 36 |
|
|
|
|
| 57 |
1. Install python **3.9**
|
| 58 |
|
| 59 |
2. Install python dependencies with ONE of the following:
|
| 60 |
+
- `pip3 install -e .[gptq]` (recommended)
|
| 61 |
- `pip3 install -e .[int4_triton]`
|
| 62 |
- `pip3 install -e .`
|
| 63 |
|
docker/Dockerfile
CHANGED
|
@@ -2,6 +2,7 @@ ARG BASE_TAG=main-base
|
|
| 2 |
FROM winglian/axolotl-base:$BASE_TAG
|
| 3 |
|
| 4 |
ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
|
|
|
|
| 5 |
|
| 6 |
RUN apt-get update && \
|
| 7 |
apt-get install -y vim curl
|
|
@@ -13,8 +14,13 @@ RUN python3 -m pip install -U --no-cache-dir pydantic
|
|
| 13 |
|
| 14 |
RUN mkdir axolotl
|
| 15 |
COPY . axolotl/
|
|
|
|
| 16 |
RUN cd axolotl && \
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# helper for huggingface-login cli
|
| 20 |
RUN git config --global credential.helper store
|
|
|
|
| 2 |
FROM winglian/axolotl-base:$BASE_TAG
|
| 3 |
|
| 4 |
ARG TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
|
| 5 |
+
ARG AXOLOTL_EXTRAS=""
|
| 6 |
|
| 7 |
RUN apt-get update && \
|
| 8 |
apt-get install -y vim curl
|
|
|
|
| 14 |
|
| 15 |
RUN mkdir axolotl
|
| 16 |
COPY . axolotl/
|
| 17 |
+
# If AXOLOTL_EXTRAS is set, append it in brackets
|
| 18 |
RUN cd axolotl && \
|
| 19 |
+
if [ "$AXOLOTL_EXTRAS" != "" ] ; then \
|
| 20 |
+
pip install -e .[$AXOLOTL_EXTRAS]; \
|
| 21 |
+
else \
|
| 22 |
+
pip install -e .; \
|
| 23 |
+
fi
|
| 24 |
|
| 25 |
# helper for huggingface-login cli
|
| 26 |
RUN git config --global credential.helper store
|
scripts/setup-runpod.sh
DELETED
|
@@ -1,43 +0,0 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
|
| 3 |
-
export WANDB_MODE=offline
|
| 4 |
-
export WANDB_CACHE_DIR=/workspace/data/wandb-cache
|
| 5 |
-
mkdir -p $WANDB_CACHE_DIR
|
| 6 |
-
|
| 7 |
-
mkdir -p /workspace/data/huggingface-cache/{hub,datasets}
|
| 8 |
-
export HF_DATASETS_CACHE="/workspace/data/huggingface-cache/datasets"
|
| 9 |
-
export HUGGINGFACE_HUB_CACHE="/workspace/data/huggingface-cache/hub"
|
| 10 |
-
export TRANSFORMERS_CACHE="/workspace/data/huggingface-cache/hub"
|
| 11 |
-
export NCCL_P2P_DISABLE=1
|
| 12 |
-
|
| 13 |
-
nvidia-smi
|
| 14 |
-
num_gpus=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l)
|
| 15 |
-
gpu_indices=$(seq 0 $((num_gpus - 1)) | paste -sd "," -)
|
| 16 |
-
export CUDA_VISIBLE_DEVICES=$gpu_indices
|
| 17 |
-
echo "CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES"
|
| 18 |
-
|
| 19 |
-
apt-get update
|
| 20 |
-
apt-get install -y build-essential ninja-build vim git-lfs
|
| 21 |
-
git lfs install
|
| 22 |
-
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
|
| 23 |
-
if [ -z "${TORCH_CUDA_ARCH_LIST}" ]; then # only set this if not set yet
|
| 24 |
-
# this covers most common GPUs that the installed version of pytorch supports
|
| 25 |
-
# python -c "import torch; print(torch.cuda.get_arch_list())"
|
| 26 |
-
export TORCH_CUDA_ARCH_LIST="7.0 7.5 8.0 8.6+PTX"
|
| 27 |
-
fi
|
| 28 |
-
|
| 29 |
-
# install flash-attn and deepspeed from pre-built wheels for this specific container b/c these take forever to install
|
| 30 |
-
mkdir -p /workspace/wheels
|
| 31 |
-
cd /workspace/wheels
|
| 32 |
-
curl -L -O https://github.com/OpenAccess-AI-Collective/axolotl/raw/wheels/wheels/deepspeed-0.9.2%2B7ddc3b01-cp38-cp38-linux_x86_64.whl
|
| 33 |
-
curl -L -O https://github.com/OpenAccess-AI-Collective/axolotl/raw/wheels/wheels/flash_attn-1.0.4-cp38-cp38-linux_x86_64.whl
|
| 34 |
-
pip install deepspeed-0.9.2%2B7ddc3b01-cp38-cp38-linux_x86_64.whl
|
| 35 |
-
pip install flash_attn-1.0.4-cp38-cp38-linux_x86_64.whl
|
| 36 |
-
pip install "peft @ git+https://github.com/huggingface/peft.git@main" --force-reinstall --no-dependencies
|
| 37 |
-
|
| 38 |
-
cd /workspace/
|
| 39 |
-
git clone https://github.com/OpenAccess-AI-Collective/axolotl.git
|
| 40 |
-
cd axolotl
|
| 41 |
-
pip install -e .[int4]
|
| 42 |
-
mkdir -p ~/.cache/huggingface/accelerate/
|
| 43 |
-
cp configs/accelerate/default_config.yaml ~/.cache/huggingface/accelerate/default_config.yaml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup.py
CHANGED
|
@@ -17,10 +17,10 @@ setup(
|
|
| 17 |
packages=find_packages(),
|
| 18 |
install_requires=install_requires,
|
| 19 |
extras_require={
|
| 20 |
-
"
|
| 21 |
"alpaca_lora_4bit @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip",
|
| 22 |
],
|
| 23 |
-
"
|
| 24 |
"alpaca_lora_4bit[triton] @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip",
|
| 25 |
],
|
| 26 |
"extras": [
|
|
|
|
| 17 |
packages=find_packages(),
|
| 18 |
install_requires=install_requires,
|
| 19 |
extras_require={
|
| 20 |
+
"gptq": [
|
| 21 |
"alpaca_lora_4bit @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip",
|
| 22 |
],
|
| 23 |
+
"gptq_triton": [
|
| 24 |
"alpaca_lora_4bit[triton] @ git+https://github.com/winglian/alpaca_lora_4bit.git@setup_pip",
|
| 25 |
],
|
| 26 |
"extras": [
|