Files
Strata/engine/include/strata/kernels
Alexey Fateev a389331b93 qwen4-opt: sm_86 decode/prefill/MTP optimizations for Qwen4-35B-A3B on 1xRTX 3090
Ported from alesha-pro/Strata qwen4-opt 0d42d69f1a onto the q4_lite shape, every shared-code change fenced:

- the fused 256 x 8 router (native_router_topk_logits: top-8 on the logits, softmax over the 8 selected) and the router + all-resident expert plan in one
  launch (route_and_plan_256x8, resident_plan's one-warp path for up to 32 entries; sm_70+ only, Pascal and HIP keep the two-launch path)
- STRATA_QFUSE, STRATA_SMALL_UNR, STRATA_Q8_INPLACE(_MIN_OUT), STRATA_Q8_SM60_BPS as sm_86 defaults for the q4_lite build only; a QFUSE one-token window
  self-commits (it did not: #6583); the shared expert's gate row rides in the router launch for 1..4 rows (lfuse n >= 1, aux kernels)
- the 2048-wide unrolled BF16 GEMV / GDN a-b reads, Q4_K as the i8 expert down type, no drafter = one-token windows

Everything sits in #ifdef STRATA_Q4_OPT (defined for the q4_lite build only) and behind STRATA_Q4_OPT=0 at run time; the fork's edit of route_topk (Qwen3.6's
256 x 8 kernel) is a new kernel instead, so the other shapes keep their bits. Not taken from the commit: terminal/tools/qwen4_mtp_rt.py (the fork's native
Qwen4 MTP packer; community #7786 is the same tool with IQ4_NL / Q4_0 / Q8_0 experts and tests, taken in the next commit with its author).

Ported from alesha-pro/Strata qwen4-opt 0d42d69f1a
2026-12-04 11:23:24 +01:00
..