llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

Eval bug: HIP/ROCm multi-GPU on Windows 11 produces silently corrupted output (fluent gibberish) with gfx1100 + gfx1201 -- single-GPU HIP and dual-GPU Linux HIP are correct

Open LilT59 opened this issue 2 months ago • 2 comments

Name and Version

version: 0.3.0-dev (build 10767, commit cff184438) official release zip: llama-b10767-bin-win-rocm-10.0-x64.zip (ROCm 10.0 userland bundled per #26973 -- amdhip64_7.dll, amd_comgr.dll, rocm_kpack.dll shipped alongside the exes)

Operating systems

Windows 11 (dGPU drivers: Adrenalin 32.0.31041.1004, dated 2026-08-16)

GGML backends

HIP/ROCm -- multi-GPU (2 discrete AMD cards). Vulkan used as clean control.

Hardware

  • AMD Ryzen 7 9800X3D, 64 GB RAM, NVMe SSD
  • GPU 0: AMD Radeon RX 7900 XTX 24 GB (gfx1100, RDNA3, discrete)
  • GPU 1: AMD Radeon RX 9070 XT 16 GB (gfx1201, RDNA4, discrete)
  • iGPU (RDNA2) present on the CPU die; excluded from all runs via HIP_VISIBLE_DEVICES (verified 0 = XTX, 2 = 9070 XT, list-devices shows only the two dGPUs)

Models

  • Qwen3.8-27B UD-Q4_K_XL (unsloth dynamic quant, ~21 GB)
  • Qwen3.6-35B-A3B UD-IQ4_NL (second witness model)

Configs / Repro

All with HIP_VISIBLE_DEVICES=0,2, both cards loaded (weights split, both show VRAM usage and compute activity -- verified with OS GPU counters during the runs).

  1. Layer split + flash attention: llama-cli -m Qwen3.8-27B-UD-Q4_K_XL.gguf -ngl 99 -sm layer -fa on -c 8192 -p "What is 2+2?" -n 64
  2. Tensor split + flash attention: same but -sm tensor
  3. Layer split + HSA_OVERRIDE_GFX_VERSION=11.0.0: same as (1) with override
  4. Layer split + f16 KV: same as (1) with -ctk f16 -ctv f16
  5. Qwen3.6-35B witness: (1) with Qwen3.6-35B-A3B-UD-IQ4_NL.gguf

Expected / Actual

Expected: normal coherent continuation ("What is 2+2?" -> "4" etc.) Actual: generation starts promptly at NORMAL speeds with no errors, but output is fluent-but-nonsensical word salad. Both corrupt samples below are verbatim from the run logs (output begins plausibly with a thinking-mode marker, then degrades):

benchmark layer-split run (bench4-dual-layer.log): > What is 2+2? Answer with just the number. Then write the word HELLO. [Start thinking] 1 The to ... (continues) "... x22 to x set || the x| the fact is"

HSA_OVERRIDE_GFX_VERSION=11.0.0 run (run3-raw.log): > What is 2+2? Answer with just the number. [Start thinking] cPlIn 2-pl*, x high+T is T is

(occasional CJK glyphs also observed in longer runs)

Perf while corrupt looks healthy (llama-bench: pp ~197, tg ~26 on the dual config), so llama-bench does NOT detect the corruption -- text sanity-check is required.

Clean controls (same GPUs, same models)

  • Windows HIP, HIP_VISIBLE_DEVICES=0 (single XTX only): CORRECT, 36 t/s, clean "2+2" answer
  • Kubuntu (Linux), same ROCm 10 userland family, dual XTX+9070 XT via HIP_VISIBLE_DEVICES=0,2: CORRECT in every config tried (layer/tensor/f16 KV) -- verified in a full cross-OS battery
  • Windows Vulkan (release b10819), dual XTX+9070 XT (--device Vulkan0,Vulkan2): CORRECT, used daily in production (Q6_K_L, ~37 t/s with MTP)

Regression context

  • ~July 2026: dual-GPU ROCm on THIS Windows install WORKED (correct, slower than Vulkan). Stack then: ROCm 7.x-era llama.cpp build (pre-b10549), Adrenalin pre-31041.
  • 2026-08-16: Adrenalin 32.0.31041.1004 auto-installed.
  • 2026-09: official b10767 ROCm 10.0 -- single card fixed (DLL bundling), dual card corrupt in every mode above.
  • Candidate culprits: Adrenalin 31041, ROCm 7->10 userland, or llama.cpp ggml-hip changes in the b10549..b10767 window. NOT bisected further because Linux dual works on the same current stack -> strongly points at the Windows-specific (WDDM) multi-GPU path.

Notes for maintainers

  • Symptom class matches the gfx1151 silent-corruption family (#27556, #27579, #28211, #27797) and the Vulkan multi-GPU gibberish #26197: backend produces garbage at normal speed with zero errors while another backend is correct at the identical commit. This report extends the class to mixed-generation dual discrete GPUs (gfx1100+gfx1201) on Windows HIP -- the gfx1151 host-buffer workaround (PR #28574, unmerged) does not apply here (both cards discrete, archs outside the fix's gate).
  • No P2P on this config (WDDM, different archs): cross-device traffic goes through host staging -- suspicion: corruption in the Windows HIP multi-device staging/sync path.
  • Happy to run debug builds / add env-var experiments if that would help isolate it.

Additional evidence

  • Full repro logs, battery scripts, and the cross-OS resolution matrix are available on request (kept locally).
  • Happy to run debug builds, add HIP/Vulkan env-var experiments, or test candidate workarounds if that would help isolate the failure.

LilT59 avatar Sep 10 '26 00:09 LilT59

I can confirm this on all recent builds (ROCm10) with Win10 + RX9070 & R9700 AI Pro. Did not test older versions (HIP SDK).

There is a ticket on this issue in lemonade llama-cpp-rocm: https://github.com/lemonade-sdk/llamacpp-rocm/issues/75

If my reading is correct this is a rocm / amd windows driver issue and not a bug in llama.cpp. What I can confirm is with the workarround from the qouted thread (needs compile from src): -DGGML_CUDA_NO_PEER_COPY=ON The bug disappears. Did not test if and how much it hurts performance (ROCm tg slower than vulkan as always).

For the time beeing maybe the only solution would be to add this flag to the llama.cpp official release for win rocm?

andj1210 avatar Sep 13 '26 11:09 andj1210

Related data point, same class of problem (Windows HIP multi-GPU, dual R9700): with the corruption worked around by using Vulkan, multi-GPU on Windows is still host-staged because the AMD Windows driver exposes no peer access. Measured on b11717 Vulkan, Qwen3.8-27B Q4_K_M: -sm none 32.1 t/s, -sm layer 31.3, -sm tensor 14.9 — about 0.28 ms per all-reduce × 128 per token. Filed as a driver-level feature request with the full numbers: ROCm/rocm-systems#13715.

wmmunn avatar Oct 19 '26 04:10 wmmunn