prefill: HIP build without MMQ also turns on the Q8_0, Q6_K and trellis fused kernels

In a build without llama.cpp's MMQ the CUDA list switches on STRATA_PF_FUSED_Q8D,
_Q8GU, _Q6K and _TQ by itself; the HIP list had only STRATA_PF_FUSED, _Q50 and _KQ,
so Q8_0, Q6_K and Gyro trellis layers fell to the FP16 path on gfx12 although the
kernels exist and were gated there. The four names are added to the HIP list.
Every reader of those four switches on HIP checks for gfx12 first, so gfx11
cards keep the rules they have.

The register notes of the four switches say they are on by default in a build
without MMQ (a value the user sets is kept). No new setting.

One layer on a Radeon AI PRO R9700, fused kernels against the MMQ path at 2,048 /
8,192 tokens: Q8_0 / Q8_0 4.2x / 3.1x, Q6_K + Q8_0 3.3x / 2.3x, IQ3_S with a Q8_0 down
3.7x / 2.6x, Gyro-S pair 3.3x / 1.5x, Gyro-M pair 3.3x / 1.5x. Not run on a full model.
This commit is contained in:
Niko1221 committed 2026-11-13 11:19:39 +01:00
1 parent f331970d91
commit f71bd03946
2 files changed
+8 -5

No files matched your search

+4 -4
View File
@@ -24755,7 +24755,7 @@
"last_date": "2026-11-11",
"status": "research",
"owner": "prefill",
"note": "[DRAFT] CUDA and HIP gfx12 (phase 4, opt-in, default off): a Q6_K gate/up with a Q8_0 down (UD-Q6_K_XL's 47 layers, UD-Q5_K_XL's one Q6_K layer) on the fused native kernels instead of MMQ, on any sm_80+ card and on gfx1200 / gfx1201.",
"note": "[DRAFT] CUDA and HIP gfx12 (phase 4, opt-in, default off): a Q6_K gate/up with a Q8_0 down (UD-Q6_K_XL's 47 layers, UD-Q5_K_XL's one Q6_K layer) on the fused native kernels instead of MMQ, on any sm_80+ card and on gfx1200 / gfx1201. In a build without llama.cpp's MMQ it is on by default on both (a value you set is kept).",
"retire_after": "",
"retired_in": ""
},
@@ -24795,7 +24795,7 @@
"last_date": "2026-11-11",
"status": "research",
"owner": "prefill",
"note": "[DRAFT] CUDA and HIP gfx12 (phase 4, opt-in, default off): a Q8_0 down behind an i-quant gate/up (the pinned UD-IQ4_XS's five Q8_0-down layers) on the fused native kernels instead of MMQ, on any sm_80+ card and on gfx1200 / gfx1201.",
"note": "[DRAFT] CUDA and HIP gfx12 (phase 4, opt-in, default off): a Q8_0 down behind an i-quant gate/up (the pinned UD-IQ4_XS's five Q8_0-down layers) on the fused native kernels instead of MMQ, on any sm_80+ card and on gfx1200 / gfx1201. In a build without llama.cpp's MMQ it is on by default on both (a value you set is kept).",
"retire_after": "",
"retired_in": ""
},
@@ -24835,7 +24835,7 @@
"last_date": "2026-11-11",
"status": "research",
"owner": "prefill",
"note": "[DRAFT] CUDA and HIP gfx12 (phase 4, opt-in, default off): a Q8_0 gate/up with a Q8_0 down (the Q8_0 set, UD-Q6_K_XL's one Q8_0 layer) on the fused native kernels instead of MMQ, on any sm_80+ card and on gfx1200 / gfx1201.",
"note": "[DRAFT] CUDA and HIP gfx12 (phase 4, opt-in, default off): a Q8_0 gate/up with a Q8_0 down (the Q8_0 set, UD-Q6_K_XL's one Q8_0 layer) on the fused native kernels instead of MMQ, on any sm_80+ card and on gfx1200 / gfx1201. In a build without llama.cpp's MMQ it is on by default on both (a value you set is kept).",
"retire_after": "",
"retired_in": ""
},
@@ -25041,7 +25041,7 @@
"last_date": "2026-11-12",
"status": "research",
"owner": "prefill",
"note": "[DRAFT] CUDA and HIP gfx12 (phase 4): the Gyro trellis experts (TQK6 / TQK7, TQ2_T / TQ2_T), Hadamard-folded layers included, on the fused native kernels instead of MMQ. CUDA, unset: Gyro-S (TQK6 / TQK7) on compute capability 8.0, 8.6 and 8.9 cards with 80+ SMs (RTX A6000 class, gated on the 8.6 A6000 only; 8.0 and 8.9 by the same code since 11-12, no card of those two run; include/strata/prefill/fused_tq_default.hpp, tests/prefill/fused_tq_default_test.cpp), a diagnostic switch for bug reports, not a user setting; =1: Gyro-S and Gyro-M (TQ2_T / TQ2_T, no gate series) on any sm_80+ card and, on HIP, on gfx1200 / gfx1201 (HIP stays opt-in, default off); =0: MMQ again. STRATA_PF_FUSED_SM86=0 turns the sm_86 default off too. Goes with MMQ in release C.",
"note": "[DRAFT] CUDA and HIP gfx12 (phase 4): the Gyro trellis experts (TQK6 / TQK7, TQ2_T / TQ2_T), Hadamard-folded layers included, on the fused native kernels instead of MMQ. CUDA, unset: Gyro-S (TQK6 / TQK7) on compute capability 8.0, 8.6 and 8.9 cards with 80+ SMs (RTX A6000 class, gated on the 8.6 A6000 only; 8.0 and 8.9 by the same code since 11-12, no card of those two run; include/strata/prefill/fused_tq_default.hpp, tests/prefill/fused_tq_default_test.cpp), a diagnostic switch for bug reports, not a user setting; =1: Gyro-S and Gyro-M (TQ2_T / TQ2_T, no gate series) on any sm_80+ card and, on HIP, on gfx1200 / gfx1201 (HIP: opt-in, default off in a build with MMQ); =0: MMQ again. STRATA_PF_FUSED_SM86=0 turns the sm_86 default off too. In a build without llama.cpp's MMQ it is on by default on CUDA (sm_80+) and on HIP gfx1200 / gfx1201 (a value you set is kept). Goes with MMQ in release C.",
"retire_after": "",
"retired_in": ""
},
+4 -1
View File
@@ -203,7 +203,10 @@ std::vector<std::string>& own_only_switches() {
const bool g_own_only_defaults = [] {
strata::kernels::native_expert_i8_set_mmq_free(); // the int8 expert kernels are the default prompt-expert kernels here (i8_expert_rule.hpp, i8_switch_effective)
#if defined(STRATA_USE_HIP) || defined(__HIPCC__)
static const char* const kOn[] = {"STRATA_PF_FUSED", "STRATA_PF_FUSED_Q50", "STRATA_PF_FUSED_KQ"};
// (gfx12 only: every one of these is read behind the device's own gfx12 check, moe_fused_iq.cu q8d_hip_requested .. q6k_hip_requested, so a gfx11
// card keeps the rules it has: its layers of those formats take the FP16 path here as before)
static const char* const kOn[] = {"STRATA_PF_FUSED", "STRATA_PF_FUSED_Q50", "STRATA_PF_FUSED_Q8D", "STRATA_PF_FUSED_Q8GU",
"STRATA_PF_FUSED_Q6K", "STRATA_PF_FUSED_KQ", "STRATA_PF_FUSED_TQ"};
#else
// (not STRATA_PF_FUSED_Q2N: the GGUF Q2_0 / Q2_0 pair on sm_80+ misses its worst-row bound against MMQ at 20K / 32K tokens on sm_86,
// not explained yet; those layers take the FP16 path here unless the user sets it)