From 30e3add968c366384dff3ad5272327c5ee7da1e4 Mon Sep 17 00:00:00 2001 From: Robert Karl Date: Sun, 11 Oct 2026 11:24:00 -0700 Subject: [PATCH] The Qwen3.6 gate runs before the expert format whitelist, and names the formats step 3 lacks On the 1080 Ti both real files never reached the step 2 gate: generate.cpp checked native_expert_supported() per layer right after the layout load, and the grouped kernels' down types (STRATA_D_FMTS: IQ4_NL, IQ4_XS, Q5_0, Q5_1, Q8_0) do not include IQ3_XXS (the IQ3_XXS file, 37 layers), Q5_K or Q6_K (the Q4_K_XL file): strata generate: layer 0's experts are IQ2_S/IQ3_XXS (ggml types 22/18), which this engine has no GPU kernels for The gate now comes first for a qwen35moe file: the geometry, the VRAM plan, then one line per gate-up/down pair without a kernel with its layers ("step 3 also needs GPU expert kernels for ..."), then qwen35moe_not_yet. The whitelist loop is unchanged and still runs before anything is allocated for every other file. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr --- src/program/generate.cpp | 52 +++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/src/program/generate.cpp b/src/program/generate.cpp index 06bb832..4e34575 100644 --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -2097,20 +2097,6 @@ int main(int argc, char** argv) { std::fprintf(stderr, "strata generate: %s\n", err.c_str()); return 1; } - // Every layer's formats must have GPU expert kernels and a prompt-path dequantizer, checked here, before - // anything is allocated: an unsupported down type used to exit from inside the first verify window, and - // an unsupported dequant type left the prompt path's fp16 buffer unwritten. - const auto& lay = strata::kernels::cpu::expert_layout(); - for (int64_t l = 0; lay.native && l < (int64_t) lay.fmt.size(); ++l) { - const auto& f = lay.fmt[(size_t) l]; - if (!strata::kernels::native_expert_supported(f.gu_type, f.d_type, f.n_embd, f.n_ff)) { - std::fprintf(stderr, "strata generate: layer %lld's experts are %s/%s (ggml types %d/%d), which this " - "engine has no GPU kernels for\n", (long long) l, - strata::ggml_type_name((uint32_t) f.gu_type), strata::ggml_type_name((uint32_t) f.d_type), - f.gu_type, f.d_type); - return 1; - } - } } const bool native_pack = strata::kernels::cpu::expert_layout().native; // --vram-cap: the blocker, allocated before anything else of this engine is, so every later figure (and the @@ -2237,9 +2223,47 @@ int main(int argc, char** argv) { std::fprintf(stderr, "strata generate: %s\n", plan.refusal.c_str()); return 2; } + // the expert formats the GPU kernels do not have (the format whitelist below, which the start would refuse + // on first): named per layer here as step 3's work, so the gate's output is the whole list + { + const auto& lay = strata::kernels::cpu::expert_layout(); + std::map> missing; + for (int64_t l = 0; lay.native && l < (int64_t) lay.fmt.size(); ++l) { + const auto& f = lay.fmt[(size_t) l]; + if (strata::kernels::native_expert_supported(f.gu_type, f.d_type, f.n_embd, f.n_ff)) continue; + missing[std::string(strata::ggml_type_name((uint32_t) f.gu_type)) + "/" + + strata::ggml_type_name((uint32_t) f.d_type)].push_back(l); + } + for (const auto& m : missing) { + std::string ls; + for (size_t i = 0; i < m.second.size(); ++i) { + if (i == 8 && m.second.size() > 10) { ls += ", ... (" + std::to_string(m.second.size()) + " layers)"; break; } + ls += (i ? ", " : "") + std::to_string(m.second[i]); + } + std::fprintf(stderr, "strata generate: step 3 also needs GPU expert kernels for gate-up/down %s (%zu layers: %s)\n", + m.first.c_str(), m.second.size(), ls.c_str()); + } + } std::fprintf(stderr, "strata generate: %s\n", strata::core::qwen35moe_not_yet(g).c_str()); return 2; } + { + // Every layer's formats must have GPU expert kernels and a prompt-path dequantizer, checked here, before + // anything is allocated: an unsupported down type used to exit from inside the first verify window, and + // an unsupported dequant type left the prompt path's fp16 buffer unwritten. (After the Qwen3.6 gate, which + // prints the plan and names these formats itself: step 2's gate is what a Qwen3.6 file reaches.) + const auto& lay = strata::kernels::cpu::expert_layout(); + for (int64_t l = 0; lay.native && l < (int64_t) lay.fmt.size(); ++l) { + const auto& f = lay.fmt[(size_t) l]; + if (!strata::kernels::native_expert_supported(f.gu_type, f.d_type, f.n_embd, f.n_ff)) { + std::fprintf(stderr, "strata generate: layer %lld's experts are %s/%s (ggml types %d/%d), which this " + "engine has no GPU kernels for\n", (long long) l, + strata::ggml_type_name((uint32_t) f.gu_type), strata::ggml_type_name((uint32_t) f.d_type), + f.gu_type, f.d_type); + return 1; + } + } + } // STRATA_EARLY_REMOTE_CONTEXTS=1: create EVERY secondary context here, like CUDA1's. Under WSL2 the driver's // pinned/mapped host budget (dxg gpadl, ~1 GiB) is spent by CUDA0's weights and MTP before the later loop runs, // and a new context then fails with cudaErrorMemoryAllocation (CUDA2: "cudaSetDevice(2) failed: out of memory").