initial commit

This commit is contained in:
extio-de
2024-10-20 20:53:53 +02:00
commit 4961009887
5 changed files with 66 additions and 0 deletions

43
Dockerfile Normal file
View File

@@ -0,0 +1,43 @@
FROM rocm/pytorch:rocm6.2.3_ubuntu22.04_py3.10_pytorch_release_2.3.0 AS base-builder
ENV DISTFILES_TAG=v1
ENV GPU_ARCHS="gfx1100"
ENV ROCM_TARGET="gfx1100"
ENV HIP_PLATFORM=amd
ENV DS_BUILD_CPU_ADAM=1
ENV TORCH_HIP_ARCH_LIST="gfx1100"
RUN apt-get update
RUN apt-get install -y wget git build-essential ninja-build git-lfs libaio-dev cmake
RUN git lfs install
RUN apt-get install -y --allow-change-held-packages vim curl nano rsync s3fs
RUN apt-get install -y libjpeg-dev python3-dev python3-pip
WORKDIR /workspace
#RUN git clone --recurse https://github.com/ROCm/bitsandbytes.git
RUN git clone --depth 1 -b multi-backend-refactor https://github.com/bitsandbytes-foundation/bitsandbytes.git
WORKDIR /workspace/bitsandbytes
#RUN git checkout rocm_enabled
RUN pip install -r /workspace/bitsandbytes/requirements-dev.txt
RUN cmake -DBNB_ROCM_ARCH="gfx1100" -DCOMPUTE_BACKEND=hip -S .
RUN make
RUN git tag 0.44.2
RUN pip install .
WORKDIR /workspace
RUN pip install trl
RUN pip install peft
RUN pip install transformers datasets huggingface-hub scipy
RUN git clone https://github.com/ggerganov/llama.cpp.git
WORKDIR /workspace/llama.cpp
RUN make -j32 GGML_HIPBLAS=1 AMDGPU_TARGETS=gfx1100
RUN pip install -r requirements/requirements-convert_legacy_llama.txt
WORKDIR /workspace
COPY convert_to_gguf.sh /workspace/convert_to_gguf.sh
RUN chmod +x /workspace/convert_to_gguf.sh
COPY setup.sh /workspace/setup.sh
RUN chmod +x /workspace/setup.sh
ENTRYPOINT ["/workspace/setup.sh"]

1
README.md Normal file
View File

@@ -0,0 +1 @@
# lm-container

15
convert_to_gguf.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
if [[ $# -ne 2 ]] ; then
echo 'Arguments: <path> <model name>'
exit 1
fi
cd /workspace/llama.cpp
./convert_hf_to_gguf.py --model-name $2 $1
./llama-quantize $1/*-F16.gguf Q8_0
./llama-quantize $1/*-F16.gguf Q6_K
./llama-quantize $1/*-F16.gguf Q5_K_M
./llama-quantize $1/*-F16.gguf Q4_K_M
./llama-quantize $1/*-F16.gguf Q4_0_4_4
./llama-quantize $1/*-F16.gguf IQ3_M

3
run.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
docker run --device=/dev/kfd --device=/dev/dri --privileged --security-opt seccomp=unconfined --group-add video --shm-size 20g --rm -it --name axolotl --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --mount type=bind,src="/home/sb/lm/",target=/workspace/data --mount type=bind,src="/home/sb/svn/lm-finetuner/",target=/workspace/lm-finetuner pytorch-rocm-exo:v1

4
setup.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
echo Ready
/bin/bash