Skip to content

Error saving GGUF of vision model on DGX Spark #3561

Closed

Description

@weoieoeo

I am running this docker container: nvcr.io/nvidia/pytorch:25.10-py3 on DGX Spark

i made a fresh llama.ccp build within the docker container:

cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release

export PATH="/home/ollam3/llama.cpp/build/bin:$PATH"

and llama.ccp is accessible:

root@a3e66db5040b:/workspace/Training# llama-cli --version
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GB10, compute capability 12.1, VMM: yes
version: 6967 (b7f9010d2)
built with cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 for aarch64-linux-gnu

After finetuning a Vision LLM (medgemma-4b-it-unsloth-bnb-4bit) conversion to gguf fails. why does unsloth not find the binaries and tries to rebuild llama.ccp?

{'train_runtime': 487.5697, 'train_samples_per_second': 0.656, 'train_steps_per_second': 0.021, 'train_loss': 0.7634800791740417, 'epoch': 0.17}
100%|██████████████████████████████████████████████████████████████████████████████████████| 10/10 [08:07<00:00, 48.76s/it]
Unsloth: ##### The current model auto adds a BOS token.
Unsloth: ##### Your chat template has a BOS token. We shall remove it temporarily.
Unsloth: Merging model weights to 16-bit format...
/usr/local/lib/python3.12/dist-packages/unsloth_zoo/saving_utils.py:965: UserWarning: Model ../AIEngine/medgemma-4b-it-unsloth-bnb-4bit not found locally or on HuggingFace
warnings.warn(f"Model {model_name} not found locally or on HuggingFace")
Unsloth: Converting to GGUF format...
==((====))== Unsloth: Conversion from HF to GGUF information
\ /| [0] Installing llama.cpp might take 3 minutes.
O^O/ _/ \ [1] Converting HF to GGUF bf16 might take 3 minutes.
\ / [2] Converting GGUF bf16 to ['q4_k_m'] might take 10 minutes each.
"-____-" In total, you will have to wait at least 16 minutes.

Unsloth: Installing llama.cpp. This might take 3 minutes...
Unsloth: llama.cpp folder exists but binaries not found - will rebuild
Unsloth: Updating system package directories
Unsloth: All required system packages already installed!
Unsloth: Install llama.cpp and building - please wait 1 to 3 minutes
Unsloth: Install GGUF and other packages
Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1074, in save_to_gguf
quantizer_location, converter_location = check_llama_cpp()
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 343, in check_llama_cpp
raise RuntimeError(
RuntimeError: Unsloth: No working quantizer found in llama.cpp
Files in directory: convert_hf_to_gguf.py, common, gguf-py, convert_llama_ggml_to_gguf.py, CONTRIBUTING.md, README.md, convert_lora_to_gguf.py, CMakeLists.txt, CMakePresets.json, SECURITY.md, CODEOWNERS, examples, licenses, flake.nix, ggml, requirements.txt, ci, convert_hf_to_gguf_update.py, Makefile, build-cuda

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1835, in unsloth_save_pretrained_gguf
all_file_locations, want_full_precision, is_vlm_update = save_to_gguf(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1085, in save_to_gguf
quantizer_location, converter_location = install_llama_cpp(
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 415, in install_llama_cpp
try_execute(f"{pip} install gguf protobuf sentencepiece mistral_common", **kwargs)
File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 275, in try_execute
raise RuntimeError(error_msg)
RuntimeError: [FAIL] Command uv pip install gguf protobuf sentencepiece mistral_common failed with exit code 2
stdout: error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/workspace/Training/finetunevisionGemma3_Herz.py", line 217, in
model.save_pretrained_gguf("unsloth_finetune", tokenizer, quantization_method = "q4_k_m")
File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1855, in unsloth_save_pretrained_gguf
raise RuntimeError(f"Unsloth: GGUF conversion failed: {e}")
RuntimeError: Unsloth: GGUF conversion failed: [FAIL] Command uv pip install gguf protobuf sentencepiece mistral_common failed with exit code 2
stdout: error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment

root@a3e66db5040b:/workspace/Training# pip list
Package Version Build


absl-py 2.3.1
accelerate 1.11.0
aiohappyeyeballs 2.6.1
aiohttp 3.13.2
aiosignal 1.4.0
annotated-types 0.7.0
anyio 4.11.0
apex 0.1
argon2-cffi 25.1.0
argon2-cffi-bindings 25.1.0
arrow 1.3.0
asttokens 3.0.0
astunparse 1.6.3
async-lru 2.0.5
attrs 25.4.0
audioread 3.0.1
babel 2.17.0
beautifulsoup4 4.14.2
bitsandbytes 0.48.2
black 25.9.0
bleach 6.2.0
build 1.3.0
certifi 2025.10.5
cffi 2.0.0
charset-normalizer 3.4.4
click 8.3.0
cmake 3.31.6
comm 0.2.3
contourpy 1.3.3
cut-cross-entropy 25.1.1
cycler 0.12.1
Cython 3.1.4
datasets 4.4.1
debugpy 1.8.17
decorator 5.2.1
defusedxml 0.7.1
diffusers 0.35.2
dill 0.4.0
dllist 2.0.0
dm-tree 0.1.9
docstring_parser 0.17.0
einops 0.8.1
execnet 2.1.1
executing 2.2.1
expecttest 0.3.0
fastjsonschema 2.21.2
filelock 3.20.0
flash_attn 2.7.4.post1+25.10 36764868
fonttools 4.60.1
fqdn 1.5.1
frozenlist 1.8.0
fsspec 2025.9.0
gast 0.6.0
grpcio 1.75.1
h11 0.16.0
hf_transfer 0.1.9
hf-xet 1.2.0
httpcore 1.0.9
httpx 0.28.1
huggingface-hub 0.36.0
hypothesis 6.130.8
idna 3.11
importlib_metadata 8.7.0
iniconfig 2.1.0
ipykernel 7.0.1
ipython 9.6.0
ipython_pygments_lexers 1.1.1
isoduration 20.11.0
isort 7.0.0
jedi 0.19.2
Jinja2 3.1.6
joblib 1.5.2
json5 0.12.1
jsonpointer 3.0.0
jsonschema 4.25.1
jsonschema-specifications 2025.9.1
jupyter_client 8.6.3
jupyter_core 5.9.1
jupyter-events 0.12.0
jupyter-lsp 2.3.0
jupyter_server 2.17.0
jupyter_server_terminals 0.5.3
jupyterlab 4.4.9
jupyterlab_code_formatter 3.0.2
jupyterlab_pygments 0.3.0
jupyterlab_server 2.27.3
jupyterlab_tensorboard_pro 4.0.0
jupytext 1.17.3
kiwisolver 1.4.9
lark 1.3.0
lazy_loader 0.4
librosa 0.11.0
lightning-thunder 0.2.5.dev0
lightning-utilities 0.15.2
lintrunner 0.12.7
llvmlite 0.45.1
looseversion 1.3.0
Markdown 3.9
markdown-it-py 4.0.0
MarkupSafe 3.0.3
matplotlib 3.10.7
matplotlib-inline 0.1.7
mdit-py-plugins 0.5.0
mdurl 0.1.2
mistune 3.1.4
ml_dtypes 0.5.3
mock 5.2.0
mpmath 1.3.0
msgpack 1.1.2
msgspec 0.19.0
multidict 6.7.0
multiprocess 0.70.18
mypy_extensions 1.1.0
nbclient 0.10.2
nbconvert 7.16.6
nbformat 5.10.4
nest-asyncio 1.6.0
networkx 3.5
ninja 1.13.0
notebook 7.4.7
notebook_shim 0.2.4
numba 0.62.1
numpy 2.1.0
nvfuser 0.2.32+gited11f2b
nvidia-cudnn-frontend 1.14.1
nvidia-dali-cuda130 1.51.2
nvidia-mathdx 25.1.1
nvidia-ml-py 13.580.82
nvidia-modelopt 0.35.1
nvidia-nvcomp-cu13 5.0.0.6
nvidia-nvimgcodec-cu13 0.6.0.32
nvidia-nvjpeg-cu13 0.0.0a0
nvidia-nvjpeg2k-cu13 0.9.0.43
nvidia-nvtiff-cu13 0.5.1.75
nvidia-resiliency-ext 0.4.1+cuda13
onnx 1.18.0
onnx-ir 0.1.11
onnxscript 0.5.4
opt_einsum 3.4.0
optree 0.17.0
packaging 25.0
pandas 2.3.3
pandocfilters 1.5.1
parso 0.8.5
pathspec 0.12.1
peft 0.17.1
pexpect 4.9.0
pillow 12.0.0
pip 25.2
platformdirs 4.5.0
pluggy 1.6.0
polygraphy 0.49.26
pooch 1.8.2
prometheus_client 0.23.1
prompt_toolkit 3.0.52
propcache 0.4.1
protobuf 6.33.0
psutil 7.1.0
ptyprocess 0.7.0
PuLP 3.3.0
pure_eval 0.2.3
pyarrow 22.0.0
pybind11 3.0.1
pybind11-global 3.0.1
pycocotools 2.0+nv0.8.1
pycparser 2.23
pydantic 2.12.2
pydantic_core 2.41.4
Pygments 2.19.2
pyparsing 3.2.5
pyproject_hooks 1.2.0
pytest 8.1.1
pytest-flakefinder 1.1.0
pytest-rerunfailures 16.1
pytest-shard 0.1.2
pytest-xdist 3.8.0
python-dateutil 2.9.0.post0
python_hostlist 2.3.0
python-json-logger 4.0.0
pytokens 0.2.0
pytorch-triton 3.4.0+gitc817b9b6
pytz 2025.2
PyYAML 6.0.3
pyzmq 27.1.0
referencing 0.37.0
regex 2025.9.18
requests 2.32.5
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rfc3987-syntax 1.1.0
rich 14.2.0
rpds-py 0.27.1
safetensors 0.6.2
scikit-learn 1.7.2
scipy 1.16.2
Send2Trash 1.8.3
sentencepiece 0.2.1
setuptools 79.0.1
shtab 1.7.2
six 1.16.0
sniffio 1.3.1
sortedcontainers 2.4.0
soundfile 0.13.1
soupsieve 2.8
soxr 1.0.0
stack-data 0.6.3
sympy 1.14.0
tabulate 0.9.0
tensorboard 2.20.0
tensorboard-data-server 0.7.2
tensorrt 10.13.3.9
terminado 0.18.1
threadpoolctl 3.6.0
tinycss2 1.4.0
tokenizers 0.22.1
torch 2.9.0a0+145a3a7bda.nv25.10
torch_tensorrt 2.9.0a0
torchao 0.14.1
torchprofile 0.0.4
torchvision 0.24.0a0+094e7af5
tornado 6.5.2
tqdm 4.67.1
traitlets 5.14.3
transformer_engine 2.8.0+40c69e75
transformers 4.57.1
triton 3.5.0
trl 0.23.0
typeguard 4.4.4
types-python-dateutil 2.9.0.20251008
typing_extensions 4.15.0
typing-inspection 0.4.2
tyro 0.9.35
tzdata 2025.2
unsloth 2025.11.1
unsloth_zoo 2025.11.1
uri-template 1.3.0
urllib3 2.5.0
uv 0.9.3
wcwidth 0.2.14
webcolors 24.11.1
webencodings 0.5.1
websocket-client 1.9.0
Werkzeug 3.1.3
wheel 0.45.1
wrapt 1.17.3
xdoctest 1.0.2
xxhash 3.6.0
yarl 1.22.0
zipp 3.23.0

Activity

  1. rolandtannous commented on Nov 7, 2025

    @rolandtannous
    Contributor

    @weoieoeo unsloth pulls, installs and builds llama.cpp within the current project working directory where the script is running, so it expects the binaries to be under llama.cpp/binary_name . Make sure your llama.cpp folder is placed there.
    Eventually, we'll add a feature where we check to see if there are llama.cpp binaries in the system PATH before building locally, but for the time being make sure llama.cpp is in your current working directory. Thanks

  2. weoieoeo commented on Nov 7, 2025

    @weoieoeo
    Author

    @rolandtannous I have copied llama.ccp to my working directory /home/ollam3.

    root@a3e66db5040b:/home/ollam3/llama.cpp# ls -list
    total 928
    53104097 4 drwxr-xr-x 12 root root 4096 Nov 6 11:03 build
    53104084 4 drwxr-xr-x 7 root root 4096 Nov 6 10:59 vendor
    53103584 4 drwxr-xr-x 17 root root 4096 Nov 6 10:59 tools
    53103541 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 tests
    53103390 4 drwxr-xr-x 3 root root 4096 Nov 6 10:59 src
    53103341 4 drwxr-xr-x 5 root root 4096 Nov 6 10:59 scripts
    53103324 124 -rw-r--r-- 1 root root 124786 Nov 6 10:59 poetry.lock
    53103325 4 -rw-r--r-- 1 root root 1336 Nov 6 10:59 pyproject.toml
    53103326 4 -rw-r--r-- 1 root root 616 Nov 6 10:59 pyrightconfig.json
    53103328 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 requirements
    53103327 4 -rw-r--r-- 1 root root 551 Nov 6 10:59 requirements.txt
    53103317 4 -rw-r--r-- 1 root root 163 Nov 6 10:59 mypy.ini
    53103318 4 drwxr-xr-x 3 root root 4096 Nov 6 10:59 pocs
    53103240 4 drwxr-xr-x 3 root root 4096 Nov 6 10:59 models
    53103228 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 media
    53103223 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 licenses
    53103179 4 drwxr-xr-x 5 root root 4096 Nov 6 10:59 gguf-py
    53103210 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 grammars
    53103220 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 include
    53102459 4 drwxr-xr-x 5 root root 4096 Nov 6 10:59 ggml
    53102175 4 drwxr-xr-x 28 root root 4096 Nov 6 10:59 examples
    53102457 4 -rw-r--r-- 1 root root 1556 Nov 6 10:59 flake.lock
    53102458 8 -rw-r--r-- 1 root root 7243 Nov 6 10:59 flake.nix
    53102124 4 drwxr-xr-x 6 root root 4096 Nov 6 10:59 docs
    53102121 24 -rwxr-xr-x 1 root root 24485 Nov 6 10:59 convert_hf_to_gguf_update.py
    53102122 20 -rwxr-xr-x 1 root root 19106 Nov 6 10:59 convert_llama_ggml_to_gguf.py
    53102123 20 -rwxr-xr-x 1 root root 20291 Nov 6 10:59 convert_lora_to_gguf.py
    53102120 472 -rwxr-xr-x 1 root root 479810 Nov 6 10:59 convert_hf_to_gguf.py
    53102090 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 common
    53102080 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 cmake
    53102068 8 -rw-r--r-- 1 root root 4570 Nov 6 10:59 CMakePresets.json
    53102069 8 -rw-r--r-- 1 root root 6143 Nov 6 10:59 CODEOWNERS
    53102070 12 -rw-r--r-- 1 root root 8481 Nov 6 10:59 CONTRIBUTING.md
    53102071 4 -rw-r--r-- 1 root root 1078 Nov 6 10:59 LICENSE
    53102072 4 -rw-r--r-- 1 root root 257 Nov 6 10:59 Makefile
    53102073 32 -rw-r--r-- 1 root root 30680 Nov 6 10:59 README.md
    53102074 8 -rw-r--r-- 1 root root 5347 Nov 6 10:59 SECURITY.md
    53102075 24 -rwxr-xr-x 1 root root 21790 Nov 6 10:59 build-xcframework.sh
    53102076 4 drwxr-xr-x 2 root root 4096 Nov 6 10:59 ci
    53102066 48 -rw-r--r-- 1 root root 47860 Nov 6 10:59 AUTHORS
    53102067 12 -rw-r--r-- 1 root root 8331 Nov 6 10:59 CMakeLists.txt

    The build (I made previously) is located in /home/ollam3/llama.cpp/build/bin

    root@a3e66db5040b:/home/ollam3/llama.cpp/build/bin# ls -list
    total 114792
    53106559 2312 -rwxr-xr-x 1 root root 2368128 Nov 6 11:20 llama-export-lora
    53106555 2332 -rwxr-xr-x 1 root root 2433240 Nov 6 11:20 llama-cvector-generator
    53106551 2296 -rwxr-xr-x 1 root root 2365304 Nov 6 11:20 llama-mtmd-cli
    53106546 20 -rwxr-xr-x 1 root root 71384 Nov 6 11:20 llama-qwen2vl-cli
    53106542 20 -rwxr-xr-x 1 root root 71384 Nov 6 11:20 llama-minicpmv-cli
    53106538 20 -rwxr-xr-x 1 root root 71384 Nov 6 11:20 llama-gemma3-cli
    53106533 20 -rwxr-xr-x 1 root root 71384 Nov 6 11:20 llama-llava-cli
    53106529 2396 -rwxr-xr-x 1 root root 2510256 Nov 6 11:20 llama-tts
    53106525 308 -rwxr-xr-x 1 root root 331624 Nov 6 11:20 llama-tokenize
    53106521 1892 -rwxr-xr-x 1 root root 1949632 Nov 6 11:20 llama-run
    53106514 4288 -rwxr-xr-x 1 root root 4410848 Nov 6 11:20 llama-server
    53106507 360 -rwxr-xr-x 1 root root 404888 Nov 6 11:19 llama-quantize
    53106503 2364 -rwxr-xr-x 1 root root 2440488 Nov 6 11:19 llama-perplexity
    53106499 2312 -rwxr-xr-x 1 root root 2365608 Nov 6 11:19 llama-cli
    53106495 480 -rwxr-xr-x 1 root root 487904 Nov 6 11:19 llama-bench
    53106491 2368 -rwxr-xr-x 1 root root 2441648 Nov 6 11:19 llama-imatrix
    53106487 48 -rwxr-xr-x 1 root root 78912 Nov 6 11:19 llama-gguf-split
    53106482 2276 -rwxr-xr-x 1 root root 2363032 Nov 6 11:19 llama-batched-bench
    53106477 24 -rwxr-xr-x 1 root root 72120 Nov 6 11:19 llama-q8dot
    53106472 24 -rwxr-xr-x 1 root root 72792 Nov 6 11:19 llama-vdot
    53106467 344 -rwxr-xr-x 1 root root 402176 Nov 6 11:19 llama-convert-llama2c-to-ggml
    53106462 312 -rwxr-xr-x 1 root root 331888 Nov 6 11:19 llama-logits
    53106457 2296 -rwxr-xr-x 1 root root 2364160 Nov 6 11:19 llama-diffusion-cli
    53106452 2288 -rwxr-xr-x 1 root root 2363232 Nov 6 11:19 llama-finetune
    53106448 2284 -rwxr-xr-x 1 root root 2362976 Nov 6 11:19 llama-gen-docs
    53106444 2292 -rwxr-xr-x 1 root root 2363824 Nov 6 11:19 llama-speculative-simple
    53106439 2308 -rwxr-xr-x 1 root root 2366952 Nov 6 11:19 llama-speculative
    53106435 32 -rwxr-xr-x 1 root root 75000 Nov 6 11:19 llama-simple-chat
    53106430 24 -rwxr-xr-x 1 root root 73592 Nov 6 11:19 llama-simple
    53106426 2304 -rwxr-xr-x 1 root root 2363864 Nov 6 11:19 llama-save-load-state
    53106422 2312 -rwxr-xr-x 1 root root 2364784 Nov 6 11:19 llama-retrieval
    53106417 2284 -rwxr-xr-x 1 root root 2362872 Nov 6 11:19 llama-passkey
    53106412 2312 -rwxr-xr-x 1 root root 2364512 Nov 6 11:19 llama-parallel
    53106408 2308 -rwxr-xr-x 1 root root 2370184 Nov 6 11:19 llama-lookup-stats
    53106404 72 -rwxr-xr-x 1 root root 86424 Nov 6 11:19 llama-lookup-merge
    53106399 2300 -rwxr-xr-x 1 root root 2369336 Nov 6 11:19 llama-lookup-create
    53106395 2312 -rwxr-xr-x 1 root root 2370256 Nov 6 11:19 llama-lookup
    53106390 2292 -rwxr-xr-x 1 root root 2363800 Nov 6 11:19 llama-lookahead
    53106386 32 -rwxr-xr-x 1 root root 75056 Nov 6 11:19 llama-gguf
    53106381 88 -rwxr-xr-x 1 root root 145176 Nov 6 11:19 llama-gguf-hash
    53106370 2284 -rwxr-xr-x 1 root root 2363312 Nov 6 11:19 llama-eval-callback
    53106365 2296 -rwxr-xr-x 1 root root 2363992 Nov 6 11:19 llama-embedding
    53106361 2272 -rwxr-xr-x 1 root root 2362784 Nov 6 11:19 llama-batched
    53106357 48 -rwxr-xr-x 1 root root 75608 Nov 6 11:19 test-alloc
    53106350 16 -rwxr-xr-x 1 root root 70248 Nov 6 11:19 test-c
    53106346 20 -rwxr-xr-x 1 root root 71416 Nov 6 11:19 test-mtmd-c-api
    53106339 772 -rwxr-xr-x 1 root root 796000 Nov 6 11:19 libmtmd.so
    53106328 20 -rwxr-xr-x 1 root root 72104 Nov 6 11:19 test-rope
    53106321 40 -rwxr-xr-x 1 root root 76352 Nov 6 11:19 test-quantize-perf
    53106314 20 -rwxr-xr-x 1 root root 72416 Nov 6 11:19 test-quantize-fns
    53106308 20 -rwxr-xr-x 1 root root 72520 Nov 6 11:18 test-barrier
    53106301 20 -rwxr-xr-x 1 root root 72824 Nov 6 11:18 test-autorelease
    53106295 16 -rwxr-xr-x 1 root root 70960 Nov 6 11:18 test-model-load-cancel
    53106289 772 -rwxr-xr-x 1 root root 816728 Nov 6 11:18 test-backend-ops
    53106282 72 -rwxr-xr-x 1 root root 78360 Nov 6 11:18 test-gguf
    53106275 60 -rwxr-xr-x 1 root root 77704 Nov 6 11:18 test-opt
    53106268 2292 -rwxr-xr-x 1 root root 2363288 Nov 6 11:18 test-arg-parser
    53106261 2280 -rwxr-xr-x 1 root root 2364096 Nov 6 11:18 test-thread-safety
    53106254 376 -rwxr-xr-x 1 root root 408728 Nov 6 11:18 test-regex-partial
    53106247 44 -rwxr-xr-x 1 root root 77464 Nov 6 11:18 test-log
    53106240 360 -rwxr-xr-x 1 root root 418616 Nov 6 11:18 test-json-partial
    53106233 1800 -rwxr-xr-x 1 root root 1854896 Nov 6 11:18 test-chat-template
    53106226 1768 -rwxr-xr-x 1 root root 1858432 Nov 6 11:18 test-chat-parser
    53106220 316 -rwxr-xr-x 1 root root 331856 Nov 6 11:18 test-tokenizer-1-spm
    53106216 308 -rwxr-xr-x 1 root root 332256 Nov 6 11:18 test-tokenizer-1-bpe
    53106211 24 -rwxr-xr-x 1 root root 73520 Nov 6 11:18 test-gbnf-validator
    53106207 224 -rwxr-xr-x 1 root root 250736 Nov 6 11:18 test-quantize-stats
    53106203 708 -rwxr-xr-x 1 root root 747032 Nov 6 11:18 test-json-schema-to-grammar
    53106196 1932 -rwxr-xr-x 1 root root 2001824 Nov 6 11:18 test-chat
    53106189 44 -rwxr-xr-x 1 root root 77144 Nov 6 11:18 test-llama-grammar
    53106183 688 -rwxr-xr-x 1 root root 747952 Nov 6 11:18 test-grammar-integration
    53106176 44 -rwxr-xr-x 1 root root 74608 Nov 6 11:18 test-grammar-parser
    53106170 48 -rwxr-xr-x 1 root root 75544 Nov 6 11:18 test-sampling
    53106164 328 -rwxr-xr-x 1 root root 334128 Nov 6 11:18 test-tokenizer-0
    53106128 2468 -rwxr-xr-x 1 root root 2580248 Nov 6 11:17 libllama.so
    53105858 48 -rwxr-xr-x 1 root root 77640 Nov 6 11:16 libggml.so
    53105854 704 -rwxr-xr-x 1 root root 776144 Nov 6 11:16 libggml-cpu.so
    53105815 31640 -rwxr-xr-x 1 root root 32399104 Nov 6 11:16 libggml-cuda.so
    53105548 644 -rwxr-xr-x 1 root root 658616 Nov 6 11:03 libggml-base.so

    However, when I start the finetuning script from my working directory

    root@a3e66db5040b:/home/ollam3# python3 Training/finetunevisionGemma3_Herz.py

    I get the error:

    {'loss': 0.7894, 'grad_norm': 0.4628991484642029, 'learning_rate': 2.8000000000000003e-06, 'epoch': 0.14}
    {'loss': 0.7595, 'grad_norm': 0.47416451573371887, 'learning_rate': 3.2000000000000003e-06, 'epoch': 0.15}
    {'loss': 0.7543, 'grad_norm': 0.6138670444488525, 'learning_rate': 3.6000000000000003e-06, 'epoch': 0.17}
    {'train_runtime': 453.559, 'train_samples_per_second': 0.706, 'train_steps_per_second': 0.022, 'train_loss': 0.7631916403770447, 'epoch': 0.17}
    100%|██████████████████████████████████████████████████████████████████████████████████████| 10/10 [07:33<00:00, 45.36s/it]
    Unsloth: ##### The current model auto adds a BOS token.
    Unsloth: ##### Your chat template has a BOS token. We shall remove it temporarily.
    Unsloth: Merging model weights to 16-bit format...
    /usr/local/lib/python3.12/dist-packages/unsloth_zoo/saving_utils.py:965: UserWarning: Model medgemma-4b-it-unsloth-bnb-4bit not found locally or on HuggingFace
    warnings.warn(f"Model {model_name} not found locally or on HuggingFace")
    Unsloth: Converting to GGUF format...
    ==((====))== Unsloth: Conversion from HF to GGUF information
    \ /| [0] Installing llama.cpp might take 3 minutes.
    O^O/ _/ \ [1] Converting HF to GGUF bf16 might take 3 minutes.
    \ / [2] Converting GGUF bf16 to ['q4_k_m'] might take 10 minutes each.
    "-____-" In total, you will have to wait at least 16 minutes.

    Unsloth: Installing llama.cpp. This might take 3 minutes...
    Unsloth: llama.cpp folder exists but binaries not found - will rebuild
    Unsloth: Updating system package directories
    Unsloth: All required system packages already installed!
    Unsloth: Install llama.cpp and building - please wait 1 to 3 minutes
    Unsloth: Install GGUF and other packages
    Traceback (most recent call last):
    File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1074, in save_to_gguf
    quantizer_location, converter_location = check_llama_cpp()
    ^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 343, in check_llama_cpp
    raise RuntimeError(
    RuntimeError: Unsloth: No working quantizer found in llama.cpp
    Files in directory: convert_hf_to_gguf.py, common, gguf-py, convert_llama_ggml_to_gguf.py, CONTRIBUTING.md, README.md, convert_lora_to_gguf.py, CMakeLists.txt, build, CMakePresets.json, SECURITY.md, CODEOWNERS, examples, licenses, flake.nix, ggml, requirements.txt, ci, convert_hf_to_gguf_update.py, Makefile

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1835, in unsloth_save_pretrained_gguf
    all_file_locations, want_full_precision, is_vlm_update = save_to_gguf(
    ^^^^^^^^^^^^^
    File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1085, in save_to_gguf
    quantizer_location, converter_location = install_llama_cpp(
    ^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 415, in install_llama_cpp
    try_execute(f"{pip} install gguf protobuf sentencepiece mistral_common", **kwargs)
    File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 275, in try_execute
    raise RuntimeError(error_msg)
    RuntimeError: [FAIL] Command uv pip install gguf protobuf sentencepiece mistral_common failed with exit code 2
    stdout: error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/home/ollam3/Training/finetunevisionGemma3_Herz.py", line 217, in
    model.save_pretrained_gguf("unsloth_finetune", tokenizer, quantization_method = "q4_k_m")
    File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1855, in unsloth_save_pretrained_gguf
    raise RuntimeError(f"Unsloth: GGUF conversion failed: {e}")
    RuntimeError: Unsloth: GGUF conversion failed: [FAIL] Command uv pip install gguf protobuf sentencepiece mistral_common failed with exit code 2
    stdout: error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment

    If I remove llama.ccp from the working directory, I get the same error.
    If I only remove the build folder (I made yesterday) from the folder llama.ccp, I get this same error.

    What I find odd ist this error within the error message:

    /usr/local/lib/python3.12/dist-packages/unsloth_zoo/saving_utils.py:965: UserWarning: Model medgemma-4b-it-unsloth-
    bnb-4bit not found locally or on HuggingFace
    warnings.warn(f"Model {model_name} not found locally or on HuggingFace")

    Thus, I cannot confirm (in my case) that unsloth finds or rebuilds llama.ccp :-(

  3. rolandtannous commented on Nov 7, 2025

    @rolandtannous
    Contributor

    @weoieoeo since your finetunevisionGemma3_Herz.py script is in Training folder, that's your current working directory when you run the script , as such your llama.cpp folder should be under /home/ollam3/Training/ so /home/ollam3/Training/llama.cpp (and not the parent directory /home/ollam3)

    can you try again that way

  4. weoieoeo commented on Nov 7, 2025

    @weoieoeo
    Author

    everything is now located in the same working directory:

    root@a3e66db5040b:/home/ollam3# ls -list
    total 20
    53084204 4 drwxr-xr-x 2 root root 4096 Nov 7 09:17 Final_visual_Dataset
    53084194 8 -rw-r--r-- 1 root root 7796 Nov 7 09:06 finetunevisionGemma3_Herz.py
    53216899 4 drwxr-xr-x 25 root root 4096 Nov 7 08:17 llama.cpp
    53216791 4 drwxr-xr-x 3 root root 4096 Nov 7 07:24 medgemma-4b-it-unsloth-bnb-4bit

    However, I still get the same error:

    he model is already on multiple devices. Skipping the move to device specified in args.
    ==((====))== Unsloth - 2x faster free finetuning | Num GPUs used = 1
    \ /| Num examples = 1,891 | Num Epochs = 1 | Total steps = 5
    O^O/ _/ \ Batch size per device = 8 | Gradient accumulation steps = 4
    \ / Data Parallel GPUs = 1 | Total batch size (8 x 4 x 1) = 32
    "--" Trainable parameters = 153,991,168 of 4,454,070,640 (3.46% trained)
    0%| | 0/5 [00:00<?, ?it/s]Unsloth: Will smartly offload gradients to save VRAM!
    {'loss': 0.7674, 'grad_norm': 0.46200355887413025, 'learning_rate': 0.0, 'epoch': 0.02}
    {'loss': 0.7739, 'grad_norm': 0.44840002059936523, 'learning_rate': 4.0000000000000003e-07, 'epoch': 0.03}
    {'loss': 0.7708, 'grad_norm': 0.4650793969631195, 'learning_rate': 8.000000000000001e-07, 'epoch': 0.05}
    {'loss': 0.7471, 'grad_norm': 0.6353945136070251, 'learning_rate': 1.2000000000000002e-06, 'epoch': 0.07}
    {'loss': 0.747, 'grad_norm': 0.5188019275665283, 'learning_rate': 1.6000000000000001e-06, 'epoch': 0.08}
    {'train_runtime': 231.3029, 'train_samples_per_second': 0.692, 'train_steps_per_second': 0.022, 'train_loss': 0.7612290024757385, 'epoch': 0.08}
    100%|████████████████████████████████████████████████████████████████████████████████████████| 5/5 [03:51<00:00, 46.26s/it]
    Unsloth: ##### The current model auto adds a BOS token.
    Unsloth: ##### Your chat template has a BOS token. We shall remove it temporarily.
    Unsloth: Merging model weights to 16-bit format...
    /usr/local/lib/python3.12/dist-packages/unsloth_zoo/saving_utils.py:965: UserWarning: Model medgemma-4b-it-unsloth-bnb-4bit not found locally or on HuggingFace
    warnings.warn(f"Model {model_name} not found locally or on HuggingFace")
    Unsloth: Converting to GGUF format...
    ==((====))== Unsloth: Conversion from HF to GGUF information
    \ /| [0] Installing llama.cpp might take 3 minutes.
    O^O/ _/ \ [1] Converting HF to GGUF bf16 might take 3 minutes.
    \ / [2] Converting GGUF bf16 to ['q4_k_m'] might take 10 minutes each.
    "-
    -" In total, you will have to wait at least 16 minutes.

    Unsloth: Installing llama.cpp. This might take 3 minutes...
    Unsloth: llama.cpp folder exists but binaries not found - will rebuild
    Unsloth: Updating system package directories
    Unsloth: All required system packages already installed!
    Unsloth: Install llama.cpp and building - please wait 1 to 3 minutes
    Unsloth: Install GGUF and other packages
    Traceback (most recent call last):
    File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1074, in save_to_gguf
    quantizer_location, converter_location = check_llama_cpp()
    ^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 343, in check_llama_cpp
    raise RuntimeError(
    RuntimeError: Unsloth: No working quantizer found in llama.cpp
    Files in directory: convert_hf_to_gguf.py, common, gguf-py, convert_llama_ggml_to_gguf.py, CONTRIBUTING.md, README.md, convert_lora_to_gguf.py, CMakeLists.txt, CMakePresets.json, SECURITY.md, CODEOWNERS, examples, licenses, flake.nix, ggml, requirements.txt, ci, convert_hf_to_gguf_update.py, Makefile, flake.lock

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1835, in unsloth_save_pretrained_gguf
    all_file_locations, want_full_precision, is_vlm_update = save_to_gguf(
    ^^^^^^^^^^^^^
    File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1085, in save_to_gguf
    quantizer_location, converter_location = install_llama_cpp(
    ^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 415, in install_llama_cpp
    try_execute(f"{pip} install gguf protobuf sentencepiece mistral_common", **kwargs)
    File "/usr/local/lib/python3.12/dist-packages/unsloth_zoo/llama_cpp.py", line 275, in try_execute
    raise RuntimeError(error_msg)
    RuntimeError: [FAIL] Command uv pip install gguf protobuf sentencepiece mistral_common failed with exit code 2
    stdout: error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/home/ollam3/finetunevisionGemma3_Herz.py", line 217, in
    model.save_pretrained_gguf("unsloth_finetune", tokenizer, quantization_method = "q4_k_m")
    File "/usr/local/lib/python3.12/dist-packages/unsloth/save.py", line 1855, in unsloth_save_pretrained_gguf
    raise RuntimeError(f"Unsloth: GGUF conversion failed: {e}")
    RuntimeError: Unsloth: GGUF conversion failed: [FAIL] Command uv pip install gguf protobuf sentencepiece mistral_common failed with exit code 2
    stdout: error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment

    Maybe one has to conclude that I does currently not work within a docker container?

  5. rolandtannous commented on Nov 7, 2025

    @rolandtannous
    Contributor

    I don't know how your container is constructed. It works perfectly fine with our regular container which is unfortunately not arm64 compatible because i don't have access to a DGX or an arm64 machine to troubleshoot. If you have some time , I'd appreciate if you can hop on our discord server and ping me there . I have the same nickname. Maybe we can work through it and find a solution that works for arm64 machines.

  6. weoieoeo commented on Nov 7, 2025

    @weoieoeo
    Author

    I just copied all files from the llama.ccp-build folder to the llama.ccp base folder that is located in the working folder

    root@a3e66db5040b:/home/ollam3# cp llama.cpp/build/bin/* ./llama.cpp/

    Unsloth now finds the necessary files and creates a gguf! Many thanks!

  7. rolandtannous commented on Nov 7, 2025

    @rolandtannous
    Contributor

    Yes that's how it's supposed to work.

    Great to know that it works for you now.
    I'll close this thread for the time being.

    Thank you for reaching out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed - pending confirmation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions