native dense: run the architecture guard only on the first shard of a split

A splitter may copy general.architecture into EVERY shard of a split while the
qwen4exp.* hyperparameters live only in shard 1 (seen with the Huihui
abliterated re-split of the UD-Q4_K_XL GGUF: general.architecture in shards
2-4, no qwen4exp.* there). NativeDense::load then ran check_architecture on
shard 2 and failed with 'missing qwen4exp.block_count'.

Run the full guard only when the shard is the first of the split (no split.no,
or split.no == 0); later shards take the existing split-metadata consistency
check whether or not they carry the architecture key. Verified end to end:
with this change the engine loads the re-split GGUF (previously: refused),
pack built with iq_pack.py --compat-bf16, coherent greedy output.

(PR #648)
This commit is contained in:
jollyroger1480 authored and Niko1221 committed 2026-10-06 15:57:38 +02:00
1 parent 536db01af9
commit ccfdc2ebef
1 file changed
+2 -1
+2 -1
View File
@@ -155,7 +155,8 @@ bool NativeDense::load(const std::vector<std::string>& shards, WeightTable& tabl
const auto* count = gguf.get("split.count");
const auto* number = gguf.get("split.no");
const auto* tensors = gguf.get("split.tensors.count");
if (gguf.get("general.architecture")) {
if (gguf.get("general.architecture") && (!number || number->u == 0)) {
// splitter may copy general.architecture into every shard (Huihui abliterated re-split)
err = strata::check_architecture(gguf);
if (!err.empty()) return false;
have_architecture = true;