-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General: * ROCm support Misc: * Update README.md * Update repositories
- Loading branch information
Showing
25 changed files
with
240 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import glob | ||
import jinja2 | ||
import sys | ||
|
||
def render_template(filepath, **options): | ||
if filepath.endswith(".jinja2"): | ||
# read input file | ||
with open(filepath, "r") as file: | ||
template = jinja2.Template(file.read()) | ||
|
||
# render template | ||
rendered = template.render(**options) | ||
|
||
# write output file | ||
with open(filepath[:-7], "w") as file: | ||
file.write(rendered) | ||
|
||
def main(): | ||
# by default, use cuda | ||
cuda = True | ||
rocm = False | ||
|
||
# enable rocm if specified | ||
if len(sys.argv) == 2: | ||
if sys.argv[1] == "rocm": | ||
cuda = False | ||
rocm = True | ||
|
||
# list of rendered files | ||
rendered = [] | ||
|
||
# render every file | ||
for filepath in glob.glob("**/*.jinja2", recursive=True) + [".gitignore.jinja2"]: | ||
# render file | ||
render_template(filepath, CUDA=cuda, ROCm=rocm, rendered=rendered) | ||
|
||
# add output file to rendered list | ||
rendered.append(filepath[:-7]) | ||
|
||
# print status | ||
print(f"File '{filepath}' rendered successfully") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Build ISO (ROCm) | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cleanup | ||
uses: rokibhasansagar/slimhub_actions@main | ||
with: | ||
retain: "docker_imgcache,docker_buildkit,docker_imgcache" | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Build image | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: archlinux:latest | ||
options: --privileged --volume ${{ github.workspace }}:/workspace | ||
run: | | ||
# Exit on error | ||
set -eu | ||
# Refresh package databases | ||
pacman --sync --noconfirm --refresh | ||
# Upgrade system | ||
pacman --sync --noconfirm --sysupgrade | ||
# Install required packages | ||
pacman --sync --noconfirm --needed archiso patch python python-jinja | ||
# Apply patch to archiso | ||
patch -p0 << 'EOF' | ||
--- /usr/bin/mkarchiso | ||
+++ /usr/bin/mkarchiso | ||
@@ -1227,6 +1227,10 @@ | ||
if [[ -v cert_list ]]; then | ||
_cms_sign_artifact "${airootfs_image_filename}" | ||
fi | ||
+ | ||
+ _msg_info 'Removing the pacstrap directory...' | ||
+ rm -rf -- "${pacstrap_dir:?}/" | ||
+ _msg_info 'Done!' | ||
} | ||
# export build artifacts for netboot | ||
EOF | ||
# Configure to use ROCm | ||
pushd /workspace | ||
python3 .ci/configure.py rocm | ||
popd | ||
# Build image | ||
mkarchiso -v -m iso -w /workspace/work -o /workspace/out /workspace | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: archiso-output | ||
path: out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
out/ | ||
work/ | ||
|
||
# rendered files | ||
packages.x86_64 | ||
airootfs/root/customize_airootfs.sh | ||
airootfs/root/customize_airootfs/scripts/1000-axolotl-dependencies.sh | ||
airootfs/root/customize_airootfs/scripts/0100-koboldcpp-patches.sh | ||
airootfs/root/customize_airootfs/scripts/1000-sillytavern-extras-dependencies.sh | ||
airootfs/root/customize_airootfs/scripts/1000-vllm-dependencies.sh | ||
airootfs/root/customize_airootfs/scripts/1000-text-generation-webui-dependencies.sh | ||
airootfs/root/customize_airootfs/scripts/0100-automatic-patches.sh | ||
airootfs/root/customize_airootfs/scripts/9999-cleanup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
out/ | ||
work/ | ||
|
||
# rendered files | ||
{% for file in rendered %} | ||
{{- file}} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule axolotl
updated
from 6ef46f to 41353d
Submodule llama.cpp
updated
13 files
+1 −0 | README.md | |
+116 −0 | awq-py/README.md | |
+254 −0 | awq-py/awq/apply_awq.py | |
+2 −0 | awq-py/requirements.txt | |
+90 −3 | convert-hf-to-gguf.py | |
+14 −0 | convert.py | |
+7 −7 | examples/finetune/finetune.cpp | |
+19 −12 | examples/server/server.cpp | |
+13 −1 | gguf-py/gguf/constants.py | |
+14 −1 | gguf-py/gguf/tensor_mapping.py | |
+219 −14 | llama.cpp | |
+ − | models/ggml-vocab-gpt2.gguf | |
+1 −0 | tests/CMakeLists.txt |
Submodule text-generation-webui
updated
5 files
+9 −1 | css/html_instruct_style.css | |
+20 −14 | css/main.css | |
+35 −13 | js/main.js | |
+2 −0 | js/show_controls.js | |
+1 −0 | settings-template.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
airootfs/root/customize_airootfs/scripts/1000-text-generation-webui-dependencies.sh
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
airootfs/root/customize_airootfs/scripts/1000-text-generation-webui-dependencies.sh.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# text-generation-webui dependencies | ||
pushd "text-generation-webui" | ||
# disable package caching | ||
export PIP_NO_CACHE_DIR=0 | ||
|
||
# create venv | ||
python3 -m venv venv | ||
|
||
# activate venv | ||
source venv/bin/activate | ||
{% if CUDA %} | ||
# install dependencies (cuda) | ||
pip3 install -r requirements.txt | ||
{% endif %} | ||
|
||
{% if ROCm %} | ||
# extract pytorch version | ||
index_url=$(grep -o 'https://download.pytorch.org/whl/rocm[0-9.]*' one_click.py) | ||
|
||
# install pytorch | ||
pip3 install torch torchvision torchaudio --index-url "$index_url" | ||
|
||
# install dependencies (rocm) | ||
pip3 install -r requirements_amd.txt | ||
{% endif %} | ||
deactivate | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
airootfs/root/customize_airootfs/scripts/2000-automatic-cleanup.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.