mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3699] [Engine] qwen35: accept Q4_K down-projection experts (Q4_K_M GGUFs) #4751
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4751
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3699
Author: @xyehya
Created: 10/22/2026
Status: 🔄 Open
Base:
main← Head:engine-q36-q4k-down📝 Commits (2)
b377a35[Engine] qwen35: accept Q4_K down-projection experts6e1e99b[Engine] qwen35: a parity case for the Q4_K down experts at FF 512📊 Changes
4 files changed (+14 additions, -5 deletions)
View changed files
📝
CMakeLists.txt(+3 -0)📝
docs/QWEN36.md(+1 -0)📝
src/kernels/cuda/iq_kernels.cu(+3 -3)📝
src/kernels/native_expert_parity.cpp(+7 -2)📄 Description
Problem and result: a Q4_K_M GGUF of a Qwen3.6-35B-A3B-architecture model (qwen35moe) is refused at load by the Qwen3.6 engine path:
llama.cpp's Q4_K_M recipe stores the routed experts' down projection as Q4_K in about half the layers (here 20 of 41:
Q4_K/Q4_K/Q4_Kx 20,Q4_K/Q4_K/Q6_Kx 21).STRATA_D_FMTShas Q5_K and Q6_K but no Q4_K, sonative_expert_supported()returns false. With Q4_K (type 12) added to bothSTRATA_D_FMTSvariants the file loads and runs. The gate/up side already takes Q4_K (it is inSTRATA_GU_FMTS) and the CPU pool goes through ggml'svec_dot, so only the GPU down-format list changes.Model: InternScience/Sage-A1.5 (Qwen3.6-35B-A3B fine-tune, Apache-2.0), official Q4_K_M. That file has a second, separate obstacle (its
ssm_alpha/ssm_betaare Q4_K too, whichupload_f32refuses); I worked around it outside the engine by grafting the original BF16 gates, so it is not part of this PR. The resulting file is at https://huggingface.co/ykarout/Strata-Sage-A1.5-GGUF for anyone who wants to reproduce.Approach: one entry in the existing format list. Flash-Next is unaffected: its FF 640 is not a multiple of Q4_K's 256-value block, so
native_expert_supported()still refuses Q4_K downs there, before and after (the existing comment says the same for Q5_K / Q6_K).Validation (revision
011c9e6+ this commit, Fedora 44, CUDA 13.4, gcc-15 host compiler, RTX 5080 16 GB sm_120, 64 GB DDR5; engine 0.1.47 build of this tree):Passed:
cmake --build build --target strata(CUDA) builds clean.--native Sage-A1.5-Q4_K_M-ssmbf16.gguf --max-context 32768 --prefill auto --mtp 2 --pool-workers 16->hybrid experts: 112 of 256 per layer in VRAM (8.16 GiB), serves.serve/server.py, 3 fresh ~3.6K-token code prompts, 384 tokens each, temp 1.0: pp 4,560 / 4,885 / 5,069 tok/s, tg 133.9 / 153.2 / 154.7 tok/s, every request completed (1,152 tokens).Failed: none observed.
Not run:
iq_kernels.cuis also compiled for HIP): no ROCm on this machine. Keeping this as a draft until someone can build HIP, per CONTRIBUTING.tools/qwen35/q36_solo_gate.py/q36_cmp_gate.pyparity gates against Unsloth's UD files (their downs are Q5_K/Q6_K, so the new case is not reached; a check that the UD path is unchanged is still worth running): the GPU is busy with a long agent run here; I can run them afterwards and post the output.Limits: checked on one model and one GPU. Q4_K downs were only exercised with FF 512 (Qwen3.6-35B geometry).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
tools <name>(space) and a baretoolsas a declared tool's name, next to #4751'stools.<name>#3232