move from /root to /opt/nvfp4

This commit is contained in:
zefie committed 2026-11-04 15:04:10 -05:00
1 parent c67a729ac0
commit 66d47eea6a
7 files changed
+30 -18

No files matched your search

+24 -12
View File
@@ -1,11 +1,14 @@
FROM nvidia/cuda:13.2.1-cudnn-devel-ubuntu24.04 FROM nvidia/cuda:13.2.1-cudnn-devel-ubuntu24.04
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
# "Unminify"
RUN rm -f /etc/dpkg/dpkg.cfg.d/excludes && \ RUN rm -f /etc/dpkg/dpkg.cfg.d/excludes && \
rm -f /etc/apt/apt.conf.d/docker-clean && \ rm -f /etc/apt/apt.conf.d/docker-clean && \
rm -f /etc/apt/apt.conf.d/01-nodoc && \ rm -f /etc/apt/apt.conf.d/01-nodoc && \
rm -f /usr/bin/man && \ rm -f /usr/bin/man && \
dpkg-divert --quiet --remove /usr/bin/man dpkg-divert --quiet --remove /usr/bin/man
# Install packages
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \
apt update && apt-get dist-upgrade --autoremove -y && apt-get install -y \ apt update && apt-get dist-upgrade --autoremove -y && apt-get install -y \
@@ -21,15 +24,23 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
git \ git \
cmake cmake
RUN python3 -m venv /root/venv # Set up nvfp4 python virtual environment
ENV PATH="/root/venv/bin:${PATH}" WORKDIR /opt/nvfp4
RUN python3 -m venv /opt/nvfp4/py-venv
ENV PATH="/opt/nvfp4/py-venv/bin:${PATH}"
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install torch torchvision torchaudio --upgrade --index-url \ RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install torch torchvision torchaudio --upgrade --index-url \
https://download.pytorch.org/whl/cu132/ https://download.pytorch.org/whl/cu132/
WORKDIR /root
RUN mkdir llama.cpp # Fetch convert_to_quant, and install it into our python venv.
COPY --exclude=build/ llama.cpp ./llama.cpp/ WORKDIR /opt/nvfp4
WORKDIR /root/llama.cpp RUN git clone --depth=1 https://github.com/silveroxides/convert_to_quant && cd convert_to_quant && rm -rf .git && pip3 install -r requirements.txt && pip3 install .
# Clone and compile llama.cpp (save some space by removing unneeded .git data)
RUN git clone --depth=1 https://github.com/ggml-org/llama.cpp && rm -rf llama.cpp/.git
WORKDIR /opt/nvfp4/llama.cpp
# Build llama.cpp, the ldconfig is important
RUN echo "/usr/local/cuda-13.2/compat" > /etc/ld.so.conf.d/988-cuda-compat.conf && ldconfig RUN echo "/usr/local/cuda-13.2/compat" > /etc/ld.so.conf.d/988-cuda-compat.conf && ldconfig
RUN cmake -B build -S . \ RUN cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
@@ -41,22 +52,23 @@ RUN cmake -B build -S . \
&& cmake --build build --target install \ && cmake --build build --target install \
&& rm -rf build && rm -rf build
WORKDIR /root # Copy and install zefie's nvfp4 quant scripts
RUN git clone https://github.com/silveroxides/convert_to_quant && cd convert_to_quant && pip3 install -r requirements.txt && pip3 install .
RUN mkdir nvfp4_gguf_quant RUN mkdir nvfp4_gguf_quant
WORKDIR /root/nvfp4_gguf_quant WORKDIR /opt/nvfp4/nvfp4_gguf_quant
COPY --exclude=__pycache__ nvfp4gguf ./nvfp4gguf COPY --exclude=__pycache__ nvfp4gguf ./nvfp4gguf
COPY --chmod=0644 gguf_to_nvfp4_gguf.py hf_to_nvfp4_gguf.py hf_to_nvfp4_safetensors.py requirements.txt safetensors_to_nvfp4_gguf.py hf_info.py gguf_info.py . COPY --chmod=0644 gguf_to_nvfp4_gguf.py hf_to_nvfp4_gguf.py hf_to_nvfp4_safetensors.py requirements.txt safetensors_to_nvfp4_gguf.py hf_info.py gguf_info.py .
# Install requirements for zefie's nvfp4 quant scripts
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install -r requirements.txt RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install -r requirements.txt
COPY --chmod=0644 docker/README.txt /workspace/README.txt COPY --chmod=0644 docker/README.txt /workspace/README.txt
COPY --chmod=0755 docker/hf_info docker/gguf_info docker/hf_to_nvfp4_gguf docker/hf_to_nvfp4_safetensors docker/gguf_to_nvfp4_gguf docker/safetensors_to_nvfp4_gguf /usr/local/bin/ COPY --chmod=0755 docker/hf_info docker/gguf_info docker/hf_to_nvfp4_gguf docker/hf_to_nvfp4_safetensors docker/gguf_to_nvfp4_gguf docker/safetensors_to_nvfp4_gguf /usr/local/bin/
# Install manpages for zefie's nvfp4 quant scripts, ctq, and heretic
RUN mkdir -p /usr/local/share/man/man1 RUN mkdir -p /usr/local/share/man/man1
COPY --chmod=0644 man/man1/* /usr/local/share/man/man1/ COPY --chmod=0644 man/man1/* /usr/local/share/man/man1/
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install heretic-llm RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked pip3 install heretic-llm
# Finalize and settle at /workspace
ENV DEBIAN_FRONTEND=
WORKDIR /workspace WORKDIR /workspace
ENTRYPOINT []
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
python /root/nvfp4_gguf_quant/gguf_info.py "${@}" python /opt/nvfp4/nvfp4_gguf_quant/gguf_info.py "${@}"
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
python /root/nvfp4_gguf_quant/gguf_to_nvfp4_gguf.py --llama-cpp /root/llama.cpp "${@}" python /opt/nvfp4/nvfp4_gguf_quant/gguf_to_nvfp4_gguf.py --llama-cpp /opt/nvfp4/llama.cpp "${@}"
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
python /root/nvfp4_gguf_quant/hf_info.py "${@}" python /opt/nvfp4/nvfp4_gguf_quant/hf_info.py "${@}"
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
python /root/nvfp4_gguf_quant/hf_to_nvfp4_gguf.py --llama-cpp /root/llama.cpp "${@}" python /opt/nvfp4/nvfp4_gguf_quant/hf_to_nvfp4_gguf.py --llama-cpp /opt/nvfp4/llama.cpp "${@}"
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
python /root/nvfp4_gguf_quant/hf_to_nvfp4_safetensors.py --convert-to-quant /root/convert_to_quant "${@}" python /opt/nvfp4/nvfp4_gguf_quant/hf_to_nvfp4_safetensors.py --convert-to-quant /opt/nvfp4/convert_to_quant "${@}"
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
python /root/nvfp4_gguf_quant/safetensors_to_nvfp4_gguf.py --llama-cpp /root/llama.cpp "${@}" python /opt/nvfp4/nvfp4_gguf_quant/safetensors_to_nvfp4_gguf.py --llama-cpp /opt/nvfp4/llama.cpp "${@}"