Skip to content

llama.cpp GGUF breaks [FIXED] #1376

Closed
Closed

Description

@danielhanchen

As of 3rd December 2024 - fixed.

Please update Unsloth via

pip install --upgrade --no-deps --no-cache-dir unsloth

Activity

  1. changed the title [-]llama.cpp GGUF breaks[/-] [+]llama.cpp GGUF breaks [FIXED][/+] on Dec 4, 2024
  2. pinned this issue on Dec 4, 2024
  3. criogennn commented on Dec 4, 2024

    @criogennn
    RuntimeError                              Traceback (most recent call last)
    Cell In[13], [line 12](vscode-notebook-cell:?execution_count=13&line=12)
          [9](vscode-notebook-cell:?execution_count=13&line=9) if False: model.push_to_hub_gguf("hf/model", tokenizer, quantization_method = "f16", token = "")
         [11](vscode-notebook-cell:?execution_count=13&line=11) # Save to q4_k_m GGUF
    ---> [12](vscode-notebook-cell:?execution_count=13&line=12) if True: model.save_pretrained_gguf("model", tokenizer, quantization_method = "q4_k_m")
         [13](vscode-notebook-cell:?execution_count=13&line=13) if False: model.push_to_hub_gguf("hf/model", tokenizer, quantization_method = "q4_k_m", token = "")
         [15](vscode-notebook-cell:?execution_count=13&line=15) # Save to multiple GGUF options - much faster if you want multiple!
    
    File ~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1683, in unsloth_save_pretrained_gguf(self, save_directory, tokenizer, quantization_method, first_conversion, push_to_hub, token, private, is_main_process, state_dict, save_function, max_shard_size, safe_serialization, variant, save_peft_format, tags, temporary_location, maximum_memory_usage)
       [1681](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1681) python_install = install_python_non_blocking(["gguf", "protobuf"])
       [1682](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1682) git_clone.wait()
    -> [1683](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1683) makefile = install_llama_cpp_make_non_blocking()
       [1684](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1684) new_save_directory, old_username = unsloth_save_model(**arguments)
       [1685](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1685) python_install.wait()
    
    File ~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:778, in install_llama_cpp_make_non_blocking()
        [776](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:776) check = os.system("cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=OFF -DLLAMA_CURL=ON")
        [777](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:777) if check != 0:
    --> [778](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:778)     raise RuntimeError(f"*** Unsloth: Failed compiling llama.cpp using os.system(...) with error {check}. Please report this ASAP!")
        [779](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:779) pass
        [780](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:780) # f"cmake --build llama.cpp/build --config Release -j{psutil.cpu_count()*2} --clean-first --target {' '.join(LLAMA_CPP_TARGETS)}",
    
    RuntimeError: *** Unsloth: Failed compiling llama.cpp using os.system(...) with error 32512. Please report this ASAP!
    
    
    

    Error on

    if True: model.save_pretrained_gguf("model", tokenizer, quantization_method = "q4_k_m")
    

    model unsloth/Llama-3.2-3B-Instruct
    GPU RTX 3050 8GB

    pytorch 2.5.1

  4. criogennn commented on Dec 4, 2024

    @criogennn

    install cmake and get this one

    RuntimeError                              Traceback (most recent call last)
    File ~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1689, in unsloth_save_pretrained_gguf(self, save_directory, tokenizer, quantization_method, first_conversion, push_to_hub, token, private, is_main_process, state_dict, save_function, max_shard_size, safe_serialization, variant, save_peft_format, tags, temporary_location, maximum_memory_usage)
       [1688](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1688) try:
    -> [1689](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1689)     new_save_directory, old_username = unsloth_save_model(**arguments)
       [1690](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:1690)     makefile = None
    
    File ~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/torch/utils/_contextlib.py:116, in context_decorator.<locals>.decorate_context(*args, **kwargs)
        [115](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/torch/utils/_contextlib.py:115) with ctx_factory():
    --> [116](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/torch/utils/_contextlib.py:116)     return func(*args, **kwargs)
    
    File ~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:714, in unsloth_save_model(model, tokenizer, save_directory, save_method, push_to_hub, token, is_main_process, state_dict, save_function, max_shard_size, safe_serialization, variant, save_peft_format, use_temp_dir, commit_message, private, create_pr, revision, commit_description, tags, temporary_location, maximum_memory_usage)
        [713](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:713) else:
    --> [714](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:714)     internal_model.save_pretrained(**save_pretrained_settings)
        [715](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:715) pass
    
    File ~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/modeling_utils.py:2938, in PreTrainedModel.save_pretrained(self, save_directory, is_main_process, state_dict, save_function, push_to_hub, max_shard_size, safe_serialization, variant, token, save_peft_format, **kwargs)
       [2937](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/modeling_utils.py:2937) for name in disjoint_names:
    -> [2938](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/modeling_utils.py:2938)     state_dict[name] = state_dict[name].clone()
       [2940](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/modeling_utils.py:2940) # When not all duplicates have been cleaned, still remove those keys, but put a clear warning.
       [2941](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/modeling_utils.py:2941) # If the link between tensors was done at runtime then `from_pretrained` will not get
       [2942](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/modeling_utils.py:2942) # the key back leading to random tensor. A proper warning will be shown
       [2943](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/modeling_utils.py:2943) # during reload (if applicable), but since the file is not necessarily compatible with
       [2944](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/transformers/modeling_utils.py:2944) # the config, better show a proper warning.
    ...
    --> [778](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:778)     raise RuntimeError(f"*** Unsloth: Failed compiling llama.cpp using os.system(...) with error {check}. Please report this ASAP!")
        [779](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:779) pass
        [780](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neuro/~/miniconda3/envs/unsloth_env/lib/python3.11/site-packages/unsloth/save.py:780) # f"cmake --build llama.cpp/build --config Release -j{psutil.cpu_count()*2} --clean-first --target {' '.join(LLAMA_CPP_TARGETS)}",
    
    RuntimeError: *** Unsloth: Failed compiling llama.cpp using os.system(...) with error 256. Please report this ASAP!
    
  5. criogennn commented on Dec 4, 2024

    @criogennn

    Before updating unsloth, I encountered the error "CUDA driver error: out of memory". After updating yesterday, the error changed to the one described above. This issue arises when I attempt to save a model in GGUF 4-bit format to run it later in Ollama. Is the 8GB memory of my RTX 3050 insufficient for this task? Training the model completed successfully; the problem occurs specifically during the saving process. I would greatly appreciate any advice or assistance.

  6. shimmyshimmer commented on Dec 18, 2024

    @shimmyshimmer
    Member

    Before updating unsloth, I encountered the error "CUDA driver error: out of memory". After updating yesterday, the error changed to the one described above. This issue arises when I attempt to save a model in GGUF 4-bit format to run it later in Ollama. Is the 8GB memory of my RTX 3050 insufficient for this task? Training the model completed successfully; the problem occurs specifically during the saving process. I would greatly appreciate any advice or assistance.

    We're working on the process easier.

    You updated unsloth AND unsloth-zoo correct? https://docs.unsloth.ai/get-started/install-update/updating

  7. Eleanorkong commented on Dec 21, 2024

    @Eleanorkong

    Hi, How to update through conda?

  8. opertifelipe commented on Dec 27, 2024

    @opertifelipe

    I got the same error when I am trying to save the model to gguf format model.save_pretrained_gguf("model_gguf", tokenizer,):

    `packages/unsloth/save.py:1054) if check != 0: raise RuntimeError("Failed compiling llama.cpp. Please report this ASAP!")

    RuntimeError: Failed compiling llama.cpp. Please report this ASAP!`

    Is this issue still not solverd?

  9. unpinned this issue on Jan 20, 2025
  10. AleefBilal commented on Jan 24, 2025

    @AleefBilal

    The issue still exists. Kindly report a fix if anyone finds it.

  11. chaoyupeng commented on Feb 4, 2025

    @chaoyupeng

    Hi, this issue still kinda exists, I was trying to save the fine tuned DeepSeek-R1-Distill-Llama-8B-GGUF into gguf format, and the same error popped up.
    RuntimeError: *** Unsloth: Failed compiling llama.cpp using os.system(...) with error 32512. Please report this ASAP!

  12. AleefBilal commented on Feb 4, 2025

    @AleefBilal

    I bypassed this issue but using an early version of llama.cpp and then following the below temporary solution that has now become permanent it seems.
    cd llama.cpp

    git checkout b3345

    git submodule update --init --recursive

    make clean

    make all -j

    git log -1


    credit goes to
    #748 (comment)

  13. Dillion commented on Feb 5, 2025

    @Dillion

    i think you can bypass by manually compiling llama.cpp (clean install) using latest cmake instructions for your system from https://github.com/ggerganov/llama.cpp/blob/master/docs/build.md#cpu-build, and then running save_pretrained_gguf.

    Issues might be due to errors in cmake compilation flag for your system in

    check = os.system("cmake llama.cpp -B llama.cpp/build -DBUILD_SHARED_LIBS=OFF -DGGML_CUDA=OFF -DLLAMA_CURL=ON")
    , e.g. ggml-org/llama.cpp#9937

  14. everythingisc00l commented on Feb 9, 2025

    @everythingisc00l
    Contributor

    Check my solution, if you have crashes with saving .gguf models.

    #748 (comment)

  15. IridiumMaster commented on Feb 15, 2025

    @IridiumMaster

    This is still broken for me:
    100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 400/400 [1:18:58<00:00, 11.85s/it]
    Saving model with quantization method: q4_k_m
    make: Entering directory '/workspace/llama.cpp'
    Makefile:2: *** The Makefile build is deprecated. Use the CMake build instead. For more details, see https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md. Stop.
    make: Leaving directory '/workspace/llama.cpp'
    sh: 1: cmake: not found
    Traceback (most recent call last):
    File "/workspace/unsloth-cli-v2.py", line 235, in
    run(args)
    File "/workspace/unsloth-cli-v2.py", line 148, in run
    model.save_pretrained_gguf(
    File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 1684, in unsloth_save_pretrained_gguf
    makefile = install_llama_cpp_make_non_blocking()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 779, in install_llama_cpp_make_non_blocking
    raise RuntimeError(f"*** Unsloth: Failed compiling llama.cpp using os.system(...) with error {check}. Please report this ASAP!")
    RuntimeError: *** Unsloth: Failed compiling llama.cpp using os.system(...) with error 32512. Please report this ASAP!

  16. everythingisc00l commented on Feb 15, 2025

    @everythingisc00l
    Contributor

    This is still broken for me: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 400/400 [1:18:58<00:00, 11.85s/it] Saving model with quantization method: q4_k_m make: Entering directory '/workspace/llama.cpp' Makefile:2: *** The Makefile build is deprecated. Use the CMake build instead. For more details, see https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md. Stop. make: Leaving directory '/workspace/llama.cpp' sh: 1: cmake: not found Traceback (most recent call last): File "/workspace/unsloth-cli-v2.py", line 235, in run(args) File "/workspace/unsloth-cli-v2.py", line 148, in run model.save_pretrained_gguf( File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 1684, in unsloth_save_pretrained_gguf makefile = install_llama_cpp_make_non_blocking() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 779, in install_llama_cpp_make_non_blocking raise RuntimeError(f"*** Unsloth: Failed compiling llama.cpp using os.system(...) with error {check}. Please report this ASAP!") RuntimeError: *** Unsloth: Failed compiling llama.cpp using os.system(...) with error 32512. Please report this ASAP!

    you sure that you installed cmake before?

  17. smirki commented on Feb 16, 2025

    @smirki

    This is still broken for me: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 400/400 [1:18:58<00:00, 11.85s/it] Saving model with quantization method: q4_k_m make: Entering directory '/workspace/llama.cpp' Makefile:2: *** The Makefile build is deprecated. Use the CMake build instead. For more details, see https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md. Stop. make: Leaving directory '/workspace/llama.cpp' sh: 1: cmake: not found Traceback (most recent call last): File "/workspace/unsloth-cli-v2.py", line 235, in run(args) File "/workspace/unsloth-cli-v2.py", line 148, in run model.save_pretrained_gguf( File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 1684, in unsloth_save_pretrained_gguf makefile = install_llama_cpp_make_non_blocking() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 779, in install_llama_cpp_make_non_blocking raise RuntimeError(f"*** Unsloth: Failed compiling llama.cpp using os.system(...) with error {check}. Please report this ASAP!") RuntimeError: *** Unsloth: Failed compiling llama.cpp using os.system(...) with error 32512. Please report this ASAP!

    I got the same error. Installing Cmake in my docker container worked for me.

  18. IridiumMaster commented on Feb 16, 2025

    @IridiumMaster

    I installed cmake and compiled Llama.cpp and was confronted with this further error after re-running:
    Unsloth: Saving tokenizer... Done.
    Done.
    Unsloth: Converting llama model. Can use fast conversion = False.
    ==((====))== Unsloth: Conversion from QLoRA to GGUF information
    \ /| [0] Installing llama.cpp might take 3 minutes.
    O^O/ _/ \ [1] Converting HF to GGUF 16bits might take 3 minutes.
    \ / [2] Converting GGUF 16bits 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...
    Traceback (most recent call last):
    File "/workspace/unsloth-cli-v2.py", line 235, in
    run(args)
    File "/workspace/unsloth-cli-v2.py", line 148, in run
    model.save_pretrained_gguf(
    File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 1735, in unsloth_save_pretrained_gguf
    all_file_locations, want_full_precision = save_to_gguf(
    ^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 1070, in save_to_gguf
    raise RuntimeError(
    RuntimeError: Unsloth: The file 'llama.cpp/llama-quantize' or 'llama.cpp/quantize' does not exist.
    But we expect this file to exist! Maybe the llama.cpp developers changed the name?

  19. IridiumMaster commented on Feb 16, 2025

    @IridiumMaster

    Running again (with CMake installed) after deleting the llama.cpp directory produces this gem:
    -- Adding CPU backend variant ggml-cpu: -march=native
    CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
    Call Stack (most recent call first):
    /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    /usr/share/cmake-3.22/Modules/FindCURL.cmake:181 (find_package_handle_standard_args)
    common/CMakeLists.txt:88 (find_package)

    -- Configuring incomplete, errors occurred!
    See also "/workspace/llama.cpp/build/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
    File "/workspace/unsloth-cli-v2.py", line 235, in
    run(args)
    File "/workspace/unsloth-cli-v2.py", line 148, in run
    model.save_pretrained_gguf(
    File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 1684, in unsloth_save_pretrained_gguf
    makefile = install_llama_cpp_make_non_blocking()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 779, in install_llama_cpp_make_non_blocking
    raise RuntimeError(f"*** Unsloth: Failed compiling llama.cpp using os.system(...) with error {check}. Please report this ASAP!")
    RuntimeError: *** Unsloth: Failed compiling llama.cpp using os.system(...) with error 256. Please report this ASAP!

  20. IridiumMaster commented on Feb 16, 2025

    @IridiumMaster

    Installed Curl and still got this:
    Unsloth: Converting llama model. Can use fast conversion = False.
    ==((====))== Unsloth: Conversion from QLoRA to GGUF information
    \ /| [0] Installing llama.cpp might take 3 minutes.
    O^O/ _/ \ [1] Converting HF to GGUF 16bits might take 3 minutes.
    \ / [2] Converting GGUF 16bits 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...
    Traceback (most recent call last):
    File "/workspace/unsloth-cli-v2.py", line 235, in
    run(args)
    File "/workspace/unsloth-cli-v2.py", line 148, in run
    model.save_pretrained_gguf(
    File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 1735, in unsloth_save_pretrained_gguf
    all_file_locations, want_full_precision = save_to_gguf(
    ^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/dist-packages/unsloth/save.py", line 1070, in save_to_gguf
    raise RuntimeError(
    RuntimeError: Unsloth: The file 'llama.cpp/llama-quantize' or 'llama.cpp/quantize' does not exist.
    But we expect this file to exist! Maybe the llama.cpp developers changed the name?

  21. AleefBilal commented on Feb 20, 2025

    @AleefBilal

    @IridiumMaster How do you install llama.cpp?

  22. IridiumMaster commented on Feb 20, 2025

    @IridiumMaster

    @AleefBilal , I tried it 3 different ways. I tried compiling it from the download that the first run of unsloth did, and then I tried deleting the directory, downloading and compiling per their instructions. Finally, I just had cmake and curl installed and I let unsloth do everything itself. Basically, every version of this failed. I'm doing this on runpod.

  23. everythingisc00l commented on Feb 21, 2025

    @everythingisc00l
    Contributor

    @AleefBilal , I tried it 3 different ways. I tried compiling it from the download that the first run of unsloth did, and then I tried deleting the directory, downloading and compiling per their instructions. Finally, I just had cmake and curl installed and I let unsloth do everything itself. Basically, every version of this failed. I'm doing this on runpod.

    Where your file llama-quantize? you sure that you have it with last build? you need to check your llama.cpp folder first.

  24. AleefBilal commented on Feb 27, 2025

    @AleefBilal

    @IridiumMaster Below are the working steps for conversion of a vanilla model to GGUF using Unsloth and llama.cpp.
    The operation was performed using RUNPOD with runpod/pytorch:2.4.0-py3.11-cuda12.4.1-devel-ubuntu22.04

    1. git clone https://github.com/ggml-org/llama.cpp.git

    2. cd llama.cpp

    3. git checkout b3345

    5. git submodule update --init --recursive

    6. make clean

    7. make all -j

    8. git log -1


    For better understanding, I've also attached a link to the Notebook that was used for the conversion.
    GGUF conversion Notebook

  25. danielhanchen commented on Jun 19, 2026

    @danielhanchen
    MemberAuthor

    This should be fixed now - sorry on the delay - please update with uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir - if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!

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

    URGENT BUGfixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions