Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha0552 authored Apr 9, 2024
1 parent e0f9138 commit 528de7c
Show file tree
Hide file tree
Showing 23 changed files with 148 additions and 119 deletions.
31 changes: 0 additions & 31 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion airootfs/home/tori/ComfyUI
Submodule ComfyUI deleted from c6de09
1 change: 0 additions & 1 deletion airootfs/home/tori/SillyTavern-Extras
Submodule SillyTavern-Extras deleted from 5b35e9
1 change: 0 additions & 1 deletion airootfs/home/tori/automatic
Submodule automatic deleted from 82973c
1 change: 0 additions & 1 deletion airootfs/home/tori/axolotl
Submodule axolotl deleted from ff939d
1 change: 0 additions & 1 deletion airootfs/home/tori/koboldcpp
Submodule koboldcpp deleted from f3b765
1 change: 0 additions & 1 deletion airootfs/home/tori/llama.cpp
Submodule llama.cpp deleted from b06c16
1 change: 0 additions & 1 deletion airootfs/home/tori/text-generation-webui
Submodule text-generation-webui deleted from 7cf140
1 change: 0 additions & 1 deletion airootfs/home/tori/vllm
Submodule vllm deleted from f408d0

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#!/bin/bash
set -eu

# clone repository
git clone "https://github.com/vladmandic/automatic.git"

# automatic patches
pushd "automatic"
# use specific revision
git checkout e783b098fd0ad28acabb29844ab0af0978684c04

# clone submodules
git submodule update --init --recursive

# remove git dependency
sed -i '/installer.check_modified_files()/d' launch.py
sed -i '/installer.install_submodules()/d' launch.py
Expand All @@ -19,3 +28,29 @@ pushd "automatic"
patch -p1 < "$CUSTOMIZE_AIROOTFS/patches/0000-automatic-drop-pstate-in-idle.patch"
{% endif %}
popd

# automatic dependencies
pushd "automatic"
# disable package caching
export PIP_NO_CACHE_DIR=0

# create venv
python3 -m venv venv

# activate venv
source venv/bin/activate
{% if platform == "cuda" %}
# install nvidia-pstate if cuda
pip3 install nvidia-pstate
{% endif %}

# install dependencies
python3 launch.py --test
deactivate

# remove installation config
rm config.json

# remove installation log
rm sdnext.log
popd
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/bin/bash
set -eu

{% if platform == "cuda" %}
# clone repository
git clone "https://github.com/OpenAccess-AI-Collective/axolotl.git"

# axolotl patches
pushd "axolotl"
# use specific revision
git checkout 2fa65b95997fa0ae68ae2b66933521ff8dfa3980
popd

# axolotl dependencies
pushd "axolotl"
{% if platform == "cuda" %}
# disable package caching
export PIP_NO_CACHE_DIR=0

Expand Down Expand Up @@ -35,5 +44,5 @@ pushd "axolotl"
# downgrade flash-attn (https://github.com/OpenAccess-AI-Collective/axolotl/issues/911#issuecomment-1868546443)
pip3 install flash-attn==2.3.2
deactivate
{% endif %}
popd
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -eu

# clone repository
git clone "https://github.com/comfyanonymous/ComfyUI.git"

# ComfyUI patches
pushd "ComfyUI"
# use specific revision
git checkout 30abc324c2f73e6b648093ccd4741dece20be1e5
popd

# ComfyUI dependencies
pushd "ComfyUI"
# disable package caching
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash
#!/bin/sh
set -eu

# clone repository
git clone "https://github.com/LostRuins/koboldcpp.git"

# koboldcpp patches
pushd "koboldcpp"
# use specific revision
git checkout f3b7651102c3ce3e4f331b93137dc32d752eada0

{% if platform == "cuda" %}
# drop pstate in idle
patch -p1 < "$CUSTOMIZE_AIROOTFS/patches/0000-koboldcpp-drop-pstate-in-idle.patch"
Expand Down
11 changes: 11 additions & 0 deletions airootfs/root/customize_airootfs/scripts/1000-llamacpp.sh.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -eu

# clone repository
git clone "https://github.com/ggerganov/llama.cpp.git"

# llama.cpp patches
pushd "llama.cpp"
# use specific revision
git checkout cc4a95426d17417d3c83f12bdb514fbe8abe2a88
popd
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -eu

# clone repository
git clone "https://github.com/SillyTavern/SillyTavern-Extras.git"

# SillyTavern-Extras patches
pushd "SillyTavern-Extras"
# use specific revision
git checkout 86793c6e104ce7e69da919eecea7f4d87ed61727
popd

# SillyTavern-Extras dependencies
pushd "SillyTavern-Extras"
# disable package caching
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -eu

# clone repository
git clone "https://github.com/oobabooga/text-generation-webui.git"

# text-generation-webui patches
pushd "text-generation-webui"
# use specific revision
git checkout 91a7370a655881c55274284509a546ffd644dc16
popd

# text-generation-webui dependencies
pushd "text-generation-webui"
# disable package caching
Expand Down
57 changes: 57 additions & 0 deletions airootfs/root/customize_airootfs/scripts/1000-vllm.sh.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/sh
set -eu

{% if platform == "cuda" %}
# clone repository
git clone "https://github.com/vllm-project/vllm.git"

# vllm patches
pushd "vllm"
# use specific revision
git checkout d036198e23345f3c25438f082396f7487028e8b6
popd

# vllm dependencies
pushd "vllm"
# disable package caching
export PIP_NO_CACHE_DIR=0

# limit the number of parallel jobs to avoid OOM
export MAX_JOBS=1

# define supported architectures
export TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0"

# cuda home directory
export CUDA_HOME=/opt/cuda

# use gcc 12
export CC=gcc-12
export CXX=g++-12

# create venv
python3 -m venv venv

# activate venv
source venv/bin/activate
# install dependencies
pip3 install -r requirements.txt
pip3 install -r requirements-build.txt

# build native extension
python3 setup.py build_ext --inplace
deactivate

# remove venv
rm -fr venv

# create venv
python3 -m venv venv

# activate venv
source venv/bin/activate
# install dependencies
pip3 install -r requirements.txt
deactivate
popd
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,3 @@ rm -fr /home/tori/.config/matplotlib

# keras
rm -fr /home/tori/.keras

{% if platform == "rocm" %}
# remove axolotl if rocm
rm -fr /home/tori/axolotl

# remove vllm if rocm
rm -fr /home/tori/vllm
{% endif %}

0 comments on commit 528de7c

Please sign in to comment.