Skip to content

gguf: Q2_0, where the ISTA GSQ-RCO Qwen3.8 files stop today #48

Closed

Description

@juliankang4

I looked at what the ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF files hit on main e8e32a38. On the plan board this is W2's quantwide (the type pins, coverage.rs, kernels.rs), and the W2 row already notes that "Qwen3.8's Q8_0 PLE refusal (body38.rs) waits for T1". So this is mostly a map of the files, plus one question: whether Q2_0, the first thing they hit, is a piece you would take from outside. I have not written any of it yet.

The files

Revision ed59f920, four sizes in two shards each. The second shard (28.8 GB, the per-layer n-gram table) is the same file in all four. The repository publishes every tensor's type under tensor-allocation/.

File Shard 1 Routed gate/up Routed down
IQ3_S 54.8 GB IQ2_S, IQ3_XXS, IQ3_S, IQ4_XS IQ4_NL, Q2_0
IQ3_XXS 47.0 GB IQ3_S, IQ2_XS, IQ2_S, IQ2_XXS, IQ3_XXS Q2_0, IQ4_NL
IQ2_XS 39.2 GB IQ2_S, IQ2_XXS, IQ1_M Q2_0
Q2_0 37.6 GB Q2_0 Q2_0

The dense sites differ from UD-Q4_K_XL too:

  • Attention and shared experts are K-quants, IQ4_XS, IQ4_NL, IQ3_S and some Q2_0, plus Q4_0 and Q5_0 shared experts in the Q2_0 file. UD-Q4_K_XL has q8_0 there.
  • Hyper-connection down/up and ple_key/ple_value are BF16 (ple_key is Q2_0 in the Q2_0 file), where UD-Q4_K_XL has q8_0.
  • ssm_alpha/ssm_beta are BF16 and ple_conv1d is F16, where UD-Q4_K_XL has F32.

What happens on main

All four stop when the file opens, at the first Q2_0 tensor:

bloomery-serve: open IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf: IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf: tensor "blk.1.ffn_down_exps.weight": ggml type ggml-type-42 has no size in this build's table

After Q2_0

In a local build only, I let strict_tensors take sizes from ggml_type_info and added id 42 there (64 values in 18 bytes). That lets Q4_0 through as well, which a Q2_0-only change would not. With that build:

  • The plan stops at the first tensor with no card format: tensor token_embd.weight: type iq4_xs has no device format, but its role (token_embd) puts it on a card for IQ3_S, and output.weight (IQ2_XS) or blk.0.attn_qkv.weight (Q2_0) for the others. CardFormat::of (crates/placement/src/placement.rs:353-383) has none for the IQ types or F16, so the F16 ple_conv1d stops there too.
  • coverage::check lists the rest. The counts are its entries, one per layer and feature, not tensors:
coverage::check entries IQ3_S IQ3_XXS IQ2_XS Q2_0
routed experts no card or host kernel reads (Q2_0, IQ2_S, IQ2_XXS, IQ1_M) 29 49 96 48
attention matrices that are not q8_0 (36 of them the BF16 ssm_alpha/ssm_beta) 128 145 114 152
shared experts that are not q8_0 127 127 114 117
BF16 hyper-connection down and up 48 48 48 48
token embedding and output head 2 3 3 3

Most of it is the Qwen38Body pins (crates/model/src/arch/coverage.rs:697-744), and the plan reads the attention, shared expert, hyper-connection and PLE matrices with q8_shape (crates/gpu/src/arch/qwen3moe/plan38.rs:408-409, 433-461, 476-478, 488-489). The ssm_alpha/ssm_beta entries look like a pin only: derive joins them into an F32 stack (body38.rs:1339-1355) and the plan reads that stack as F32 (plan38.rs:435), so BF16 would arrive there through CardFormat::Bf16AsF32. The check has no pin on ple_key/ple_value (Role::EngramDense), so their BF16 and Q2_0 stop the load only at q8_shape. Its one other entry, "a tool-call parser for this template", is in Body38::ALLOWED.

Q2_0

  • Mainline ggml's id 42, added in ggml: add Q2_0 quantization support (CPU) ggml-org/llama.cpp#24448 (bec4772f6a): 64 values in 18 bytes (an f16 scale and 2-bit codes), value ((q & 3) - 1) * d. The CPU vec_dot takes Q8_0 activations.
  • ik_llama.cpp has no Q2_0, and tools/ref/dequant_ref.cpp builds against ik. The qwen35 profile already uses mainline as its numeric oracle (tools/ref/models/qwen35.sh:15), so mainline's dequantize_row_q2_0 would be the reference here.

Questions

  1. Would you take Q2_0 as an outside PR: the GgmlType variant, its sizes and dequant in crates/gguf, checked against mainline? A new variant also has to be named in CardFormat::of (placement.rs:351 asks for that) and in the kernels.rs matches, so it touches W1's and W2's files, as None arms. The Q4_0/Q4_1 sizing in strict_tensors is already on the board, so I would leave it out unless you want it in the same PR.
  2. Are the other routed types (IQ2_S, IQ2_XXS and IQ1_M: dequant, a --synthetic oracle row and the host qdot kernel; Q2_0's host qdot) in quantwide's K list, and do the Qwen38Body dense sites come with the PLE work after T1? If those sites are meant to stay q8_0, these files are out of scope, and that answer is enough for me.

I can test on an RTX 5090 32 GB with a 64 GB host (Ryzen 9 9950X, native Linux).

How to reproduce

The headers are enough. This makes sparse placeholders: the first 32 MiB of each shard, extended to the full size so the loader takes the file. Shard 1 sizes are IQ3_S 54817524224, IQ3_XXS 47039860096, IQ2_XS 39225954592 and Q2_0 37623740192. Shard 2 is 28800138432 in all four. For IQ3_S:

base=https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF/resolve/ed59f92082b1e93c0e96d60a8b11aab089b52f09
mkdir -p IQ3_S
curl -fsSL -r 0-33554431 -o IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf $base/IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf
truncate -s 54817524224 IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf
curl -fsSL -r 0-33554431 -o IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf $base/IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf
truncate -s 28800138432 IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf
bloomery-serve -m IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf --plan
The local change and the example that prints the coverage list (not proposed as is)
diff --git a/crates/gguf/src/lib.rs b/crates/gguf/src/lib.rs
--- a/crates/gguf/src/lib.rs
+++ b/crates/gguf/src/lib.rs
@@ -779,6 +779,7 @@ pub fn ggml_type_info(id: u32) -> Option<(&'static str, u64, u64)> {
         3 => ("q4_1", 32, 20),
         9 => ("q8_1", 32, 36),
         15 => ("q8_K", 256, 296),
+        42 => ("q2_0", 64, 18),
         _ => return None,
     };
     Some((name, blck, tsz))
@@ -896,9 +897,11 @@ fn strict_tensors(
     for t in raw {
         let ty = GgmlType::from_u32(t.type_id);
         let own = private.iter().find(|p| p.id == t.type_id);
+        let info = ggml_type_info(t.type_id);
         let blck =
             ty.blck_size()
                 .or(own.map(|p| p.blck))
+                .or(info.map(|i| i.1))
                 .ok_or_else(|| LoadError::UnsupportedType {
                     name: t.name.clone(),
                     ty,
@@ -906,6 +909,7 @@ fn strict_tensors(
         let tsz =
             ty.type_size()
                 .or(own.map(|p| p.size))
+                .or(info.map(|i| i.2))
                 .ok_or_else(|| LoadError::UnsupportedType {
                     name: t.name.clone(),
                     ty,
// crates/model/examples/covlist.rs
fn main() {
    let p = std::env::args().nth(1).expect("path");
    let split = gguf::Split::open(&p).expect("open");
    let read = model::arch::spec(&split).expect("spec");
    for u in model::arch::coverage::check(&read.spec, &read.tensors) {
        println!("{:?}\t{}", u.layer, u.feature);
    }
}

With the change applied:

cargo oxide build --arch sm_86 -- -p bloomery-gpu-gates --features deepseek41 --release --bin bloomery-serve-qwen38
BLOOMERY_REF_MODEL=$PWD/IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf target/release/bloomery-serve-qwen38 --plan
cargo run --release -p bloomery-model --example covlist -- IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf

Activity

  1. midagedev commented on Oct 12, 2026

    @midagedev
    Owner

    Thanks for the map. We will read it against our quant plan today and answer the Q2_0 question here.

  2. midagedev commented on Oct 12, 2026

    @midagedev
    Owner

    Thanks. We read it against our quant plan. Yes to Q2_0 PRs, in two parts:

    1. gguf: the type, its block size and dequant. FAIL-first on today's open error for type 42. A synthetic-block test against mainline's dequantize_row_q2_0 (ik has no Q2_0). Q4_0/Q4_1 sizing goes in its own PR.
    2. Host: an AVX2 Q2_0 dot in crates/qdot, matched to ggml in its tests, as a separate PR after 1.

    The card kernels stay with us. They need our box gates.

    Note: the four files still will not load after these. The Qwen3.8 body pins attention and the shared expert to q8_0, and it lacks BF16 hc/PLE and F16 ple_conv1d. That work is ours, after our current tier work. IQ2_S, IQ2_XXS and IQ1_M follow it.

  3. midagedev commented on Oct 12, 2026

    @midagedev
    Owner

    Note: we are doing the Q4_0/Q4_1 tensor sizing ourselves now. It lands in 0.3.1 today. Your Q2_0 PRs (gguf, then the host dot) stay welcome as said above.

  4. juliankang4 commented on Oct 12, 2026

    @juliankang4
    CollaboratorAuthor

    Q2_0 1부(gguf) PR은 준비해 두었습니다. 타입과 블록 크기, 타입 크기, mainline dequantize_row_q2_0 포팅, mainline f2cc7282c의 decode와 대조하는 synthetic-block 시험(블록마다 스케일을 다르게 줬습니다), 오늘의 type 42 오류로 FAIL-first까지 들어 있습니다.

    다만 Q4_0/Q4_1 sizing이 같은 곳(enum, GGML_TABLE, UNKNOWN_IDS, placement arm, tools/hf-arch-check.py)을 건드려서, v0.3.1 태그가 나오면 그 위로 rebase하고 검사를 다시 돌린 다음 PR을 올리겠습니다. host AVX2 dot은 그다음에 이어서 하겠습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions