From 8837cb6f0f07b99774050e2feaed561de7d5175f Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Sun, 18 Oct 2026 20:54:11 +0200 Subject: [PATCH] gu_swiglu: the 80-dots-a-row guard for every format (Gyro's trellis gate/up rows went through the 16-lane kernel) launch_gu_swiglu (STRATA_GU_SWIGLU, on by default on compute capability 12.0 cards since 147-verify) runs 16-lane gate/up rows that assume 80 dots a row, but its guard rejected only the K-quants. The APR trellis types (TQ2_T / TQK6 gate/up: qk 128, ipb 8, 160 dots at n_embd 2560) went through it: half of each row, Gyro-S answered with loops, garbage or nothing on every RTX 50 / RTX PRO Blackwell card. They now take launch_gu's full-warp kernel, as launch_gu itself always did for them; 80-dot formats are unchanged. l620 (RTX PRO 5000, Gyro-S through serve/server.py, the owner's QA prompts, greedy and the app's sampling): before 0/8 correct, after 8/8 ("STRATA_OK 42", "4", the follow-up sentence, "PING"), the same as STRATA_SM120_PERF=0 / STRATA_GU_SWIGLU=0; Gyro-S fix vs STRATA_SM120_PERF=0: identity gate 10/10, exact_pp 4K / 20K IDENTICAL (KL 0). --- src/kernels/cuda/iq_kernels.cu | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kernels/cuda/iq_kernels.cu b/src/kernels/cuda/iq_kernels.cu index 4880150f..4d988f1a 100644 --- a/src/kernels/cuda/iq_kernels.cu +++ b/src/kernels/cuda/iq_kernels.cu @@ -3859,8 +3859,10 @@ bool launch_gu_swiglu(const NativeExpertLayout& L, int64_t gy, cudaStream_t s, c return false; } else { if (g_old_kernels || split_off() || g_no_sub16_gu || L.n_embd != 2560 || L.n_ff % 32 != 0 || L.n_ff <= 0) return false; - // the 16-lane rows assume 80 dots a row (as launch_gu): the 256-value K-quants have 160 - if (kq_type && (L.n_embd / Fmt::qk) * Fmt::ipb != 80) return false; + // the 16-lane rows assume 80 dots a row (as launch_gu): the 256-value K-quants and the APR trellis types (TQ2_T / + // TQK6 gate/up: qk 128, ipb 8) have 160 at n_embd 2560 and take launch_gu's full-warp multi kernel. Gyro-S (TQK6 + // gate/up) went through here on every 12.0 card from 147-verify on: half of each gate/up row, looping answers. + if ((L.n_embd / Fmt::qk) * Fmt::ipb != 80) return false; const dim3 grid((unsigned) (L.n_ff / 32), (unsigned) gy); bool stage = false; if constexpr (kStageIqGrid) stage = g_stage_grid && !((TG == 18 || TG == 21) && !stage_tables_on());