Skip to content

Eval bug: Qwen 3.5 degraded pp performance on HIP/ROCm #20218

Description

@riveroon

Name and Version

riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232$ ./llama-cli --version
ggml_cuda_init: found 1 ROCm devices:
Device 0: AMD Radeon RX 9070 XT, gfx1201 (0x1201), VMM: no, Wave Size: 32
load_backend: loaded ROCm backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-hip.so
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-rpc.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-cpu-haswell.so
version: 8232 (6fce5c6)
built with GNU 11.4.0 for Linux x86_64

Operating systems

Linux, Windows

GGML backends

HIP

Hardware

CPU: Ryzen 5 5700X
GPU: Radeon RX 9070 XT 16GB (gfx1201), ROCm 7.2

Models

Qwen 3.5 Model family (size & quant seems irrelevant)

Problem description & steps to reproduce

Qwen 3.5 models exhibit severe pp performance degradation when run on HIP/ROCm vs. Vulkan, regardless of context depth.
Standard builds for Windows & Linux from https://github.com/ggml-org/llama.cpp/releases , as well as those compiled natively (on Linux, gcc 13.3.0), consistently showed degraded performance.

The benchmark below was performed on an Ubuntu 24.04.4 (Linux 6.17.0) with ROCm 7.2 system with build 8232 from the release page. (Llama 2 and Qwen 3 models were benchmarked for comparison & proof of system integrity)

model size params backend ngl fa test t/s
llama 7B Q4_0 3.56 GiB 6.74 B Vulkan 99 1 pp512 4018.63 ± 17.08
llama 7B Q4_0 3.56 GiB 6.74 B Vulkan 99 1 tg128 127.74 ± 2.60
llama 7B Q4_0 3.56 GiB 6.74 B ROCm 99 1 pp512 5146.36 ± 20.74
llama 7B Q4_0 3.56 GiB 6.74 B ROCm 99 1 tg128 93.88 ± 0.09
qwen3 4B Q4_0 2.21 GiB 4.02 B Vulkan 99 1 pp512 6169.16 ± 9.47
qwen3 4B Q4_0 2.21 GiB 4.02 B Vulkan 99 1 tg128 171.08 ± 0.22
qwen3 4B Q4_0 2.21 GiB 4.02 B ROCm 99 1 pp512 7152.43 ± 100.78
qwen3 4B Q4_0 2.21 GiB 4.02 B ROCm 99 1 tg128 131.16 ± 1.22
qwen35 4B Q4_0 2.40 GiB 4.21 B Vulkan 99 1 pp512 3760.47 ± 7.70
qwen35 4B Q4_0 2.40 GiB 4.21 B Vulkan 99 1 tg128 102.54 ± 0.32
qwen35 4B Q4_0 2.40 GiB 4.21 B ROCm 99 1 pp512 50.27 ± 1.73
qwen35 4B Q4_0 2.40 GiB 4.21 B ROCm 99 1 tg128 80.95 ± 0.44
qwen35 2B BF16 3.51 GiB 1.88 B Vulkan 99 1 pp512 8162.26 ± 51.99
qwen35 2B BF16 3.51 GiB 1.88 B Vulkan 99 1 tg128 107.37 ± 0.02
qwen35 2B BF16 3.51 GiB 1.88 B ROCm 99 1 pp512 69.60 ± 0.23
qwen35 2B BF16 3.51 GiB 1.88 B ROCm 99 1 tg128 86.69 ± 0.51

Additionally, building with flags -DGGML_HIP_GRAPHS=ON partially restores performance back to 4 digits at lower context depth, but falls apart at higher context depth (build 8233):

model size params backend ngl fa test t/s
qwen35 4B Q4_0 2.40 GiB 4.21 B ROCm 99 1 pp512 3391.79 ± 0.00
qwen35 4B Q4_0 2.40 GiB 4.21 B ROCm 99 1 tg128 103.32 ± 0.00
qwen35 4B Q4_0 2.40 GiB 4.21 B ROCm 99 1 pp512 @ d8192 51.58 ± 0.00
qwen35 4B Q4_0 2.40 GiB 4.21 B ROCm 99 1 tg128 @ d8192 99.26 ± 0.00

First Bad Commit

No response

Relevant log output

Logs
riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232$ ./llama-bench -m "/media/riveroon/347E19C47E198032/llama-2-7b.Q4_0.gguf" -ngl 99 -fa 0,1
ggml_cuda_init: found 1 ROCm devices:
  Device 0: AMD Radeon RX 9070 XT, gfx1201 (0x1201), VMM: no, Wave Size: 32
load_backend: loaded ROCm backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-hip.so
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-rpc.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| llama 7B Q4_0                  |   3.56 GiB |     6.74 B | ROCm       |  99 |  0 |           pp512 |      4751.54 ± 71.00 |
| llama 7B Q4_0                  |   3.56 GiB |     6.74 B | ROCm       |  99 |  0 |           tg128 |         86.15 ± 0.17 |
| llama 7B Q4_0                  |   3.56 GiB |     6.74 B | ROCm       |  99 |  1 |           pp512 |      5146.36 ± 20.74 |
| llama 7B Q4_0                  |   3.56 GiB |     6.74 B | ROCm       |  99 |  1 |           tg128 |         93.88 ± 0.09 |

build: 6fce5c6a7 (8232)
riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232$ ./llama-bench -m "/media/riveroon/347E19C47E198032/Qwen3-4B-Q4_0.gguf" -ngl 99 -fa 0,1
ggml_cuda_init: found 1 ROCm devices:
  Device 0: AMD Radeon RX 9070 XT, gfx1201 (0x1201), VMM: no, Wave Size: 32
load_backend: loaded ROCm backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-hip.so
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-rpc.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| qwen3 4B Q4_0                  |   2.21 GiB |     4.02 B | ROCm       |  99 |  0 |           pp512 |        533.74 ± 2.29 |
| qwen3 4B Q4_0                  |   2.21 GiB |     4.02 B | ROCm       |  99 |  0 |           tg128 |        104.92 ± 0.47 |
| qwen3 4B Q4_0                  |   2.21 GiB |     4.02 B | ROCm       |  99 |  1 |           pp512 |     7152.43 ± 100.78 |
| qwen3 4B Q4_0                  |   2.21 GiB |     4.02 B | ROCm       |  99 |  1 |           tg128 |        131.16 ± 1.22 |

build: 6fce5c6a7 (8232)
riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232$ ./llama-bench -m "/media/riveroon/347E19C47E198032/Qwen3.5-4B-Q4_0.gguf" -ngl 99 -fa 0,1
ggml_cuda_init: found 1 ROCm devices:
  Device 0: AMD Radeon RX 9070 XT, gfx1201 (0x1201), VMM: no, Wave Size: 32
load_backend: loaded ROCm backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-hip.so
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-rpc.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | ROCm       |  99 |  0 |           pp512 |         48.23 ± 1.27 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | ROCm       |  99 |  0 |           tg128 |         79.37 ± 0.35 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | ROCm       |  99 |  1 |           pp512 |         50.27 ± 1.73 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | ROCm       |  99 |  1 |           tg128 |         80.95 ± 0.44 |

build: 6fce5c6a7 (8232)
riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232$ ./llama-bench -m ~/Downloads/Qwen3.5-2B-BF16.gguf -ngl 99 -fa 0,1
ggml_cuda_init: found 1 ROCm devices:
  Device 0: AMD Radeon RX 9070 XT, gfx1201 (0x1201), VMM: no, Wave Size: 32
load_backend: loaded ROCm backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-hip.so
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-rpc.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-rocm-7.2-x64/llama-b8232/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| qwen35 2B BF16                 |   3.51 GiB |     1.88 B | ROCm       |  99 |  0 |           pp512 |         68.11 ± 0.22 |
| qwen35 2B BF16                 |   3.51 GiB |     1.88 B | ROCm       |  99 |  0 |           tg128 |         85.63 ± 0.32 |
| qwen35 2B BF16                 |   3.51 GiB |     1.88 B | ROCm       |  99 |  1 |           pp512 |         69.60 ± 0.23 |
| qwen35 2B BF16                 |   3.51 GiB |     1.88 B | ROCm       |  99 |  1 |           tg128 |         86.69 ± 0.51 |

build: 6fce5c6a7 (8232)



riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232$ ./llama-bench -m "/media/riveroon/347E19C47E198032/Qwen3.5-4B-Q4_0.gguf" -ngl 99 -fa 0,1
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-rpc.so
WARNING: radv is not a conformant Vulkan implementation, testing use only.
ggml_vulkan: Found 1 Vulkan devices:
ggml_vulkan: 0 = AMD Radeon RX 9070 XT (RADV GFX1201) (radv) | uma: 0 | fp16: 1 | bf16: 1 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores: KHR_coopmat
load_backend: loaded Vulkan backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-vulkan.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | Vulkan     |  99 |  0 |           pp512 |      3735.58 ± 32.89 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | Vulkan     |  99 |  0 |           tg128 |        101.67 ± 0.51 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | Vulkan     |  99 |  1 |           pp512 |       3760.47 ± 7.70 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | Vulkan     |  99 |  1 |           tg128 |        102.54 ± 0.32 |

build: 6fce5c6a7 (8232)
riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232$ ./llama-bench -m "/media/riveroon/347E19C47E198032/Qwen3-4B-Q4_0.gguf" -ngl 99 -fa 0,1
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-rpc.so
WARNING: radv is not a conformant Vulkan implementation, testing use only.
ggml_vulkan: Found 1 Vulkan devices:
ggml_vulkan: 0 = AMD Radeon RX 9070 XT (RADV GFX1201) (radv) | uma: 0 | fp16: 1 | bf16: 1 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores: KHR_coopmat
load_backend: loaded Vulkan backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-vulkan.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| qwen3 4B Q4_0                  |   2.21 GiB |     4.02 B | Vulkan     |  99 |  0 |           pp512 |     5922.46 ± 125.76 |
| qwen3 4B Q4_0                  |   2.21 GiB |     4.02 B | Vulkan     |  99 |  0 |           tg128 |        165.92 ± 0.82 |
| qwen3 4B Q4_0                  |   2.21 GiB |     4.02 B | Vulkan     |  99 |  1 |           pp512 |       6169.16 ± 9.47 |
| qwen3 4B Q4_0                  |   2.21 GiB |     4.02 B | Vulkan     |  99 |  1 |           tg128 |        171.08 ± 0.22 |

build: 6fce5c6a7 (8232)
riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232$ ./llama-bench -m "/media/riveroon/347E19C47E198032/llama-2-7b.Q4_0.gguf" -ngl 99 -fa 0,1
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-rpc.so
WARNING: radv is not a conformant Vulkan implementation, testing use only.
ggml_vulkan: Found 1 Vulkan devices:
ggml_vulkan: 0 = AMD Radeon RX 9070 XT (RADV GFX1201) (radv) | uma: 0 | fp16: 1 | bf16: 1 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores: KHR_coopmat
load_backend: loaded Vulkan backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-vulkan.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| llama 7B Q4_0                  |   3.56 GiB |     6.74 B | Vulkan     |  99 |  0 |           pp512 |      3835.78 ± 25.51 |
| llama 7B Q4_0                  |   3.56 GiB |     6.74 B | Vulkan     |  99 |  0 |           tg128 |        123.66 ± 0.26 |
| llama 7B Q4_0                  |   3.56 GiB |     6.74 B | Vulkan     |  99 |  1 |           pp512 |      4018.63 ± 17.08 |
| llama 7B Q4_0                  |   3.56 GiB |     6.74 B | Vulkan     |  99 |  1 |           tg128 |        127.74 ± 2.60 |

build: 6fce5c6a7 (8232)
riveroon@riveroon-MS-7B89:~/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232$ ./llama-bench -m ~/Downloads/Qwen3.5-2B-BF16.gguf -ngl 99 -fa 0,1
load_backend: loaded RPC backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-rpc.so
WARNING: radv is not a conformant Vulkan implementation, testing use only.
ggml_vulkan: Found 1 Vulkan devices:
ggml_vulkan: 0 = AMD Radeon RX 9070 XT (RADV GFX1201) (radv) | uma: 0 | fp16: 1 | bf16: 1 | warp size: 64 | shared memory: 65536 | int dot: 1 | matrix cores: KHR_coopmat
load_backend: loaded Vulkan backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-vulkan.so
load_backend: loaded CPU backend from /home/riveroon/Downloads/llama-b8232-bin-ubuntu-vulkan-x64/llama-b8232/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| qwen35 2B BF16                 |   3.51 GiB |     1.88 B | Vulkan     |  99 |  0 |           pp512 |      8024.57 ± 22.07 |
| qwen35 2B BF16                 |   3.51 GiB |     1.88 B | Vulkan     |  99 |  0 |           tg128 |        106.99 ± 0.12 |
| qwen35 2B BF16                 |   3.51 GiB |     1.88 B | Vulkan     |  99 |  1 |           pp512 |      8162.26 ± 51.99 |
| qwen35 2B BF16                 |   3.51 GiB |     1.88 B | Vulkan     |  99 |  1 |           tg128 |        107.37 ± 0.02 |

build: 6fce5c6a7 (8232)
$ HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
    cmake -S . -B build -DGGML_HIP=ON -DGPU_TARGETS=gfx1201 -DGGML_HIP_GRAPHS=ON -DCMAKE_HIP_FLAGS=" --rocm-path=/opt/rocm -mllvm --amdgpu-unroll-threshold-local=600" -DCMAKE_BUILD_TYPE=Release \
    && cmake --build build --config Release -- -j 16
[...]
$ ./llama-bench -m "/media/riveroon/347E19C47E198032/Qwen3.5-4B-Q4_0.gguf" -ngl 99 -fa 1 -d 0,8192 -r 1
ggml_cuda_init: found 1 ROCm devices:
  Device 0: AMD Radeon RX 9070 XT, gfx1201 (0x1201), VMM: no, Wave Size: 32
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | ROCm       |  99 |  1 |           pp512 |       3391.79 ± 0.00 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | ROCm       |  99 |  1 |           tg128 |        103.32 ± 0.00 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | ROCm       |  99 |  1 |   pp512 @ d8192 |         51.58 ± 0.00 |
| qwen35 4B Q4_0                 |   2.40 GiB |     4.21 B | ROCm       |  99 |  1 |   tg128 @ d8192 |         99.26 ± 0.00 |

build: c5a778891 (8233)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions