mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 15:58:53 +00:00
gguf_reader: the compress_ratios "list longer by the MTP layers" is accepted only where the compiled shape has an MTP block
read_geometry accepted a compress_ratios list one entry per in-file MTP layer longer than block_count. The accepted length is now n_layers + n_mtp_layers only when the compiled geometry has n_mtp_layers > 0 (q4_lite); every other shape accepts exactly one entry per layer, as before.
This commit is contained in:
1 parent
450e9c7071
commit
355b7629c5
1 file changed
+2
-1
@@ -968,7 +968,8 @@ inline std::string read_geometry(const GgufFile& f, core::ModelGeometry& g) {
|
||||
if (const MetaValue* v = f.get(p + "attention.compress_ratios")) {
|
||||
// One entry per trunk layer; a file with an in-file MTP tail may list the tail too (Qwen4-35B-A3B lists 41
|
||||
// for 40 trunk layers). Only the trunk entries are checked - the tail is not a trunk layer.
|
||||
const uint64_t listed = (uint64_t) g.n_layers + (uint64_t) g.n_mtp_layers; // = n_layers when no tail
|
||||
// Only where the compiled shape has an in-file MTP block (q4_lite); every other shape accepts exactly the one entry per layer it always did.
|
||||
const uint64_t listed = kMtpTail ? (uint64_t) g.n_layers + (uint64_t) g.n_mtp_layers : (uint64_t) g.n_layers;
|
||||
if (v->type != MetaType::ARRAY || (v->count != (uint64_t) g.n_layers && v->count != listed) ||
|
||||
v->items.size() != v->count)
|
||||
return p + "attention.compress_ratios must list one entry for each of the " + std::to_string(g.n_layers) +
|
||||
|
||||
Reference in new issue
Block a user