From 32881da9fddc8e18273653ad1674ca3744e2449f Mon Sep 17 00:00:00 2001 From: mici81 Date: Sun, 25 Oct 2026 07:34:29 +0000 Subject: [PATCH] docs/GUIDE: two engines on one R9700 pair -- the driver's queue split (amdgpu.num_kcq) and the start order The four compute queue slots the GUIDE names are what amdgpu leaves to user queues while it keeps four of the card's eight for its own kernel queues. With num_kcq=0 MES maps all eight (compute_hqd_mask 0xf), two engines' queues fit, and the weight reads beside the all-reduces can stay on. The order the engines create their second-lane queues decides where MES places them, so the first engine should serve one request before the second starts. Measured with Qwen3.8-27B and TranslateGemma 27B on two R9700s. Co-Authored-By: Claude Opus 5.5 (1M context) --- docs/GUIDE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 1bb8efed..b536efbc 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -3475,6 +3475,8 @@ minutes of concurrent long prompts on both without a stall. The ceiling costs pr reductions running on fewer blocks: Qwen3.8-27B's 41k-token prefill 9.5 s uncapped, 9.8 s at 64, 10.3 s at 32. Give the engine started first its `--gpu-headroom-mib` for the second. A model whose decode reads weights ahead on a second queue (Gemma 4 without chained launches) slows sharply beside a second server: an R9700 has four compute queue slots and the two servers hold eight, so every decode step waits for a queue switch. Gemma 4 31B at TP4 beside an idle Qwen3.8-Flash-Next went from 13 ms to 41 ms a step; with `RADIANCE_PREFETCH_BESIDE=0` in the Gemma engine it took 13.8 ms. +The four slots are what the amdgpu kernel driver leaves to user queues. It keeps compute queues of its own for submissions through the graphics stack (Vulkan and OpenGL in Mesa), four of the eight on the card's two compute pipes by default (`num_cp_queues 4` in `/sys/class/kfd/kfd/topology/nodes/*/properties`). A machine that drives its cards through ROCm alone can give them back with the module option `amdgpu.num_kcq=0` (a line `options amdgpu num_kcq=0` in `/etc/modprobe.d/`, then `update-initramfs -u` and a reboot): `num_cp_queues` reads 8 and `dmesg` shows `compute_hqd_mask 0x0000000f` (`num_kcq=1` leaves `0x0000000e`, three queues a pipe, though `num_cp_queues` reads 7). An engine holds up to four queues a card (the step's lane, the second lane, the mover's and the runtime's own), so two engines then fit and the weight reads can stay on. Start them one after the other and send the first a short request before starting the second: an engine creates its second-lane queue at the first step that uses it (a decode step where the weight reads or another second-lane op run), and a queue created after the other engine's queues lands where both run slower (TranslateGemma one stream 120 t/s instead of 181, Qwen beside a busy TranslateGemma 50 ms a step instead of 43). Qwen3.8-27B and TranslateGemma 27B on two R9700s, the reads on in both: TranslateGemma one stream 180.6-180.9 t/s and Qwen beside a busy TranslateGemma 42.9 ms a step, against 152-154 t/s and 41.0-42.8 ms with the default slots and `RADIANCE_PREFETCH_BESIDE=0` in both; Qwen beside an idle TranslateGemma 18.3 ms a step, against 19.8-20.5. Mesa then finds no compute ring of its own on those cards. + **Tooling** | | |