Repository navigation
Description
Name and Version
build that I start llama-server from:
ggml_cuda_init: found 1 ROCm devices:
Device 0: AMD Radeon RX 6900 XT, gfx1030 (0x1030), VMM: no, Wave Size: 32
version: 7917 (91ea44e89)
built with GNU 13.3.0 for Linux x86_64
build that I start rpc-server from:
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GeForce RTX 5080, compute capability 12.0, VMM: yes
version: 7917 (91ea44e89)
built with GNU 13.3.0 for Linux x86_64
Operating systems
Linux
GGML backends
HIP
Hardware
1 RTX 8080
1 RX 6900 XT
Models
GLM-4.7-Flash-MXFP4_MOE.gguf https://huggingface.co/noctrex/GLM-4.7-Flash-MXFP4_MOE-GGUF
Problem description & steps to reproduce
I have GLM 4.7 Flash (GLM-4.7-Flash-MXFP4_MOE) running on llama.cpp but it only works when I turn off quantization of the key-value cache. I want the quantization to increase context space and speed like it does with Qwen3-coder.
With flash attention on the server does start up, but when I send a request it fails with the given log output.
Without flash attention, it seems too slow. I do see that the CPU is being used a bit more than I would expect. Maybe the cpu usage is causing some of that slow down.
Setup:
I have an RTX 5080 and RX 6900 XT, with a llama.cpp release built from yesterday.
The RTX is used through an the llama rpc server and the RX on normal llama-server.
server commands:
~/Documents/llama.cpp/build-cuda/bin/rpc-server -p 50052
~/Documents/llama.cpp/build/bin/llama-server \
-m ~/Documents/llama.cpp_models/GLM-4.7-Flash-MXFP4_MOE.gguf \
--host 0.0.0.0 \
--rpc localhost:50052 \
--split-mode layer \
-fa on \
--cache-type-k q4_0 \
--cache-type-v q4_0 \
--batch-size 512 \
--ubatch-size 64 \
--tensor-split 1,0.9 \
-fit off \
-ngl 99 \
-c 100000 \
--n-predict 8192 \
--temp 0.7 --top-p 1.0 --min-p 0.01 \
--defrag-thold 0.1
First Bad Commit
No response
Relevant log output
Logs
Feb 03 15:19:07 homeserver llama-server[183387]: slot update_slots: id 3 | task 0 | prompt processing progress, n_tokens = 512, batch.n_tokens = 512, progress = 0.412571
Feb 03 15:19:07 homeserver llama-server[183387]: /home/niraj/Documents/llama.cpp/ggml/src/ggml-cuda/template-instances/../fattn-common.cuh:919: GGML_ASSERT(max_blocks_per_sm > 0) failed
Feb 03 15:19:07 homeserver llama-server[184087]: gdb: warning: Couldn't determine a path for the index cache directory.
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183592]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183407]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183406]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183405]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183404]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183403]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183402]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183401]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183400]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183399]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183398]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183397]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183396]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183395]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183394]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183393]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183392]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183391]
Feb 03 15:19:07 homeserver llama-server[184087]: [New LWP 183388]
Feb 03 15:19:10 homeserver llama-server[184087]: [Thread debugging using libthread_db enabled]
Feb 03 15:19:10 homeserver llama-server[184087]: Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Feb 03 15:19:10 homeserver llama-server[184087]: 0x00007fc726f10813 in __GI___wait4 (pid=184087, stat_loc=0x0, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
Feb 03 15:19:10 homeserver llama-server[184087]: warning: 30 ../sysdeps/unix/sysv/linux/wait4.c: No such file or directory
Feb 03 15:19:10 homeserver llama-server[184087]: #0 0x00007fc726f10813 in __GI___wait4 (pid=184087, stat_loc=0x0, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
Feb 03 15:19:10 homeserver llama-server[184087]: 30 in ../sysdeps/unix/sysv/linux/wait4.c
Feb 03 15:19:10 homeserver llama-server[184087]: #1 0x00007fc7279a9703 in ggml_print_backtrace () from /home/niraj/Documents/llama.cpp/build/bin/libggml-base.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #2 0x00007fc7279a98ab in ggml_abort () from /home/niraj/Documents/llama.cpp/build/bin/libggml-base.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #3 0x00007fc72673b274 in void launch_fattn<512, 8, 4>(ggml_backend_cuda_context&, ggml_tensor*, void (*)(char const*, char const*, char const*, char const*, char const*, int const*, float*, HIP_vector_type<float, 2u>*, float, float, float, float, unsigned int, float, int, HIP_vector_type<unsigned int, 3u>, int, int, int, int, int, int, int, int, int, int, int, long, int, int, long, int, int, int, int, int, long), int, unsigned long, int, bool, bool, bool, int) () from /home/niraj/Documents/llama.cpp/build/bin/libggml-hip.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #4 0x00007fc726736c2d in void ggml_cuda_flash_attn_ext_tile_case<576, 512>(ggml_backend_cuda_context&, ggml_tensor*) () from /home/niraj/Documents/llama.cpp/build/bin/libggml-hip.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #5 0x00007fc7265bda61 in ggml_cuda_graph_evaluate_and_capture(ggml_backend_cuda_context*, ggml_cgraph*, bool, bool, void const*) () from /home/niraj/Documents/llama.cpp/build/bin/libggml-hip.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #6 0x00007fc7265bb9b1 in ggml_backend_cuda_graph_compute(ggml_backend*, ggml_cgraph*) () from /home/niraj/Documents/llama.cpp/build/bin/libggml-hip.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #7 0x00007fc7279c5e17 in ggml_backend_sched_graph_compute_async () from /home/niraj/Documents/llama.cpp/build/bin/libggml-base.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #8 0x00007fc7276bc441 in llama_context::graph_compute(ggml_cgraph*, bool) () from /home/niraj/Documents/llama.cpp/build/bin/libllama.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #9 0x00007fc7276bdf04 in llama_context::process_ubatch(llama_ubatch const&, llm_graph_type, llama_memory_context_i*, ggml_status&) () from /home/niraj/Documents/llama.cpp/build/bin/libllama.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #10 0x00007fc7276c53ea in llama_context::decode(llama_batch const&) () from /home/niraj/Documents/llama.cpp/build/bin/libllama.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #11 0x00007fc7276c6e5f in llama_decode () from /home/niraj/Documents/llama.cpp/build/bin/libllama.so.0
Feb 03 15:19:10 homeserver llama-server[184087]: #12 0x00006096f2a4e638 in server_context_impl::update_slots() ()
Feb 03 15:19:10 homeserver llama-server[184087]: #13 0x00006096f2a962de in server_queue::start_loop(long) ()
Feb 03 15:19:10 homeserver llama-server[184087]: #14 0x00006096f29af2a0 in main ()
Feb 03 15:19:10 homeserver llama-server[184087]: [Inferior 1 (process 183387) detached]
Activity
[-]Eval bug:[/-][+]Eval bug: GLM 4.7 Flash not working with flash attention on[/+]niraj-rayalla commentedon Feb 4, 2026
I should mention that I've tried some other models, with flash attention on with quantization, such as:
and they all fail with
fattn-common.cuh:919: GGML_ASSERT(max_blocks_per_sm > 0) failed,EXCEPT for
Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.JohannesGaessler commentedon Feb 4, 2026
I'm having presumably the same issue on my RX 6800 even on versions that were definitely working before. However, this is on an Arch-based Linux distribution and I did a system upgrade inbetween. So I'm thinking this may be an issue with ROCm versions.
JohannesGaessler commentedon Feb 4, 2026
On my system with ROCm v7.1.1 I can reproduce this issue on base metal. However, the llama.cpp Docker container that we build with ROCm v7.0 I do not encounter this issue. Can you post your ROCm version and confirm whether or not this is also the case for you?
fungos commentedon Feb 4, 2026
I'm having a crash (assertion) with flash attention models too, it is a gfx1030 card and rocm 7.1.1 on arch linux.
niraj-rayalla commentedon Feb 4, 2026
Yep, I'm on ROCm version 7.1.1 as well.
I also happened to have another RTX 5080 on my daily use computer and instead of using the 5080 and 6900 combo on the server machine I RPCed both 5080s across the network and it seems I can use flash attention now.
So it definitely seems like an AMD/ROCm issue.
fungos commentedon Feb 4, 2026
I compiled in both debug and release, and in debug it works, but I'm unsure if it is actually taking the gpu path with
launch_fattnproblematic code.eg, in debug:
cmake -S . -B build-debug -G Ninja -DCMAKE_BUILD_TYPE=Debug -DGGML_ACCELERATE=ON -DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_COMMON=ON -DGGML_LTO=ON -DGGML_HIP=ON -DGPU_TARGETS=gfx1030 -DGGML_HIP_ROCWMMA_FATTN=ON -DGGML_BACKEND_DL=ONBut it is very slow, 1tk/s, which may be because of debug build but also not using gpu, unsure.
niraj-rayalla commentedon Feb 4, 2026
Oops. I accidentally closed this issue and can't reopen.
niraj-rayalla commentedon Feb 4, 2026
I downgraded to ROCm 7.0.1 and now GLM 4.7 Flash works with flash attention on!
ayylmaonade commentedon Feb 6, 2026
How is the actual pre-fill/prompt processing speed? I've been having immense issues with prefill speed using this model on my RX 7900 XTX using both ROCm & Vulkan.
niraj-rayalla commentedon Feb 6, 2026
I'm getting anywhere from 400 to close to 2000 tokens per second for prefill and low 50s to high 50s for postfill.
Although my setup is not a pure AMD GPU setup.
l29ah commentedon Feb 6, 2026
likely related to #19128
github-actions commentedon Mar 24, 2026
This issue was closed because it has been inactive for 14 days since being marked as stale.
tenortim commentedon May 9, 2026
I know that this is closed, but if anybody is following, I ran into the same assertion failure trying to build llama.cpp on a system where I have a Ryzen 8745HS (gfx1103) and an external GPU hookup with a 6900XT (gfx1030) era card. I was able to successfully build a HIP/ROCm version that supports both cards (using
-DCMAKE_HIP_ARCHITECTURES="gfx1030;gfx1103"to force building for both rather than using autodetection which only built for the builtin APU), but attempting to test (with gemma-3-1b-it-GGUF as the model) threw the exact same error.On investigation, the problem seems to be because attempting to the use the tile kernel on this era of card can exceed the gfx1030's VGPR budget on many current models. This card is from the RDNA2 era and only has two SIMD32 units per CU. For a model where D=256 trying to use the tile kernel needs 164-200 VGPRs/thread which, in turn requires 8x wave32 wavefronts/block. At only 2x SIMD32 units/CU we're capped at 6 wave32s. 6 < 8 and so we were returning occupancy=0 triggering the assert failure.
I'm have simple workaround that explicitly checks for RDNA2 and uses the VEC kernel instead (or none). I'm working on a more general fix.
midnightx86 commentedon Jul 16, 2026
I have the same issue with my RX 6600 xt.