[Solved in b8808] IQ4_NL Gibberish in llama.cpp

#3
by jpsequeira - opened

Hey,

image

This with the command:

CUDA_VISIBLE_DEVICES=0,1,2,3,4 llama-server -m ~/.cache/huggingface/hub/models--unsloth--GLM-5.1-GGUF/snapshots/3238253553497e969f3144fda297dac98b99dbbe/UD-IQ4_NL/GLM-5.1-UD-IQ4_NL-00001-of-00009.gguf --temp 1.0 --top-p 0.95  --host 0.0.0.0 --alias "GLM 5.1" 

In Ik_llama with:

CUDA_VISIBLE_DEVICES=0,1,2,3,4 ik-cli -m ~/.cache/huggingface/hub/models--unsloth--GLM-5.1-GGUF/snapshots/3238253553497e969f3144fda297dac98b99dbbe/UD-IQ4_NL/GLM-5.1-UD-IQ4_NL-00001-of-00009.gguf --temp 1.0 --top-p 0.95   --merge-qkv -ctk q8_0 -ctv q4_0 -mla 3 --no-mmap --jinja -b 8192 -ub 8192 -amb 512 -mqkv -ngl 99 --host 0.0.0.0 -khad -vhad --alias "GLM 5.1"  -cnv

very coherant.

version: 8709 (85d482e6b)
built with GNU 15.2.1 for Linux x86_64

The Q4_K_XL quantization keeps outputting question marks on my machine.

@alpine3 have you tried running it in ik_llama.cpp? For me it works with the command above

IQ_4XS broken for me in mainline llama.cpp

Unsloth AI org

version: 8709 (85d482e6b)
built with GNU 15.2.1 for Linux x86_64

The Q4_K_XL quantization keeps outputting question marks on my machine.

IQ_4XS broken for me in mainline llama.cpp

What CUDA version are you guys using?

What CUDA version are you guys using?

13.2

Unsloth AI org
β€’
edited Apr 9

What CUDA version are you guys using?

13.2

That's why, at the moment CUDA 13.2 doesn't work for any GGUF and it spits out gibberish no matter the uploader. It's a known issue and we told NVIDIA to fix it but it looks like they are not done yet.

https://github.com/unslothai/unsloth/issues/4849

in the meantime it works on ik_llama. for thinking we need to enable it --chat-template-kwargs '{"enable_thinking":true}'

What CUDA version are you guys using?

13.2

That's why, at the moment CUDA 13.2 doesn't work for any GGUF and it spits out GGUF no matter the uploader. It's a known issue and we told NVIDIA to fix it but it looks like they are not done yet....

https://github.com/unslothai/unsloth/issues/4849

This is actually a rather strange bug. Some requests do work fine, actually, and some doesn't.
here is some samples:
Bad one (request in Russian, about 5000 tokens) - gibberish:

image

Short request in Russian - perfectly fine coherent answer:

image

Short request in English - also works fine.

image

Long summarization request (about 8000 tokens) - gibberish:

image

Here is some startup logs:

srv          load: spawning server instance with name=GLM-5-1-IQ4-XS:default on port 37067
srv          load: spawning server instance with args:
srv          load:   /home/drros/llama.cpp/build/bin/llama-server
srv          load:   --host
srv          load:   127.0.0.1
srv          load:   --mlock
srv          load:   --no-mmap
srv          load:   --no-mmproj-offload
srv          load:   --port
srv          load:   37067
srv          load:   --temperature
srv          load:   1.0
srv          load:   --top-p
srv          load:   0.95
srv          load:   --webui-mcp-proxy
srv          load:   --alias
srv          load:   GLM-5-1-IQ4-XS:default
srv          load:   --ctx-size
srv          load:   102400
srv          load:   --cache-type-k
srv          load:   q8_0
srv          load:   --cache-type-v
srv          load:   q8_0
srv          load:   --fit-target
srv          load:   1024,1024,1024
srv          load:   --kv-unified
srv          load:   --model
srv          load:   /mnt/ds1nfs/codellamaweights/glm-5-1-iq4-xxs/GLM-5.1-UD-IQ4_XS-00001-of-00009.gguf
srv          load:   --parallel
srv          load:   4
srv          load:   --reasoning
srv          load:   on
srv          load:   --ubatch-size
srv          load:   2048
srv  log_server_r: done request: POST /models/load 192.168.0.61 200
[37067] ggml_cuda_init: found 3 CUDA devices (Total VRAM: 71963 MiB):
[37067]   Device 0: NVIDIA RTX PRO 4000 Blackwell, compute capability 12.0, VMM: yes, VRAM: 23987 MiB
[37067]   Device 1: NVIDIA RTX PRO 4000 Blackwell, compute capability 12.0, VMM: yes, VRAM: 23987 MiB
[37067]   Device 2: NVIDIA RTX PRO 4000 Blackwell, compute capability 12.0, VMM: yes, VRAM: 23987 MiB
[37067] build_info: b8720-d12cc3d1c
Unsloth AI org
β€’
edited Apr 9

in the meantime it works on ik_llama. for thinking we need to enable it --chat-template-kwargs '{"enable_thinking":true}'

What CUDA version are you guys using?

13.2

That's why, at the moment CUDA 13.2 doesn't work for any GGUF and it spits out GGUF no matter the uploader. It's a known issue and we told NVIDIA to fix it but it looks like they are not done yet....

https://github.com/unslothai/unsloth/issues/4849

This is actually a rather strange bug. Some requests do work fine, actually, and some doesn't.
here is some samples:
Bad one (request in Russian, about 5000 tokens) - gibberish:

image

Short request in Russian - perfectly fine coherent answer:

image

Short request in English - also works fine.

image

Long summarization request (about 8000 tokens) - gibberish:

image

Here is some startup logs:

srv          load: spawning server instance with name=GLM-5-1-IQ4-XS:default on port 37067
srv          load: spawning server instance with args:
srv          load:   /home/drros/llama.cpp/build/bin/llama-server
srv          load:   --host
srv          load:   127.0.0.1
srv          load:   --mlock
srv          load:   --no-mmap
srv          load:   --no-mmproj-offload
srv          load:   --port
srv          load:   37067
srv          load:   --temperature
srv          load:   1.0
srv          load:   --top-p
srv          load:   0.95
srv          load:   --webui-mcp-proxy
srv          load:   --alias
srv          load:   GLM-5-1-IQ4-XS:default
srv          load:   --ctx-size
srv          load:   102400
srv          load:   --cache-type-k
srv          load:   q8_0
srv          load:   --cache-type-v
srv          load:   q8_0
srv          load:   --fit-target
srv          load:   1024,1024,1024
srv          load:   --kv-unified
srv          load:   --model
srv          load:   /mnt/ds1nfs/codellamaweights/glm-5-1-iq4-xxs/GLM-5.1-UD-IQ4_XS-00001-of-00009.gguf
srv          load:   --parallel
srv          load:   4
srv          load:   --reasoning
srv          load:   on
srv          load:   --ubatch-size
srv          load:   2048
srv  log_server_r: done request: POST /models/load 192.168.0.61 200
[37067] ggml_cuda_init: found 3 CUDA devices (Total VRAM: 71963 MiB):
[37067]   Device 0: NVIDIA RTX PRO 4000 Blackwell, compute capability 12.0, VMM: yes, VRAM: 23987 MiB
[37067]   Device 1: NVIDIA RTX PRO 4000 Blackwell, compute capability 12.0, VMM: yes, VRAM: 23987 MiB
[37067]   Device 2: NVIDIA RTX PRO 4000 Blackwell, compute capability 12.0, VMM: yes, VRAM: 23987 MiB
[37067] build_info: b8720-d12cc3d1c

Using any version lower than CUDA 13.2 will solve your issue. Unsloth Studio for example uses 13.0 so there is no issue with generation

I think we should make a PSA and let everyone know not to use CUDA 13.2 because it seems like it's more problematic than originally anticipated

How come ik_llama works but llama.cpp doesn't? If the problem lies in CUDA 13.2...

Unsloth AI org

How come ik_llama works but llama.cpp doesn't? If the problem lies in CUDA 13.2...

If ik_llama works then continue using that, but still would not recommend using CUDA 13.2. The issue has been confirmed by us and 30+ users.

I have a similar problem. llama.cpp-b8733.tar.gz works well; following versions (didn't pinpoint the exact breaking change version yet) give gibberish output most of the times.
This might give some insight on why ik_llama works thogh?

I see this problem with CUDA 13.0 (Toolkit version 13.0.2, nvcc V13.0.88) Driver Version: 595.58.03

b8808 seems to work fine now! I believe there was a problem with FA in some previous release that got fixed.

Unsloth AI org

b8808 seems to work fine now! I believe there was a problem with FA in some previous release that got fixed.

Awesome thanks for sharing! @jpsequeira could you edit your post if possible incase other people also encoutner the problem? Thanks so much! :)

jpsequeira changed discussion title from IQ4_NL Gibberish in llama.cpp to [Solved in b8808] IQ4_NL Gibberish in llama.cpp

@danielhanchen perhaps updating the do not use cuda post would be a good as well

Sign up or log in to comment