mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3925] [Engine] q36: load GGUFs whose ssm_alpha / ssm_beta are K-quants or IQ4_XS #4838
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#4838
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/3925
Author: @schmittcn
Created: 10/24/2026
Status: 🔄 Open
Base:
main← Head:pr/q36-kquant-small-tensors📝 Commits (2)
f03b60estrata-q36: widen K-quant and IQ4_XS small tensors in upload_f3293f73f5strata-q36: reword the upload_f32 comment📊 Changes
1 file changed (+9 additions, -1 deletions)
View changed files
📝
src/qwen35/q36_engine.cu(+9 -1)📄 Description
Problem and result
The Qwen3.6 path refuses mixed GGUFs at load. Their small GDN gates (
ssm_alpha,ssm_beta) are stored in the file'smain format rather than F32 / Q8_0:
Seen with third-party mixed GGUFs:
The official Qwen3.6-35B-A3B files store these gates as F32 or Q8_0, so they do not hit this failure.
#3699 reports the same for Sage-A1.5's Q4_K_M, where the gates are Q4_K, and leaves it out of that PR. With this
change,
upload_f32widens Q3_K, Q4_K, Q5_K, Q6_K and IQ4_XS on the host with the reference dequantizers that arealready in
strata/artifact/dequant.hpp, the same way it widens Q8_0. These tensors are small (30 layers x 2tensors). A file whose expert formats the engine takes then loads and runs.
Related discussion
This PR is the loader part alone. It is a focused fix, so there is no scope issue. If #3678 lands first, this PR
reduces to the IQ4_XS case.
Approach
One more branch in
upload_f32, for types 11-14 and 23 with a size that is a multiple of 256. It callsdequantize_q3_K/q4_K/q5_K/q6_K/iq4_xsper 256-value super-block. The error message lists the newformats. Files the loader already took never reach the new branch, so their path is unchanged.
Validation
Environment:
8183c6b6+f03b60e4(the later commit changes a code comment only):-DSTRATA_ENABLE_HIP=ON -DGPU_TARGETS=gfx1030, targetstrata-q36.Passed:
strata-q36.q36_engine.cuhas the same 6 warnings as at8183c6b6, none new.strata-q36 --native <IQ4_XS-gate file> --max-context 8192 --tokens <2,540 ids> --n 32stops at8183c6b6with the message above. With this commit it loads and continues the promptcoherently.
--dump-full-logitsoutput.serve/server.pyon this machine for a day. That covered chat, agent sessions and the community benchmark suite, with coherent answers
throughout.
f03b60e4: with the Qwen3.6 heretic IQ4_XSfile and an F32 copy of it, the same 14-token prompt and forced continuation gave byte-identical
--dump-full-logitsoutput across original → F32 copy → original (9 vectors of 248,320 logits, 21 of 256 experts per layer in VRAM).
The expanded gates matched the Python GGUF dequantizer. See their comment.
93f73f5f: clean build ofstrata-q36on Windows, MSVC 2022 + CUDA 13.0,-DCMAKE_CUDA_ARCHITECTURES=86, with and without-DSTRATA_Q6K_EXPERTS=ON(warning set not compared to the base).An Ornith-1.5 Q4_K_M file (Q4_K gates) stops at the expert check from #3699 on this head alone; with Q4_K expert-down
support also in the tree it loads and serves on an RTX 3090 (131K context, MTP 2). That tree carries other changes,
so this counts as "loads and serves", not as a speed result. See their comment.
Failed: none observed.
Not run:
q36_engine.cuand adds one include.tools/qwen35/kl.py): not run. The dequantizers are the existing reference ones.Limits
Only
upload_f32changes. A file whose routed experts use a format the native expert kernels do not take, such as aQ4_K down projection (#3699), is still refused at that check.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.