diff --git a/.github/workflows/prune-old-toolboxes.yml b/.github/workflows/prune-old-toolboxes.yml index af25a76..4a150d5 100644 --- a/.github/workflows/prune-old-toolboxes.yml +++ b/.github/workflows/prune-old-toolboxes.yml @@ -44,7 +44,7 @@ jobs: run: | IN='${{ github.event.inputs.backends }}' if [[ "$IN" == "all" || -z "$IN" ]]; then - JSON='["rocm-6.4.2","rocm-6.4.3","rocm-6.4.4","rocm-7.1.1","rocm-7.2","rocm-7.2.1","rocm-7.2.1-pr21344","rocm-7.2.2","rocm-7.2.3","rocm-7beta","rocm7-nightlies","vulkan-amdvlk","vulkan-radv"]' + JSON='["rocm-6.4.2","rocm-6.4.3","rocm-6.4.4","rocm-7.1.1","rocm-7.2","rocm-7.2.1","rocm-7.2.1-pr21344","rocm-7.2.2","rocm-7.2.3","rocm-7.2.3-mtp","rocm-7beta","rocm7-nightlies","vulkan-amdvlk","vulkan-radv","vulkan-radv-mtp"]' else IN_CLEAN=$(echo "$IN" | tr -d '[:space:]') JSON='["'${IN_CLEAN//,/\",\"}'"]' diff --git a/refresh-toolboxes.sh b/refresh-toolboxes.sh index c697010..89cb7f0 100755 --- a/refresh-toolboxes.sh +++ b/refresh-toolboxes.sh @@ -11,6 +11,10 @@ TOOLBOXES["llama-rocm-6.4.4"]="docker.io/kyuz0/amd-strix-halo-toolboxes:rocm-6.4 TOOLBOXES["llama-rocm-7.2.3"]="docker.io/kyuz0/amd-strix-halo-toolboxes:rocm-7.2.3 --device /dev/dri --device /dev/kfd --group-add video --group-add render --group-add sudo --security-opt seccomp=unconfined" TOOLBOXES["llama-rocm7-nightlies"]="docker.io/kyuz0/amd-strix-halo-toolboxes:rocm7-nightlies --device /dev/dri --device /dev/kfd --group-add video --group-add render --group-add sudo --security-opt seccomp=unconfined" +# MTP (Multi-Token Prediction) — am17an/llama.cpp mtp-clean fork +TOOLBOXES["llama-vulkan-radv-mtp"]="docker.io/kyuz0/amd-strix-halo-toolboxes:vulkan-radv-mtp --device /dev/dri --group-add video --security-opt seccomp=unconfined" +TOOLBOXES["llama-rocm-7.2.3-mtp"]="docker.io/kyuz0/amd-strix-halo-toolboxes:rocm-7.2.3-mtp --device /dev/dri --device /dev/kfd --group-add video --group-add render --group-add sudo --security-opt seccomp=unconfined" + function usage() { echo "Usage: $0 [all|toolbox-name1 toolbox-name2 ...]" echo "Available toolboxes:" diff --git a/toolboxes/Dockerfile.rocm-7.2.3-mtp b/toolboxes/Dockerfile.rocm-7.2.3-mtp new file mode 100644 index 0000000..7f4da4f --- /dev/null +++ b/toolboxes/Dockerfile.rocm-7.2.3-mtp @@ -0,0 +1,113 @@ +# build stage +FROM registry.fedoraproject.org/fedora:43 AS builder + +# rocm 7.2.3 repo +RUN <<'EOF' +tee /etc/yum.repos.d/rocm.repo < /etc/ld.so.conf.d/local.conf \ + && echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local.conf \ + && ldconfig \ + && cp -n /usr/local/lib/libllama*.so* /usr/lib64/ 2>/dev/null || true \ + && ldconfig + +# helper +COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py +RUN chmod +x /usr/local/bin/gguf-vram-estimator.py + +# profile +RUN printf '%s\n' \ + > /etc/profile.d/rocm.sh && chmod +x /etc/profile.d/rocm.sh \ + && echo 'source /etc/profile.d/rocm.sh' >> /etc/bashrc + +# shell +CMD ["/bin/bash"] diff --git a/toolboxes/Dockerfile.vulkan-radv-mtp b/toolboxes/Dockerfile.vulkan-radv-mtp new file mode 100644 index 0000000..76bbded --- /dev/null +++ b/toolboxes/Dockerfile.vulkan-radv-mtp @@ -0,0 +1,68 @@ +# build stage +FROM registry.fedoraproject.org/fedora:43 AS builder + +# deps +RUN dnf -y --nodocs --setopt=install_weak_deps=False install \ + git vim \ + make gcc cmake ninja-build lld clang clang-devel compiler-rt libcurl-devel \ + vulkan-loader-devel vulkaninfo mesa-vulkan-drivers \ + spirv-headers-devel radeontop glslc patch \ + && dnf clean all && rm -rf /var/cache/dnf/* + +# llama.cpp (am17an mtp-clean fork — Multi-Token Prediction) +WORKDIR /opt/llama.cpp +RUN git clone -b mtp-clean --single-branch https://github.com/am17an/llama.cpp.git . + +COPY llama-grammar.patch /tmp/llama-grammar.patch + +# build +RUN git clean -xdf \ + && git submodule update --recursive \ + && patch -p1 < /tmp/llama-grammar.patch \ + && cmake -S . -B build -G Ninja \ + -DGGML_VULKAN=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DGGML_RPC=ON \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLLAMA_BUILD_TESTS=OFF \ + -DLLAMA_BUILD_EXAMPLES=ON \ + -DLLAMA_BUILD_SERVER=ON \ + && cmake --build build --config Release \ + && cmake --install build --config Release + +# libs +RUN find /opt/llama.cpp/build -type f -name 'lib*.so*' -exec cp {} /usr/lib64/ \; \ + && ldconfig + +# helper +COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py +RUN chmod +x /usr/local/bin/gguf-vram-estimator.py + + +# runtime stage +FROM registry.fedoraproject.org/fedora-minimal:43 + +# runtime deps +RUN microdnf -y --nodocs --setopt=install_weak_deps=0 install \ + bash ca-certificates libatomic libstdc++ libgcc \ + vulkan-loader vulkan-loader-devel vulkaninfo mesa-vulkan-drivers radeontop procps-ng \ + && microdnf clean all && rm -rf /var/cache/dnf/* + +# copy +COPY --from=builder /usr/ /usr/ +COPY --from=builder /usr/local/ /usr/local/ +COPY --from=builder /opt/llama.cpp/build/bin/rpc-* /usr/local/bin/ + +# ld +RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf \ + && echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local.conf \ + && ldconfig \ + && cp -n /usr/local/lib/libllama*.so* /usr/lib64/ 2>/dev/null || true \ + && ldconfig + +# helper +COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py +RUN chmod +x /usr/local/bin/gguf-vram-estimator.py + +# shell +CMD ["/bin/bash"]