# Qwen3.8-27B on dual R9700: Direct-P2P and Phase 13 #27082
VectorAnvil
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Qwen3.8-27B on dual R9700: Direct-P2P and Phase 13 Q6_K MMQ explicit F32 conversion
Date: 2026-08-14
Summary
Two independently useful changes define the current Qwen3.8-27B Q6_K
optimization stack on Cornelius:
tensor-split token generation.
The Direct-P2P patch is not our implementation. It was authored by
JohnTDI-cpuand obtained fromhttps://github.com/JohnTDI-cpu/llama-hip-p2p-allreduce. Our work on thatpatch was integration, controlled isolation, current-upstream rebasing, and
validation on the dual-R9700 Qwen3.8 workload. Phase 13 has separate origin and
attribution, documented below.
On current llama.cpp build 10434, the complete stack measured:
1018.723 PP512 / 36.923 TG128
Against current upstream stock, this is:
The current canonical configuration is:
Qwen3.8-27B-Q6_K + two-GPU tensor split + HIP Direct-P2P + Phase 13 Q6_K F32 castHIP Direct-P2P
Problem
The older HIP tensor-split path used the generic meta-backend butterfly for
AllReduce. For small decode reductions, this host-staged route moved partials
across PCIe more than necessary and imposed a material communication cost.
The experimental HIP Direct-P2P path gives each of the two GPUs peer-visible
staging and performs the small reduction directly across the devices. It is
conservatively gated and falls back to the ordinary path when its requirements
are not met. Large prompt-processing reductions continue to use the fallback
path.
Isolated current-upstream result
Direct-P2P alone changed:
This isolates Direct-P2P as primarily a decode optimization for this workload.
It does not explain the large prompt-processing result previously associated
with the older research binary.
P2P provenance
JohnTDI-cpuhttps://github.com/JohnTDI-cpu/llama-hip-p2p-allreduce259f2e2a531af9ed3efa7f66adaa5eb5b53da95ff6f66106f2a960cec2da5a2f1a0f6d476989815f7e4c0a96880dae4fc4268ad441f8a6446bd5460aggml/src/ggml-cuda/allreduce.cuggml/src/ggml-cuda/allreduce.cuhDirect-P2P must be credited to
JohnTDI-cpu; it must not be described as anApex-authored patch. The Apex contribution reported here is its reproducible
evaluation, component isolation, and rebase alongside the independently
implemented Phase 13 change.
Phase 13 Q6_K MMQ F32 conversion
Finding
Phase 13 adds an explicit F32 conversion at the Q6_K MMA accumulation
operation. On the older llama.cpp source tree the operation was in
mmq.cuh.Current upstream moved it to
mmq-vec-dot.cuh; applying the same conversion atthe corresponding operation preserved and strengthened the prompt-processing
gain.
The current-upstream form changes the accumulation expression from the
implicit arithmetic form:
C.x[l] * sc[k01/4] * x_df[i*sram_stride] * dBto an explicit F32 conversion of the MMA result:
Incremental result
Adding Phase 13 to the otherwise identical P2P build changed:
This isolates Phase 13 as primarily a Q6_K prompt-processing/MMQ
optimization. The result surviving the upstream file and code reorganization
supports the conclusion that it is tied to Q6_K arithmetic and code generation,
not to the old filename or an accidental surrounding layout.
Origin and attribution
Phase 13 was independently implemented and experimentally validated during
the Apex llama.cpp/RDNA4 optimization campaign. Earlier phases studied
external RDNA4 and Q6_K implementations, including Zinc-informed ideas, as
architectural references. The retained Phase 13 records do not identify the
explicit llama.cpp F32-cast change as a copied patch, cherry-pick, or direct
port from another repository.
The supported attribution is therefore:
This does not claim invention of F32 conversion or accumulation as a general
concept. The specific finding is that this minimal change in llama.cpp's HIP
Q6_K MMQ path produces a large and reproducible PP512 improvement on the tested
gfx1201 workload.
Provenance correction
The historical build-9940 result of approximately
931 PP / 36.5 TGwasinitially labeled Direct-P2P. A later source audit showed that its dirty
research tree contained three relevant modifications:
allreduce.cu;allreduce.cuh;mmq.cuh.That binary was a cumulative Direct-P2P + Phase 13 build. It was not a
P2P-only build. The current-upstream three-lane isolation supersedes any
interpretation that attributes the historical PP gain to P2P alone.
Current validation
Environment
gfx12017e4c0a96880dae4fc4268ad441f8a6446bd5460a, build 10434Qwen3.8-27B-Q6_K.gguf562fbf760503008f118e5df38de5b3e97992d1f693f475815631198547486727Command
Three independent processes were executed per build. Each process aggregated
five internal samples. No samples were trimmed.
Complete results
Compared with the historical cumulative build-9940 result of
931.247 PP / 36.487 TG, the current canonical stack is:Claim boundary
The current evidence supports this narrow performance statement:
Do not generalize these results to other GPU architectures, CUDA, other ROCm
versions, quantization formats, model families, single-GPU operation, or
arbitrary prompt and batch sizes without independent validation.
Separate MTP track
MTP is not part of the canonical baseline. Embedded-MTP produced strong
throughput results on Qwen3.8, but deterministic output diverged from ordinary
decode and followed a different EOS path. Those results remain a separate
correctness investigation until exact-token parity passes.
Registered baseline
Register the following as the current Qwen3.8 Q6_K canonical stack:
llama.cpp build 10434 + HIP Direct-P2P + Phase 13 Q6_K MMQ explicit F32 conversionRetain current stock and current P2P-only as immutable comparison lanes. Label
the historical build-9940
931 PP / 36.5 TGbinary as a cumulative P2P plusPhase 13 research build.
All reactions