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

Research: ROCm/gfx1100: Qwen3.8-27B Q4_K_XL batch-1 tensor-split decode reaches only 1.31x one card, with per-card DRAM utilisation falling from 66% to 43%

Open LithiumDevourer opened this issue 2 months ago • 5 comments

Research Stage

  • [x] Background Research (Let's try to avoid reinventing the wheel)
  • [x] Hypothesis Formed (How do you think this will work and it's effect?)
  • [ ] Strategy / Implementation Forming
  • [x] Analysis of results
  • [ ] Debrief / Documentation (So people in the future can learn from us)

Previous existing literature and research

Two RX 7900 XTX splitting a Qwen3.8-27B with tensor parallelism deliver 1.31x what one card does at batch 1, or 1.32x measured against the slower of the two cards. That number alone looks unremarkable. What makes it worth reporting is that the single card is itself only at 66% of its DRAM peak, so the second card is not being measured against a saturated baseline. Both are true at once: the solo card cannot saturate its own memory, and the pair does worse per card than that card does alone. The motivation is resolving the severe scaling drop-off: adding a second GPU delivers only a 31% throughput increase at batch 1 despite both cards running well below DRAM saturation.

Q4_K_XL (17.545 GB) streams once per token at batch 1. On two cards the pair moves 825.7 GB/s, which is 43.0% of their combined 1920 GB/s, leaving 57.0% of aggregate DRAM bandwidth idle. I am separating that into two factors, both ratios of measured quantities:

gap what it is factor
A, solo inefficiency card 0 reaches 632.5 of 960 GB/s (65.9% UMC), card 1 623.5 1.518x
B, tensor-split penalty per-card UMC falls from 65.9% to 43.0% from splitting alone 1.532x
combined 2.326x

If each card ran at the per-card efficiency the single card already demonstrates, aggregate would be 1265.0 GB/s, which is 72.1 t/s against the 47.06 t/s measured, so closing gap B alone is worth about +53%. A further ceiling of 109.4 t/s assumes 100% UMC on both cards. Both figures are projections from measured bandwidths; nothing has run two cards at solo per-card efficiency.

The 43.0% is not a structural cap, but what moves it is worth being precise about. Across the two models measured for this issue, the split removes a near-constant fraction: the 27B at Q4_K_XL keeps 65.3% of its solo per-card bandwidth and the 7B at Q8_0 keeps 63.9% of its own. What differs between configurations is the baseline the split starts from, 632.5 GB/s against 776.4 GB/s per card alone, which is why the split figure ranges from 43.0% to 54.8% without the penalty itself changing. The penalty multiplies whatever the batch-1 kernel achieves alone.

Batch-1 single-stream is the serving case for one user at a time, which is what llama-server actually spends its time doing on this hardware class.

State of the art

AMD has named the single-card half of this problem and solved it on a different architecture. ROCm blog, 2026-06-29, "Accelerating LLM Inference on AMD GPUs with Low-Latency GEMMs": small-M decodeGEMM causes "under-occupancy, poor wave utilization". Their fix is LDS-Pipelined Split-K, an inter-CTA split-K with intra-CTA K-slice and a multi-stage LDS ring, shipped as an AITER/FlyDSL kernel family. It reports 1.64x average latency improvement across 32 decode shapes, 1.79x average at M<=8 with a best of 2.37x, and 1.49x across 48 further BF16 shapes. The hardware is MI355X / gfx950 only, and the technique is single-GPU: it raises what one card achieves on its own, which is gap A in the table above rather than the split penalty itself. Whether raising the solo rate also narrows gap B depends on what gap B turns out to be, which this issue does not settle. AMD is prioritising small-M decode on CDNA, not RDNA3.

An independent gfx1100 engine reports the same regime from a different direction. hipEngine's docs/ROOFLINE.md: ">~128 VGPR or <4 waves/SIMD starves the memory controller; effective BW falls to 30-40%". That matches the 43.0% measured here. They also attribute roughly 17-50% of the token budget to about 1600 dispatches per token at 1-3 us each, and note that GEMV is only around 34% of their decode time.

The same batch-1 problem is being attacked on NVIDIA with megakernels. HazyResearch/Megakernels ("Look Ma, No Bubbles!", CUDA, H100/B200) report that vLLM/SGLang reach only about 50% of H100 bandwidth at batch 1. MPK/Mirage Persistent Kernel (arXiv 2512.22219, OSDI '26) is also CUDA only. I could not find a megakernel project with any AMD/RDNA3 support.

Relevant llama.cpp history:

  • #19478 raised MMVQ nwarps to 8 on RDNA3/RDNA4 specifically to improve bs=1 decode bandwidth
  • #20831 adds dynamic nwarps clamping for narrow matrices (open, assigned @IMbackK). I tested it here and it was null.
  • #21344 tuned MMQ tiles and warp counts to curb VGPR pressure, +73% pp128 on gfx1151, closed unmerged
  • #20934 is the active ROCm vs Vulkan RDNA3 thread, including the wave64 explanation

So no AMD low-latency GEMM work targets RDNA3, and no RDNA3 VGPR or occupancy work has landed.

Hypothesis

Splitting a batch-1 GEMV across two cards halves the output rows per launch. The working hypothesis is that halving output rows drops waves per SIMD below the occupancy threshold required to hide DRAM latency. Each GPU stays issued about 99% of the time while delivering only 43.0% of its DRAM bandwidth, which is latency-bound behaviour rather than bandwidth-bound. What the latency is spent on is not settled: a per-launch parallelism deficit and a per-layer cross-GPU cost both survive the measurements so far, though the layer-split rows count against the second, and the Ruled out and Not yet tested lists below say why.

The mechanism has to account for all of the following:

  • per-card UMC falls from 65.9% to 43.0% as a result of splitting, and returns to 65-66% when either card runs alone
  • both cards stay at about 99% GFX_ACTIVITY, so this is not serialisation
  • UMC_ACTIVITY is 42%, so DRAM is not saturated; the limit is requests in flight, not capacity
  • efficiency rises with batch size: prefill scales 1.44x, decode only 1.31x
  • hipEngine, writing their own gfx1100 engine, attribute the identical 30-40% effective-bandwidth regime to occupancy, in the quote above
  • #20831 did not help, which is consistent rather than surprising: it targets 512-2048 column matrices, and a dense 27B stays several thousand wide even after halving

Testable prediction and the -ub sweep

If the mechanism is per-launch parallelism, then giving each launch more independent work should help. -ub is the micro-batch size for prompt processing, so a -ub sweep is the cheapest way to add per-launch work:

-ub pp2048 1 card pp2048 2 cards ratio tg512 1 card tg512 2 cards ratio
512 ~1070 (±112) 1569.15 ± 2.25 1.466 36.04 46.28 1.284
1024 1074.37 ± 0.45 1630.91 ± 4.64 1.518 36.03 46.90 1.302
2048 1071.89 ± 30.40 1692.40 ± 5.91 1.579 35.81 46.48 1.298
4096 1066.34 ± 30.10 1686.89 ± 4.78 1.582 35.77 46.99 1.314

The prediction of a rise toward 2.0 is not supported. Over an 8x increase in ubatch the prefill ratio moves from about 1.47 to about 1.58 and plateaus, with no trend toward 2.0. Single-card prefill is flat within 0.8% across the whole sweep. Decode is batch-1 regardless of -ub, so the four decode rows are the same configuration re-measured and their spread reflects run-to-run noise, not an effect.

I want to be precise about what this does and does not show. -ub does not change batch-1 decode launch geometry: a batch-1 GEMV is the same kernel with the same rows per card per launch at -ub 512 and at -ub 4096. So this sweep cannot discriminate the hypothesis for decode, and the flat decode ratio is not evidence against it. What the sweep does establish is that per-launch work is not the lever on the prefill path, where -ub genuinely acts: at -ub 4096 the pair has eight times the per-launch work it had at 512 and the ratio is essentially unchanged (1.466 to 1.582).

The pair gains 1692.40/1569.15 = 7.9% prefill from -ub 512 to 2048, while the single card gains 0.2% and is flat. The pair has parallelism headroom that the solo card does not, which is the shape the hypothesis predicts, appearing where -ub can actually create per-launch work.

To discriminate the mechanism properly, per-card work has to change while batch size is held fixed. Unbalancing the split with -ts would do that, but it moves rows from one card to the other rather than adding any, and every number in this issue was taken at the default split. The alternative is a smaller model that fits on one card: a dense 7B at Q8_0 was run for that reason, and it reproduced the penalty at a similar fraction (see the analysis and measurements below), which confirms the effect is not specific to this model without yet settling what causes it.

Expected effect if the mechanism is correct

Closing gap B, making two cards as efficient per card as one card already is, would raise aggregate from the measured 825.7 GB/s to 1265.0 GB/s. At 17.545 GB per token that is 72.1 t/s against the measured 47.06 t/s. Closing gap A as well reaches the hardware ceiling of about 109.4 t/s.

Both are projections from measured per-card bandwidths assuming per-card efficiency reaches the solo rate and 100% UMC respectively. Neither has been demonstrated on this hardware.

Implementation

There is no implementation yet, and I am not proposing a PR. I am reporting a measured gap. I can test patches; I cannot author kernel work.

Where a fix most plausibly lives, given the evidence above:

  1. The batch-1 MVQ kernel's own efficiency, which the split then multiplies down. Two models and two quants agree that splitting costs about 35% of whatever the kernel achieves alone (65.3% of solo for the 27B at Q4_K_XL, 63.9% for the 7B at Q8_0), while the kernel's solo rate differs by configuration: 65.9% for the 27B at Q4_K_XL against 80.9% for the 7B at Q8_0, in the same tensor-split geometry and the same session as the pair measurements. Anything that raises the rate at which the kernel issues memory requests should raise both the solo and the split figure, and recover part of gap B.
  2. Split-K parallelism for the batch-1 MVQ path, the technique AMD demonstrated at 1.64-1.79x for M<=8 on gfx950. Applying K-dimension splitting to mul_mat_vec_q would raise the number of concurrent blocks per launch. Not done for RDNA3 anywhere I can find.
  3. VGPR pressure and tile sizing, the lever #21344 attacked with +73% pp128 on gfx1151 before being closed unmerged. That presumably needs rework rather than revival, but it targets the same mechanism. hipEngine attribute the identical 30-40% effective-bandwidth regime to VGPR pressure and waves per SIMD, which is consistent with the Q4_K versus Q8_0 difference here.

I have this configuration and am willing to run patches, benchmarks or instrumented traces:

  • 2x RX 7900 XTX (gfx1100), PCIe 4.0 x8/x8 as configured in BIOS (LACT and GPU-Z agree; lspci misreports x16 on this system), ROCm 10.0, Ubuntu 26.04
  • RCCL working, used for the tensor split, with verified direct P2P (isAllDirectP2p 1, via P2P/direct pointer)
  • a working measurement harness: llama-bench at -r 5, with printed spreads of 0.04-0.24 t/s on the decode rows and two independent sessions agreeing within 0.2% on decode and 0.4% overall, plus amd-smi metric --usage UMC sampling, and the single-card controls on each of the two cards that make the comparison meaningful.

I am happy to be a test platform for occupancy, split-K, dequant or nwarps work on gfx11.

Analysis

No implementation is proposed yet, so this is an analysis of stock behavior.

Configuration

Stock f9f09f02c (10794), no third-party patches, GGML_HIP_RCCL=ON, built with GCC 15.2.0 in a worktree checked out at that commit. The single-card controls and the two-card results come from the same build tree, so there is no cross-build confound. The layer-split runs are a later session than the rest, on the same build and the same flags.

Qwen3.8-27B-UD-Q4_K_XL (16.34 GiB = 17.545 GB) fits on one card, which is what makes a single-GPU control possible. Flags: -p 2048 -n 512 -d 0 -b 4096 -ub 512 -fa 1 --load-mode none -r 5. No -ts was passed in any run, so the split has been at its default throughout. Both cards hold the same 24560 MiB and the model sits evenly across them (8.951 / 9.041 GiB below), so the default split is an even one.

item value
GPU 2x RX 7900 XTX, gfx1100, not the same board: card 0 is a Sapphire Nitro+ Vapor-X (IFWI EXT-90684, 2024/01/16, part 113-4E4710U-T52), card 1 a PowerColor Red Devil (IFWI EXT-89698, 2023/07/19, part 113-EXT89698-100)
VRAM 24560 MiB each
Theoretical DRAM bandwidth 960 GB/s per card
PCIe gen 4 x8/x8, both slots pinned to gen 4 statically in BIOS rather than auto, so no dynamic generation or width negotiation. Reported by LACT and GPU-Z. Not a limiting factor; see the traffic accounting below. lspci misreports x16 here and is not used.
ROCm 10.0.0 (/opt/rocm/core-10.0)
amdsmi 27.0.0
OS / kernel Ubuntu 26.04 LTS, kernel 7.0.0-31-generic
Clocks observed MCLK 1249 MHz active (MAX_CLK 1250 MHz), SCLK 2886/2993 against a 3000 MHz ceiling
IOMMU AMD-Vi enabled (Using global IVHD EFR:0x246577efa2254afa) but booted with iommu=pt: iommu: Default domain type: Passthrough (set via kernel command line), so devices sit outside DMA translation. The command line also carries pcie_aspm=off amdgpu.aspm=0

RCCL P2P is real peer access and not a shared-memory fallback: Check P2P Type isAllDirectP2p 1 directMode 1, transport via P2P/direct pointer.

What the single-card control does and does not establish. It rules out the model, the quant, the build and the software stack as explanations for the two-card shortfall, because both configurations run the same binary. It does not rule out a card running below spec, and the two cards are different boards (see the GPU row), which is why the control was run on each card separately: 632.5 against 623.5 GB/s, a 1.4% spread at decode.

PCIe is not a candidate, and does not need to be measured to exclude it. At batch 1 the traffic is one tensor-parallel reduction per layer per token: 64 layers x 5120 x 4 bytes = 1.25 MiB per token, which at 47.06 t/s is about 62 MB/s. Against the configured gen 4 x8 signalling rate of 15.75 GB/s that is 0.39%, so no link width available on this hardware can account for a 23-point per-card UMC shortfall at decode. The link would have to degrade to gen 4 x1 before decode traffic even reached 3% of it. Counting the attention and FFN reductions separately doubles every figure in this paragraph and changes none of the conclusions. Prefill is heavier, about 2560 MiB per forward pass sustained at about 2.0 GB/s, which is 13% of the configured link and still well within it. This is also why the tensor-split penalty being similar at prefill (1.44x) and decode (1.31x) argues against a link limit: the two regimes differ by 33x in PCIe traffic and only slightly in penalty.

On the platform configuration: the link is x8/x8 and both slots are pinned to PCIe 4.0 statically in BIOS rather than left on auto, so there is no dynamic generation or width negotiation to explain run-to-run variation. Reported by LACT and GPU-Z; lspci reports x16 for both cards on this system, which I believe is a reporting artefact rather than the trained width, and I am not using it as evidence in either direction. Since no link width available on this hardware changes the conclusion, I am not pursuing it further.

Measurements

config pp2048 tg512 ms/tok eff. GB/s UMC (instantaneous) UMC from GB/s
1 card, -sm none, card 0 (Q4_K_XL) 1074.51 ± 1.00 36.05 ± 0.04 27.74 632.5 65% 65.9%
1 card, -sm none, card 1 (Q4_K_XL) 1008.57 ± 1.85 35.54 ± 0.04 28.14 623.5 63% 65.0%
2 cards, -sm tensor (Q4_K_XL) 1547.96 ± 5.25 47.06 ± 0.24 21.25 825.7 agg / 412.8 per card 42% 43.0%
2 cards, -sm tensor (Q8_0) not reported, see below 36.26 ± 0.09 27.58 1052.8 agg / 526.4 per card 53% 54.8%
1 card, -sm none, card 0 (7B Q8_0) 4534.64 ± 5.66 95.90 ± 0.09 10.43 776.4 76% 80.9%
1 card, -sm none, card 1 (7B Q8_0) 4308.07 ± 3.54 95.20 ± 0.06 10.50 770.7 — 80.3%
2 cards, -sm tensor (7B Q8_0) not reported, unstable 122.63 ± 5.09 8.15 992.8 agg / 496.4 per card 49% 51.7%
2 cards, -sm layer (Q4_K_XL) not reported, unstable 34.03 ± 0.09 29.38 597.1 — 62.2%
2 cards, -sm layer (Q8_0) 1719.88 ± 1.50 24.68 ± 0.02 40.52 716.6 — 74.6%

All rows: -r 5, -p 2048 -n 512 -d 0 -b 4096 -ub 512 -fa 1 --load-mode none; the ± is llama-bench's spread across the five repetitions. The layer-split rows are from a later session, logged below, and the Q4_K_XL prefill spread there is too wide to use. The -ub sweep decode columns are single runs. The 7B rows are a separate session on a different model; that model is 7.54 GiB = 8.096 GB, which is the figure the bandwidth column uses for them.

Scaling for Q4_K_XL: decode 47.06 / 36.05 = 1.305x against card 0 and 47.06 / 35.54 = 1.324x against card 1, prefill 1547.96 / 1074.51 = 1.441x, against a memory-bound ideal of about 2x. The two cards are different boards, which is why both controls are reported; neither card alone is more than 1.4% faster at decode, so the shortfall is not asymmetry between them.

UMC_ACTIVITY agrees with the bandwidth arithmetic: 42% observed against 43.0% derived for Q4_K_XL, 53% observed against 54.8% derived for Q8_0, and 65% and 63% observed on the two cards running alone against 65.9% and 65.0% derived. These are instantaneous readings with a resolution of about ±2 points (see the note on sampling at the end), so they are a coarse corroboration of the bandwidth numbers and not a measurement of them. The -ub sweep UMC values are the same kind of instantaneous reading.

Run-to-run variation. Two independent sessions on this build agree closely on the Q4_K_XL rows: decode 36.00 against 36.05 t/s for card 0, 35.49 against 35.54 for card 1, and 47.00 against 47.06 for the pair; prefill 1547.71 against 1547.96; Q8_0 decode 36.20 against 36.26. Nothing in the table moves by more than 0.4% between sessions, which is why the ratios are quoted to three digits.

Three prefill cells are not usable, and the table marks them. Q8_0 two-card prefill measured 1302.75 ± 212.90 and then 1528.66 ± 210.76 on the 27B in two runs on an otherwise idle machine, against 1626.64 ± 4.14 in an earlier session, and 5513.20 ± 1707.63 on the 7B; the layer-split Q4_K_XL run adds a third at 1550.18 ± 235.38. Spreads near 15% or worse are larger than any effect discussed here, so I am not reporting values for them. Decode in those same runs is tight, and the same models are tight when run on one card (±0.09 and ±0.06 t/s for the 7B, ±0.04 for the 27B at Q4_K_XL), so the instability is a two-card prefill problem rather than one of quant, model or split mode. I have not isolated it, and I am reporting it rather than averaging it into a mean I cannot reproduce.

Two notes on the layer-split rows. Layer split is included because it is the obvious question: on Q4_K_XL it is worse than tensor split, 34.03 against 47.06, so tensor split is the best option available rather than the cause of the gap. But layer-split UMC is not comparable to tensor-split UMC: only one card is active per layer, so the two layer-split rows are the active card's utilisation, not the pair's. Read per active card, layer split is the more efficient mode (62.2% on Q4_K_XL and 74.6% on Q8_0) while delivering less total throughput because the second card contributes nothing for most of the run. That is a different quantity from the 43.0% and 54.8% in the tensor rows and should not be compared against them.

The split costs a constant fraction, and bandwidth accounts for it

Same model, same flags, same binary, same tensor-split geometry, same run. The quant is the only variable, which holds the output width and the split fixed while the kernel changes:

quant per-card delivered per-card UMC (instantaneous) derived from bandwidth
Q4_K_XL 412.8 GB/s 42% 43.0%
Q8_0 526.4 GB/s 53% 54.8%

So the 43.0% is not a fixed structural ceiling. It moves with the quant, and it moves in the direction of per-byte kernel work: Q8_0's dequantisation is lighter than Q4_K's, and Q8_0 delivers 27% more bytes per card in the same geometry. What the second model below shows is that this movement is in the level the split starts from, not in the fraction the split takes. Relative to the 65.9% the Q4_K solo control achieves, Q4_K runs at 65% of its single-card efficiency. The equivalent figure for Q8_0 would be 83% only if a Q8_0 27B also sat at 65.9% per card alone, and the 7B control below makes that assumption unlikely.

The difference between the quants is accounted for by bandwidth. Q8_0's 29.034 GB stream against Q4_K_XL's 17.545 GB gives a size ratio of 17.545 / 29.034 = 0.6043, and the observed per-card delivered bandwidth ratio is 526.4 / 412.8 = 1.2749. Their product is 0.7704 against a measured throughput ratio of 36.26 / 47.06 = 0.7705. That product is an identity rather than a test, because per-card delivered bandwidth is itself computed from model size and throughput, so I am not presenting it as evidence; it is written out only to make explicit that no third quantity is being invoked. What does carry information is that the two quants' per-card delivered bandwidths differ by 27% in identical geometry while the throughput ratio is fully explained by size, which leaves no residual for split overhead to occupy. Every input comes from llama-bench output, which repeats to about 0.4% within a run.

The same calculation performed from UMC_ACTIVITY is consistent in direction but cannot carry the same weight, because of the counter's resolution. As described below, the counter moves by up to about two percentage points while a single benchmark runs. A two-point change in one quant's reading moves the predicted ratio by roughly 10%, which is wider than the effect being compared. The predicted and measured ratios overlap inside that band, so the counter confirms the direction of the effect and nothing finer. I am not using it as an independent measurement of the model; a 10% resolution is not a test of a 27% effect.

The practical consequence is that no explanation beyond memory bandwidth is needed for the difference between the two quants, and the residual is too small to suggest the split inserts overhead of its own.

One limitation worth stating. The UMC_ACTIVITY reading is a utilisation ratio reported by the SMU, and I do not assume it is linearly proportional to bytes delivered across quantisation formats. The Q4_K and Q8_0 readings here come from the same run and the same sampling method, and the delivered bandwidth they accompany differs by 27%, so the two are consistent with each other in direction; I cannot establish the counter's semantics more precisely than that from here. This does not affect the gap arithmetic above, which uses delivered bytes.

Q8_0 at this size cannot run on one card: 29.034 GB against 24560 MiB, so the 27B's own Q8_0 solo figure is unknown. The 83% above assumes it would match the 65.9% Q4_K control; the 7B measurement below suggests that is pessimistic, and I am no longer leaning on it.

A second model, and what the split actually costs

A dense Qwen2.5-7B at Q8_0 fits on one card, which supplies both a solo control and a different geometry: 28 layers against 64, hidden 3584 against 5120, and no hybrid attention.

config per card alone per card split split as a fraction of solo
27B Q4_K_XL 632.5 GB/s 412.8 GB/s 65.3%
7B Q8_0 776.4 GB/s 496.4 GB/s 63.9%
27B Q8_0 does not fit 526.4 GB/s —

Two models three and a half times apart in size, with different layer counts, different hidden widths, and one of them using hybrid attention, lose the same fraction to the split: about 35% of per-card bandwidth. That is a tighter statement than the absolute percentages, and it is what any mechanism has to reproduce.

It also narrows where the loss can live. The 7B has none of the 27B's Gated Delta Net or Lightning Indexer machinery, so the cause is in the part the two models share, the batch-1 weight-streaming path, rather than in the 27B's hybrid attention.

It also relocates the Q4_K_XL versus Q8_0 difference. The 43.0% is not the split treating Q4_K worse than Q8_0; it is a lower starting point. The 27B at Q4_K_XL begins at 65.9% per card alone and the 7B Q8_0 at 80.9%, and the split takes the same fraction from each. Multiplying the 27B Q8_0's measured 54.8% by that same 1.55 implies a solo rate near 85%, which I have not measured. The alternative reading, that the 27B Q8_0 would also sit at 65.9% alone, would make its penalty much milder than the other two, and nothing in the data supports it.

At the same quant, model size barely matters: 496.4 GB/s per card for the 7B against 526.4 for the 27B, within 6%, while changing the quant on one model moves it by 27%, 412.8 against 526.4. The split behaves like a fixed multiplier on whatever the batch-1 kernel achieves by itself, and the kernel sets the level.

The two gaps

Q4_K_XL streams 17.545 GB of weights per token at batch 1. Reference points for two cards:

reference aggregate t/s achieved
current, 2 cards tensor split 825.7 GB/s 47.06 43.0%
2 cards each at the solo efficiency (65.9% UMC) 1265.0 GB/s 72.1 65.9%
2 cards each at 100% UMC 1920 GB/s 109.4 100%

Gap A (solo): 960 / 632.5 = 1.518x, so 34.1 percentage points idle per card. Gap B (split): 72.1 / 47.06 = 1.532x, a further 22.9 points. Combined: 1.518 x 1.532 = 2.326x, so 57.0 percentage points idle in total.

Ruled out

  • Communication, as bandwidth. Excluded: a collective here moves about 1.25 MiB per token, under 0.4% of a gen 4 x8 link. The penalty also does not scale with reduction traffic, since prefill carries roughly 33x decode's reductions and pays 1.44x against decode's 1.31x, and the 7B is a second case in the same direction: it moves 49 MB/s of reductions per token against the 27B's 62 MB/s and pays a larger penalty, 1.57x against 1.53x. The -ub sweep excludes a fixed per-launch serial cost on the prefill path for the same reason, since an 8x increase in per-launch work moves the two-card ratio only from 1.466 to 1.582.
  • A GGML_AR_NOOP=1 bypass I ran is not reported: I could not confirm it ever applied, so its numbers are withdrawn and no conclusion rests on them.
  • Placement. Model evenly resident: 8.951 / 9.041 GiB.
  • Card asymmetry. The two cards are different boards, a Sapphire Nitro+ Vapor-X and a PowerColor Red Devil, so both were measured alone. Card 0 delivers 632.5 GB/s and card 1 623.5 GB/s, a 1.4% difference at decode and 6.5% at prefill. In the split run each card delivers 412.8 GB/s, on both. The shortfall is therefore a property of the split, not of either card.
  • Serialisation and idle cards. Both GPUs report 99% GFX_ACTIVITY during the run. Neither idles.
  • Clocks. MCLK pinned at its top DPM state, 1249 MHz active against MAX_CLK 1250 MHz; SCLK 2886/2993 against a 3000 MHz ceiling. 1249 MHz is the maximum and not a throttled state. The commonly quoted "2500 MHz stock" is the same state in a different reporting convention, 1250 x 16 = 20 Gbps effective.
  • Thermals. Memory junction and hotspot both below 75 C.
  • DRAM saturation. UMC is 42%, so memory is not saturated. Latency-limited, not bandwidth-limited.
  • Backend choice. Vulkan is not the answer. On the same model and build, Vulkan single-card is +8.5% over ROCm (39.07 against 36.02 at tg128), but Vulkan's two-card tensor path is worse than its own single-card result (23.36 against 39.07) and appears to serialise (pp512 at 0.55x of single-card).
  • -ub. On the prefill path the pair gains 7.9% from -ub 512 to 2048 while the single card is flat, and the two-card to one-card ratio stays at 1.47-1.58 across an 8x ubatch range. More per-launch work moves prefill but does not close the gap there, and -ub does not touch batch-1 decode geometry at all.
  • MMVQ nwarps selection. #20831 cherry-picked and tested: Q4 46.76 against 46.84 (-0.17%, null), Q8_0 36.37 against 35.98 (+1.08%, about 1.2 sigma, not credible), prefill slightly down in both. Null, and expected to be: the patch targets 512-2048 column matrices (MoE expert FFN), and a dense 27B's projections stay several thousand wide even after halving.

Not yet tested

  • VGPR pressure and waves per SIMD. hipEngine's ROOFLINE.md reports that below about 4 waves/SIMD the memory controller starves and effective bandwidth falls to 30-40%, matching the 43.0% measured here. #21344 attacked exactly this (+73% pp128 on gfx1151) and was closed unmerged. This is a candidate for gap A, the solo inefficiency, and has not been tested on this hardware.
  • -ts sweep. Not pursued: the default split here is already even (equal VRAM, and the model lands 8.951 / 9.041 GiB across the pair), and unbalancing it only moves rows between the cards rather than adding any, which tests a different question.
  • Rows per launch at fixed batch size. Not varied in isolation. The 7B run above changes model size, layer count and hidden width together, so it confirms that the penalty survives a change of model without pinning down which of those three the penalty is a function of.
  • Hardware perf counters. UMC_ACTIVITY is the only hardware metric used; no GRBM or PMC data.
  • An MoE model. The 7B above gives a second family and a second quant, but it is still dense. MoE architectures alter the bytes streamed per token versus dense models, so evaluating whether sparse routing exhibits the same split penalty requires an isolated control run on that architecture.
  • Communication, as exposed latency. Not excluded, and the layer-split rows now argue against it. A fixed per-layer cross-GPU rendezvous would be invisible to every measurement above, because none of them varies per-launch work at batch 1, and the two models are too close in per-layer decode time (0.37 ms against 0.43 ms) for the constant-fraction result to separate it: the ~110 us per layer that falls out of both is an artifact of that fraction, not evidence of a fixed cost. Layer split is the closest thing to a direct measure of one, and it does not support it: it serialises the two cards and hands off once per layer, and its excess over a single card is 1.64 ms per token, 26 us per layer. Two of those per layer would account for under half of tensor split's 115 us per layer, leaving the rest to be explained by something the split does to the launch geometry rather than to the exchange. The measurement is not clean, because layer split's deficit is equally readable as the active card streaming at 62.2% rather than 65.9%, but it points the same way as the occupancy reading rather than against it. A third model with a very different layer count at the same quant is what would separate them.

On the UMC_ACTIVITY figures

Every UMC figure in this issue is an instantaneous reading, not an average. Each one is a single frame captured from amd-smi metric --usage run under watch in a second shell alongside a running benchmark, and where two values are shown for two cards they are the two lines of that one frame. A single pasted sample therefore shows only the split second it was taken, which is why the same configuration can show 42% in one frame and 43% in the next.

Watched continuously across a run, both GFX_ACTIVITY and UMC_ACTIVITY move, but stay within roughly two percentage points of their typical value. That movement is what I am treating as the counter's observational resolution here, about ±2 points, and it is the error I would assign to any single figure quoted above. It is not a statistical error bar; there is no sample of frames behind it.

This matters for interpretation. UMC_ACTIVITY is used in this issue as a coarse check that the measured bandwidths correspond to real memory-controller activity, and as the reason I can say DRAM is not saturated at 42-43%. It is not precise enough to carry any of the arithmetic, and the 2-point resolution propagates to roughly 10% when two readings are divided. All gap and scaling figures here come from llama-bench throughput and model size instead.

I am reporting it this way rather than as a range or a mean because I did not record a continuous series. If a reviewer wants tighter UMC figures, the fix is to log the counter across a full run and report the distribution, which I have not done.

Relevant log output

All runs below are `-p 2048 -n 512 -d 0 -b 4096 -ub 512 -fa 1 --load-mode none -r 5`. The 27B tensor rows are one session, the 7B rows a second and the two layer-split rows a third, all on the same build.

--- llama-bench, Q4_K_XL, card 0 alone, -sm none (build f9f09f02c, stock, RCCL ON) ---
ggml_cuda_init: found 2 ROCm devices (Total VRAM: 49120 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
  Device 1: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   none |   1 |       none |          pp2048 |       1074.51 ± 1.00 |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   none |   1 |       none |           tg512 |         36.05 ± 0.04 |

build: f9f09f02c (10794)

--- llama-bench, Q4_K_XL, card 1 alone, -sm none (HIP_VISIBLE_DEVICES=1, same build) ---
ggml_cuda_init: found 1 ROCm devices (Total VRAM: 24560 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   none |   1 |       none |          pp2048 |       1008.57 ± 1.85 |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   none |   1 |       none |           tg512 |         35.54 ± 0.04 |

build: f9f09f02c (10794)

--- llama-bench, Q4_K_XL, two cards, -sm tensor (same build, same flags) ---
ggml_cuda_init: found 2 ROCm devices (Total VRAM: 49120 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
  Device 1: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 | tensor |   1 |       none |          pp2048 |       1547.96 ± 5.25 |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 | tensor |   1 |       none |           tg512 |         47.06 ± 0.24 |

build: f9f09f02c (10794)

--- llama-bench, Q8_0, two cards, -sm tensor (same build, same flags) ---
ggml_cuda_init: found 2 ROCm devices (Total VRAM: 49120 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
  Device 1: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen35 27B Q8_0                |  27.04 GiB |    27.32 B | ROCm       |  -1 |    4096 | tensor |   1 |       none |          pp2048 |     1528.66 ± 210.76 |
| qwen35 27B Q8_0                |  27.04 GiB |    27.32 B | ROCm       |  -1 |    4096 | tensor |   1 |       none |           tg512 |         36.26 ± 0.09 |

build: f9f09f02c (10794)

--- llama-bench, Q4_K_XL, two cards, -sm layer (same build, later session) ---
ggml_cuda_init: found 2 ROCm devices (Total VRAM: 49120 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
  Device 1: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | --: | ---------: | --------------: | -------------------: |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   1 |       none |          pp2048 |     1550.18 ± 235.38 |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   1 |       none |           tg512 |         34.03 ± 0.09 |

build: f9f09f02c (10794)

--- llama-bench, Q8_0, two cards, -sm layer (same build, later session) ---
ggml_cuda_init: found 2 ROCm devices (Total VRAM: 49120 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
  Device 1: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | --: | ---------: | --------------: | -------------------: |
| qwen35 27B Q8_0                |  27.04 GiB |    27.32 B | ROCm       |  -1 |    4096 |   1 |       none |          pp2048 |       1719.88 ± 1.50 |
| qwen35 27B Q8_0                |  27.04 GiB |    27.32 B | ROCm       |  -1 |    4096 |   1 |       none |           tg512 |         24.68 ± 0.02 |

build: f9f09f02c (10794)

--- llama-bench, 7B Q8_0, card 0 alone, -sm none (same build, later session) ---
ggml_cuda_init: found 2 ROCm devices (Total VRAM: 49120 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
  Device 1: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen2 7B Q8_0                  |   7.54 GiB |     7.62 B | ROCm       |  -1 |    4096 |   none |   1 |       none |          pp2048 |       4534.64 ± 5.66 |
| qwen2 7B Q8_0                  |   7.54 GiB |     7.62 B | ROCm       |  -1 |    4096 |   none |   1 |       none |           tg512 |         95.90 ± 0.09 |

build: f9f09f02c (10794)

--- llama-bench, 7B Q8_0, card 1 alone, -sm none (HIP_VISIBLE_DEVICES=1, same session) ---
ggml_cuda_init: found 1 ROCm devices (Total VRAM: 24560 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen2 7B Q8_0                  |   7.54 GiB |     7.62 B | ROCm       |  -1 |    4096 |   none |   1 |       none |          pp2048 |       4308.07 ± 3.54 |
| qwen2 7B Q8_0                  |   7.54 GiB |     7.62 B | ROCm       |  -1 |    4096 |   none |   1 |       none |           tg512 |         95.20 ± 0.06 |

build: f9f09f02c (10794)

--- llama-bench, 7B Q8_0, two cards, -sm tensor (same session, same flags) ---
ggml_cuda_init: found 2 ROCm devices (Total VRAM: 49120 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
  Device 1: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen2 7B Q8_0                  |   7.54 GiB |     7.62 B | ROCm       |  -1 |    4096 | tensor |   1 |       none |          pp2048 |       5513.20 ± 1707.63 |
| qwen2 7B Q8_0                  |   7.54 GiB |     7.62 B | ROCm       |  -1 |    4096 | tensor |   1 |       none |           tg512 |        122.63 ± 5.09 |

build: f9f09f02c (10794)

--- amd-smi metric --usage, 7B Q8_0, card 0 alone, -sm none ---
GPU: 0
        GFX_ACTIVITY: 100 %
        UMC_ACTIVITY: 76 %
GPU: 1
        GFX_ACTIVITY: 0 %
        UMC_ACTIVITY: 0 %

--- amd-smi metric --usage, 7B Q8_0, two cards, -sm tensor ---
GPU: 0
        GFX_ACTIVITY: 98 %
        UMC_ACTIVITY: 49 %
GPU: 1
        GFX_ACTIVITY: 98 %
        UMC_ACTIVITY: 49 %

--- amd-smi metric --usage, card 0 alone, -sm none ---
GPU: 0
        GFX_ACTIVITY: 100 %
        UMC_ACTIVITY: 65 %
GPU: 1
        GFX_ACTIVITY: 1 %
        UMC_ACTIVITY: 0 %

--- amd-smi metric --usage, card 1 alone, -sm none (HIP_VISIBLE_DEVICES=1) ---
GPU: 0
        GFX_ACTIVITY: 0 %
        UMC_ACTIVITY: 0 %
GPU: 1
        GFX_ACTIVITY: 100 %
        UMC_ACTIVITY: 63 %

--- amd-smi metric --usage, two cards, -sm tensor (Q4_K_XL, sampled concurrently with the bench) ---
GPU: 0
        GFX_ACTIVITY: 99 %
        UMC_ACTIVITY: 42 %
GPU: 1
        GFX_ACTIVITY: 99 %
        UMC_ACTIVITY: 42 %

--- amd-smi metric --usage, two cards, -sm tensor (Q8_0, earlier session) ---
Every 1.0s: amd-smi metric --usage | grep -E "GPU:|GFX_ACTIVITY|UMC_ACTIVITY"
GPU: 0
        GFX_ACTIVITY: 98 %
        UMC_ACTIVITY: 53 %
GPU: 1
        GFX_ACTIVITY: 99 %
        UMC_ACTIVITY: 53 %

--- RCCL P2P verification (NCCL_DEBUG=INFO) ---
NCCL INFO Check P2P Type isAllDirectP2p 1 directMode 1 isAllCudaP2p 1
NCCL INFO Channel 00/0 : 0[3000] -> 1[7000] via P2P/direct pointer nRanks 02
NCCL INFO General, CONFIG_PCI_P2PDMA=y, DMA_BUF Support Enabled

--- environment ---
Ubuntu 26.04 LTS, kernel 7.0.0-31-generic, ROCm 10.0.0 (/opt/rocm/core-10.0)
amdsmi 27.0.0
2x RX 7900 XTX gfx1100, 24560 MiB each, 960 GB/s theoretical per card
  card 0: Sapphire Nitro+ Vapor-X (IFWI EXT-90684, 2024/01/16)
  card 1: PowerColor Red Devil (IFWI EXT-89698, 2023/07/19)
PCIe gen 4 x8/x8, both slots pinned to gen 4 statically in BIOS, not auto
  (LACT and GPU-Z agree. lspci misreports x16 on this system and is not used.)
built with GNU 15.2.0 for Linux x86_64 (llama-cli --version)
IOMMU: AMD-Vi enabled but booted with iommu=pt, default domain type Passthrough

LithiumDevourer avatar Sep 13 '26 18:09 LithiumDevourer

Closed as completed but with no note, so I do not know which reading to take. Is it that the measurements are accepted and there is nothing to schedule, or that you think the mechanism is wrong? If the second, which finding do you disagree with? Happy to re-run it on my hardware.

LithiumDevourer avatar Sep 14 '26 14:09 LithiumDevourer

Closed as completed but with no note, so I do not know which reading to take. Is it that the measurements are accepted and there is nothing to schedule, or that you think the mechanism is wrong? If the second, which finding do you disagree with? Happy to re-run it on my hardware.

I cannot see a clear / specific reason for closing.

I am interested in validating your measurements. If DRAM utilisation really is as low as 66%, I think this should be investigated. And the multi-GPU results are also interesting.

Here are some details of my set-up and my preliminary results.

I focused on this case,

All runs below are `-p 2048 -n 512 -d 0 -b 4096 -ub 512 -fa 1 --load-mode none -r 5`. The 27B tensor rows are one session, the 7B rows a second and the two layer-split rows a third, all on the same build.

--- llama-bench, Q4_K_XL, card 0 alone, -sm none (build f9f09f02c, stock, RCCL ON) ---
ggml_cuda_init: found 2 ROCm devices (Total VRAM: 49120 MiB):
  Device 0: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
  Device 1: AMD Radeon RX 7900 XTX, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 24560 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   none |   1 |       none |          pp2048 |       1074.51 ± 1.00 |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   none |   1 |       none |           tg512 |         36.05 ± 0.04 |

In my environment I have,

  • GPU: one visible Radeon Pro W7900 Dual Slot, gfx1100, 96 CUs, 46064 MiB VRAM, wave size 32, VMM unavailable.
  • Software: clean llama.cpp 5b335f413e4f73b0809c4fe39af894efbcc6a0d2 (build 11040); ROCm 7.12.0, HIP 7.3.53390; AMD clang 22 and GCC 11.4.
  • Build: Release, targeting gfx1100; FORCE_MMQ=OFF and FORCE_CUBLAS=OFF (automatic dispatch); HIP graphs ON, RCCL OFF.
  • GPU policy: AUTO, replacing the original profile_standard. Median core clocks were 2279 MHz prefill / 2253 MHz decode; memory 1124 MHz. Socket power limit remained 241 W; maximum observed hotspot was 87°C.
  • Workload: Qwen3.8-27B-UD-Q4_K_XL.gguf, reported as 16.34 GiB / 27.32B parameters; full GPU offload, split-none, flash attention enabled, batch 4096, microbatch 512, 16 CPU threads and five repetitions.

These commands reproduce my configuration:

cmake \
  -S /home/pmaybank/projects/scratch/llama-perf-2026-11-09/source-current \
  -B /home/pmaybank/projects/scratch/llama-perf-2026-11-09/build-c0 \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_C_COMPILER=/usr/bin/cc \
  -DCMAKE_CXX_COMPILER=/usr/bin/c++ \
  -DCMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++ \
  -DCMAKE_HIP_COMPILER_ROCM_ROOT=/opt/rocm \
  -DCMAKE_HIP_FLAGS=--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/11 \
  -DHIP_PLATFORM=amd \
  -DAMDGPU_TARGETS=gfx1100 \
  -DGGML_HIP=ON \
  -DGGML_CUDA_FORCE_MMQ=OFF \
  -DGGML_CUDA_FORCE_CUBLAS=OFF \
  -DGGML_CUDA_FA=ON \
  -DGGML_HIP_GRAPHS=ON \
  -DGGML_HIP_MMQ_MFMA=ON \
  -DGGML_HIP_NO_VMM=ON \
  -DGGML_HIP_RCCL=OFF \
  -DGGML_NATIVE=ON \
  -DGGML_OPENMP=ON \
  -DLLAMA_BUILD_MTMD=OFF \
  -DLLAMA_CURL=OFF \
  -DLLAMA_OPENSSL=ON

cmake --build \
  /home/pmaybank/projects/scratch/llama-perf-2026-11-09/build-c0 \
  --target llama-bench -j 12

and this is the command I used to generate my results.

sudo /opt/rocm/bin/amd-smi set --gpu 0000:46:00.0 --perf-level AUTO

CUDA_VISIBLE_DEVICES=1 \
/home/pmaybank/projects/scratch/llama-perf-2026-11-09/build-c0/bin/llama-bench \
  -m /mnt/nas_share/models/gguf/unsloth/Qwen3.8-27B-GGUF/Qwen3.8-27B-UD-Q4_K_XL.gguf \
  -p 2048 -n 512 -d 0 \
  -b 4096 -ub 512 \
  -ngl -1 -t 16 -sm none \
  -fa 1 --load-mode none \
  -r 5 --progress

This produced,

  Device 0: AMD Radeon Pro W7900 Dual Slot, gfx1100 (0x1100), VMM: no, Wave Size: 32, VRAM: 46064 MiB
| model                          |       size |     params | backend    | ngl | n_batch |     sm |  fa |         lm |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------: | -----: | --: | ---------: | --------------: | -------------------: |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   none |   1 |       none |          pp2048 |        588.39 ± 1.61 |
| qwen35 27B Q4_K - Medium       |  16.34 GiB |    27.32 B | ROCm       |  -1 |    4096 |   none |   1 |       none |           tg512 |         28.96 ± 0.06 |

build: 5b335f413 (11040)

Can you see any differences in my set-up that could account for the difference in t/s . It looks like I am around 20-25% short of your results on tg512 and 40-50% short of your results on pp2048 .

pmaybank avatar Nov 09 '26 14:11 pmaybank

@pmaybank

Relative to mine, I think you're numbers are mostly expected. The comparison makes more sense when you look at one 7900 XTX and one W7900. A W7900 Dual Slot is 864 GB/s against the XTX's 960, memory clock 1,124 against 1,249, a 241 W socket limit against 355 W, and 2,253/2,279 MHz core clocks against 2,886-2,993. Decode is bandwidth-bound, so the 0.90 bandwidth ratio would be 32.4 tok/s against the 36.05 reference, and you measure 28.96. That puts you at 80% of the XTX where bandwidth alone predicts 90%. Prefill follows compute: 2,279/2,940 = 0.77 predicts 833 tok/s against 1,074.5 and you measure 588, so 30% is left over.

My guess for the decode remainder is ECC. It doesn't exist on the 7900 XTX of course, so I wouldn't be able to test. Try disabling it and see if it makes a difference. Practically speaking though, I think ECC > couple more tok/s. The prefill remainder is the software stack: you are on ROCm 7.12.0 and build 11040 where that run was on 10.0 and 10794, and pp2048 is mostly rocBLAS and hipBLASLt GEMMs whose gfx1100 kernel selection changed between those trees. Check the power cap during a run as well, since 241 W on a 295 W board may be throttling the clocks you quoted. Could be the -ub too, so try adjusting it. I haven't used llama.cpp in a while, but looking back at my config I would run -ub 2048 since that's what ended up giving me the highest prefill numbers.

Stock llama.cpp is unfortunately quite slow for RDNA3, but there are forks with custom kernels that are much faster and much more interesting. Check out: https://github.com/SILVERTHRONE32/llama.cpp-rdna3-int4. On my 7900 XTX I went from 39.58 to 48.08 tok/s decode and from 1,051 to 2,453 pp512. That's roughly 85% of measured DRAM bandwidth compared to stock llama.cpp's ~63%. It keeps the 4-bit multiply in the integer domain instead of widening to 8 bits, with the Hadamard rotation and GPTQ done in the rotated basis so the accuracy cost stays small. I recommend reading their reddit post and the paper they have linked in there. Interesting stuff.

Personally I've been on Niko1221/Strata for a while now. I run Qwen3.8-Flash-Next on Strata at about double the speed that 27B runs on llama.cpp. There is also nicejunjie/Strata-rdna3 which I have been testing and it's gotten my prompt processing to reach over 5000tps over 64K tokens.

LithiumDevourer avatar Nov 13 '26 05:11 LithiumDevourer

@LithiumDevourer - thanks for replying to my comment. There are a few different things there I am interested in exploring, for example the Strata engine, and the algorithmic idea of sparse routing to get around constrained VRAM capacity.

At the same time, I would like to bring the discussion back to your original observations. And to determine whether there are incremental changes that could be made to llama.cpp which would increase the DRAM utilisation up from the 66% (single GPU) and 43% (multi GPU) that you measured.

Here are some notes that could form a basis for either re-opening this issue or creating two (narrower) issues.

@LithiumDevourer said,

the single card is itself only at 66% of its DRAM peak

The specific card where you ran your experiments has a theoretical DRAM peak of 960 GB/s.

Do you have any experiments that quantify achievable DRAM bandwidth?

In a synthetic benchmark that I ran on my own machine (not with the same specs) I observed 735 GB/s against a theoretical peak of 864 GB/s.

The specific workload that you analyzed is dominated by mul_mat_vec_q

I used a profiler to estimate,

percentage of total GPU kernel time spent in `mul_mat_vec_q`   =  87-88%
percentage of achievable DRAM bandwidth in `mul_mat_vec_q`     =  88-89%

Putting these results together I estimated that it may be possible to increase decode throughput by 10-12% by optimizing the mul_mat_vec_q kernel.

That is a lot lower than the 40-50% increase in decode throughput based on the assumption that it is possible to get close to the theoretical max DRAM bandwidth, and the 66% of theoretical that you observed.

Does the methodology make sense?

Would you be able to collect comparable measurements to test the 10-12% estimate?

If that estimate is validated, is that something we would want to target?

adding a second GPU delivers only a 31% throughput increase

I have not looked at this. It could be investigated independently of the single card results. Would it make sense to split into a separate issue?

Are there synthetic benchmarks where you see a 2x increase in FLOPs per second as a result of running on 2 GPUs instead of 1?

For tensor-split decode, reduction operations require communication between GPUs. I would expect this to lead to some loss of performance in scaling throughput. Is it possible to estimate the cost of this communication overhead?

It looks like a substantial amount of work was done to describe this issue. Let me know if I have missed any key points.

pmaybank avatar Nov 18 '26 16:11 pmaybank

@pmaybank On achievable bandwidth, here are a few numbers I measured on the 7900 XTX:

  • Plain read kernel (contiguous grid-stride, 2 GiB buffer, best of five): 885–920 GB/s across block counts, peaking at 920.5 GB/s (95.9 % of nominal).

  • Reshaped to the mul_mat_vec_q access pattern (one 5,440-byte Q8_0 row per block): 866–875 GB/s at 640–5,120 blocks, and 903–916 GB/s at 81,920 blocks. The access pattern itself only costs about 5 %, and the rest comes down to block count.

  • Real model lm_head GEMV (27B Q8_0): streams at 935 GB/s (97.4 % of nominal).

  • Per-layer GEMVs: these are the slow ones, hitting roughly 724 GB/s (75 %) compared to 866–875 GB/s for a synthetic kernel of the exact same shape. That gap comes from instruction issue (dequant and dp4a competing with loads for issue slots), not DRAM limits.

So for read-dominated work, achievable bandwidth is 920–935 GB/s, not ~85 % of nominal. If your synthetic benchmark was a copy or a read-plus-write kernel, 735 GB/s makes sense, but that's not the ceiling for a decode kernel. You need a read-only kernel for a proper baseline here.

Your methodology is right I think, but baseline can skew everything here. Using 875 GB/s as the shape-matched ceiling against the 724 GB/s measured puts the headroom inside mul_mat_vec_q closer to 17 % rather than 10–12 %. We actually have real-world proof of this: SILVERTHRONE32's RDNA3 fork keeps the 4-bit multiply in the integer domain instead of widening to 8 bits. Running the exact same 27B file on my card with just that change jumped decode from 39.58 to 48.08 tok/s, and pp512 from 1,051 to 2,453. So the real headroom is definitely larger than 10–12 %, even if it's well below the 40–50 % implied by theoretical peak.

As for the second GPU, the bottleneck isn't the math or the link speed. ggml's allreduce is compiled out on HIP (#if !defined(GGML_USE_HIP) in ggml/src/ggml-cuda/allreduce.cu), forcing every layer boundary to fall back to two hipMemcpyPeerAsync calls, four event operations, and two single-node ADD graphs. Peer DMA itself works fine—it hits 14.15 GB/s, roughly 90 % of PCIe 4.0 x8 line rate. Replacing that fallback with a device-side allreduce inside the captured graph bumped tensor-split decode from 49.0 to 57.1 tok/s (compared to 37.7 solo, which is 1.52×), with all 128 barriers per token taking just 0.41 ms total (~3 µs each). Prefill scales 1.35–1.50× on the same box. Nothing hits 2× at batch 1, of course, but most of that missing 31 % was synchronization overhead, not bandwidth.

And yes, splitting this into two issues is right. The single-card kernel optimization and the multi-GPU scaling require completely different fixes, and the multi-GPU side already has a working solution.

LithiumDevourer avatar Nov 19 '26 00:11 LithiumDevourer