Skip to content

Commit 8513774

Browse files
justinchubyCopilot
andauthored
Clean up GGUF review findings (#633)
## Summary - clean up still-valid typing, documentation, test robustness, error-message, maintainability, and performance findings left by the GGUF PR stack - preserve the behavioral fixes merged in #625-#632 - hash reused multi-GB GGUF sources once, at the final pre-publication integrity gate, while retaining cheap identity checks around staging Exact base: `2db9d33debdc254d879a51b14434c9a81c230f4f` Exact head: `4541ed2bc9d2ab4227484510b4a85b2d9113eb25` ## Reconstructed original 17-item low-priority tranche The persisted audit retained only the totals, so this list was reconstructed from the live threads and current source. All but the already-fixed #596 comment are addressed in this PR. | PR | Comment | Disposition | |---|---:|---| | #550 | 3837144656 | Implemented: correct tuple return annotation | | #552 | 3837389183 | Implemented: multichannel waveform shape docs | | #559 | 3837716261 | Implemented: name-based cache assertions | | #573 | 3854308350 | Implemented: one final GGUF hash, with integrity regression coverage | | #574 | 3854345521 | Implemented: `TensorRole \| None` typing | | #574 | 3854345597 | Implemented: removed obsolete verdict filtering | | #577 | 3854472859 | Implemented: documented SSM sequence length | | #578 | 3843112613 | Implemented: documented F64 passthrough | | #579 | 3854518332 | Implemented: generalized fused-projection error | | #580 | 3854576300 | Implemented: removed brittle node counts | | #583 | 3854681386 | Implemented: documented conditional draft outputs | | #587 | 3854816872 | Implemented: corrected MTP output contract docs | | #596 | 3846110059 | Already fixed on base: unambiguous GQA bias comment | | #600 | 3855174281 | Implemented: metadata-count-only MTP error | | #607 | 3855776048 | Implemented: stable route-field assertions | | #607 | 3855776086 | Implemented: public tensor iterator | | #609 | 3856486136 | Implemented: fail-closed LM-head comment | ## Current unresolved-thread disposition This covers all 48 Copilot threads returned by the reproducible #600-#630 query. The one human #623 thread is excluded. | PR | Comment | Current-main disposition and evidence | |---|---:|---| | #600 | 3855174177 | Already fixed by #629: package cycle and reserved-sidecar validation | | #600 | 3855174238 | Already fixed by #629: explicit MTP sidecar naming/loading | | #600 | 3855174281 | Implemented here: error no longer invents an observed block count | | #602 | 3848155961 | Outside exact stack; already fixed: top-level `expert_dtype` is classified before early return | | #602 | 3848155983 | Outside exact stack; still-valid behavioral block-quant validation, unchanged | | #602 | 3848156000 | Outside exact stack; still-valid truncated-read behavioral finding, unchanged | | #602 | 3848156022 | Outside exact stack; still-valid descriptor byte/dtype validation, unchanged | | #602 | 3848156040 | Outside exact stack; still-valid expert-bank payload validation, unchanged | | #603 | 3855249765 | Already fixed by #630: runtime preflight preserves shard sets | | #603 | 3855249840 | Already fixed by #630: success output follows durable runtime publication | | #604 | 3855343082 | Implemented here: graph-only MTP persistence distinguished from runtime rejection | | #604 | 3855343131 | Already fixed by #630: runtime success messages are atomic | | #607 | 3855776001 | Implemented here: missing generation golden skips before provenance read | | #607 | 3855776048 | Implemented here: only stable route fields are asserted | | #607 | 3855776086 | Implemented here: tensor count uses `tensor_items_raw()` | | #608 | 3856079371 | Still-valid behavioral cache-symlink containment finding; unchanged | | #608 | 3856079415 | Still-valid behavioral lowercase-digest validation finding; unchanged | | #609 | 3856486136 | Implemented here: comment matches value-preserving policy | | #610 | 3855541683 | Already fixed by #628: Falcon bias precedence is explicit | | #610 | 3855541761 | Already fixed by #628: CTRL tiny config exercises projection biases | | #611 | 3856595840 | Implemented here: runtime test resolves the distribution providing the module | | #612 | 3855677383 | Already fixed by #625: supported-version endianness detection | | #612 | 3855677427 | Implemented here: shared `INT64_MAX` sentinel | | #612 | 3855677460 | Implemented here: shared PLaMo2 width inference | | #612 | 3855677486 | Implemented here: accepted PLaMo2 activation spellings are explicit | | #613 | 3855845678 | Implemented here: canonical issue URL | | #613 | 3855845757 | Implemented here: Mamba-1 function-registration docs | | #613 | 3855845806 | Implemented here: test expects the canonical issue URL | | #614 | 3855988545 | Implemented here: removed stale Nemotron-H divergence comments | | #614 | 3855988597 | Already fixed by #628: zero-head geometry raises actionable `ValueError` | | #615 | 3856082290 | Already fixed by #626: dense GraniteHybrid bias closure | | #618 | 3856729330 | Implemented here: required routes filter ORT GenAI evidence | | #618 | 3856729409 | Implemented here: env-selected runtime version is authoritative | | #618 | 3856729490 | Stale/N/A: PR-description-only matrix claim; repository workflow claims one pinned version | | #618 | 3856729563 | Implemented here: schema tail restored to normal indentation | | #619 | 3856342484 | Already fixed on base: Kimi Linear uses `/issues/605` | | #619 | 3856342532 | Already fixed by #628: config rejects convolution kernels below 2 | | #619 | 3856342580 | Already fixed by #628: GGUF contract rejects convolution kernels below 2 | | #620 | 3855717041 | Already fixed by #627: tied LM-head-only checkpoints are retained | | #621 | 3856722324 | Already fixed by #628: Kimi-K3 required metadata is complete | | #623 | 3855931210 | N/A to current main: comment belongs to open, unmerged #623 | | #623 | 3855939302 | N/A to current main: comment belongs to open, unmerged #623 | | #623 | 3855939358 | N/A to current main: comment belongs to open, unmerged #623 | | #623 | 3855939394 | N/A to current main: comment belongs to open, unmerged #623 | | #624 | 3856777152 | Implemented here: runtime compatibility reuses the emitted model type | | #625 | 3857049733 | Implemented here: unsupported header reports both endian candidates | | #629 | 3857313182 | Newer post-audit behavioral sidecar-symlink cleanup finding; unchanged | | #629 | 3857313251 | Newer post-audit cross-platform path-safety finding; unchanged | ## Validation - affected GGUF/package/ORT GenAI/model/schema tests: 1,040 passed - broad non-integration suite: 7,851 passed, 56 skipped, 1 subtest passed - generated GGUF docs checks: 7 passed - initialized `lintrunner`; full lint/format passed - GPT-5.6 Sol medium review: one integrity finding fixed; re-review found no significant issues Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[email protected]>
1 parent 2db9d33 commit 8513774

30 files changed

Lines changed: 249 additions & 172 deletions

‎.agents/skills/attention-optimization/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ forces the Unfused fallback.
215215
> CPU+CUDA kernels are a *stricter* subset of what stock ORT supports:
216216
> historically both rejected `attention_bias`, and only the CUDA kernel
217217
> implemented `head_sink` (see
218-
> `crates/onnx-runtime-ep-cpu/src/kernels/group_query_attention.rs`,
218+
> [`justinchuby/onnx-genai/crates/onnx-runtime-ep-cpu/src/kernels/group_query_attention.rs`](https://github.com/justinchuby/onnx-genai/blob/main/crates/onnx-runtime-ep-cpu/src/kernels/group_query_attention.rs),
219219
> which now also implements `head_sink` on CPU; `attention_bias` remains
220220
> unimplemented there by design, matching the CUDA fused-kernel
221221
> limitation above, not an oversight).

‎docs/cli_reference.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,9 @@ Runtime packaging requires a validated embedded `tokenizer.huggingface.json`;
444444
opaque tokenizer pre-types are never reconstructed. Deferred/rejected
445445
architecture, tokenizer, draft-pairing, or mmproj checks run before durable
446446
output. Multimodal packages use `decoder`, `vision_encoder`, optional
447-
`audio_encoder`, and `embedding`; an admitted trailing MTP head is persisted
448-
under `mtp/`.
447+
`audio_encoder`, and `embedding`. Graph-only exports persist an admitted
448+
trailing MTP head under `mtp/`; runtime packaging currently rejects packages
449+
with an attached MTP sidecar.
449450

450451
---
451452

‎src/mobius/integrations/gguf/_arch_registry_test.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,11 +1590,7 @@ def _expected_rows() -> list[str]:
15901590
for spec in sorted(iter_arch_specs(), key=lambda s: s.gguf_arch):
15911591
aliases = ", ".join(f"`{a}`" for a in sorted(spec.aliases)) or "—"
15921592
model_type = f"`{spec.model_type}`" if spec.model_type else "—"
1593-
core_verdicts = {
1594-
name: verdict
1595-
for name, verdict in spec.verdicts.items()
1596-
if name != "quantized_import"
1597-
}
1593+
core_verdicts = spec.verdicts
15981594
status = (
15991595
"supported"
16001596
if all(verdict is Support.SUPPORTED for verdict in spec.verdicts.values())

‎src/mobius/integrations/gguf/_builder.py‎

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
UnsupportedGGUFArchitectureError,
5050
)
5151
from mobius.integrations.gguf._header import _gguf_architecture_from_header
52-
from mobius.integrations.gguf._spec import Support
52+
from mobius.integrations.gguf._spec import Support, TensorRole
5353

5454
_HUB_PREFLIGHT_TRANSPORT_ERRORS: tuple[type[BaseException], ...] = (OSError,)
5555
try:
@@ -1638,7 +1638,10 @@ def _raise_for_invalid_plamo2_tensor_contract(gguf_model) -> None:
16381638
raise ValueError("PLaMo2 requires attention.layer_norm_rms_epsilon=1e-6")
16391639
activation = metadata.get(f"{arch}.feed_forward.activation", "silu")
16401640
if activation not in {"silu", "swiglu"}:
1641-
raise ValueError(f"PLaMo2 supports only fused SwiGLU, got {activation!r}")
1641+
raise ValueError(
1642+
"PLaMo2 feed_forward.activation must be 'silu' or 'swiglu' "
1643+
f"(both select fused SwiGLU), got {activation!r}"
1644+
)
16421645
if bool(metadata.get(f"{arch}.ssm.use_predefined_initial_state", False)):
16431646
raise ValueError("PLaMo2 predefined initial state is unsupported")
16441647

@@ -1690,6 +1693,15 @@ def _raise_for_invalid_plamo2_tensor_contract(gguf_model) -> None:
16901693
name: tuple(int(dim) for dim in gguf_model.get_tensor_shape(name))
16911694
for name in gguf_model.tensor_names
16921695
}
1696+
from mobius.integrations.gguf._config_mapping import (
1697+
_infer_plamo2_attention_widths,
1698+
)
1699+
1700+
key_width, value_width = _infer_plamo2_attention_widths(
1701+
gguf_model,
1702+
tuple(head_counts),
1703+
tuple(kv_counts),
1704+
)
16931705
required: dict[str, tuple[int, ...]] = {
16941706
"token_embd.weight": (
16951707
int(
@@ -1706,7 +1718,6 @@ def _raise_for_invalid_plamo2_tensor_contract(gguf_model) -> None:
17061718
"output.weight": (required["token_embd.weight"][0], hidden)
17071719
}
17081720
dt_rank = max(64, hidden // 16)
1709-
inferred_widths: set[tuple[int, int]] = set()
17101721
for layer, (heads, kv_heads) in enumerate(zip(head_counts, kv_counts)):
17111722
prefix = f"blk.{layer}."
17121723
required.update(
@@ -1744,18 +1755,6 @@ def _raise_for_invalid_plamo2_tensor_contract(gguf_model) -> None:
17441755
raise ValueError(f"PLaMo2 layer {layer} has invalid attention head geometry")
17451756
qkv_name = prefix + "attn_qkv.weight"
17461757
output_name = prefix + "attn_output.weight"
1747-
if qkv_name not in actual_shapes or output_name not in actual_shapes:
1748-
continue
1749-
value_width, value_remainder = divmod(actual_shapes[output_name][1], heads)
1750-
key_width, key_remainder = divmod(
1751-
actual_shapes[qkv_name][0] - kv_heads * value_width,
1752-
heads + kv_heads,
1753-
)
1754-
if value_remainder or key_remainder or min(key_width, value_width) <= 0:
1755-
raise ValueError(
1756-
f"PLaMo2 layer {layer} key/value widths cannot be inferred exactly"
1757-
)
1758-
inferred_widths.add((key_width, value_width))
17591758
required.update(
17601759
{
17611760
qkv_name: (
@@ -1768,9 +1767,6 @@ def _raise_for_invalid_plamo2_tensor_contract(gguf_model) -> None:
17681767
}
17691768
)
17701769

1771-
if len(inferred_widths) != 1:
1772-
raise ValueError("PLaMo2 attention tensor widths are missing or contradictory")
1773-
key_width, value_width = inferred_widths.pop()
17741770
if key_width != value_width or key_width * max(head_counts) != hidden:
17751771
raise ValueError("PLaMo2 attention widths do not reconstruct embedding_length")
17761772
if inner != ssm_heads * key_width:
@@ -5040,7 +5036,7 @@ def repack_gguf_weight_to_target(
50405036
target_block_size: int,
50415037
target_symmetric: bool,
50425038
tensor_name: str,
5043-
tensor_role=None,
5039+
tensor_role: TensorRole | None = None,
50445040
):
50455041
"""Repack one 2-D GGUF weight to the graph's common MatMulNBits target.
50465042
@@ -5072,7 +5068,7 @@ def repack_gguf_weight_to_target(
50725068
repack_dequantized_tensor,
50735069
repack_gguf_tensor,
50745070
)
5075-
from mobius.integrations.gguf._spec import QuantImportRoute, TensorRole
5071+
from mobius.integrations.gguf._spec import QuantImportRoute
50765072

50775073
if tensor_role is None:
50785074
tensor_role = TensorRole.PROJECTION
@@ -5561,8 +5557,8 @@ def _load_quantized_state_dict(
55615557
offset = end
55625558
if offset != int(np_shape[0]):
55635559
raise ValueError(
5564-
f"Fused QKV tensor {hf_name!r} has {np_shape[0]} rows, "
5565-
f"but Q/K/V targets require {offset}"
5560+
f"Fused projection tensor {hf_name!r} has {np_shape[0]} rows, "
5561+
f"but its split targets require {offset}"
55665562
)
55675563
n_repacked += len(fused_projection_targets)
55685564
elif native_targets and native_spec is not None:

‎src/mobius/integrations/gguf/_builder_test.py‎

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,14 +2327,17 @@ class TestReuseGgufWeights:
23272327
def test_mixed_save_preserves_ranges_and_runs(self, tmp_path: Path):
23282328
from mobius._model_package import ModelPackage
23292329
from mobius.integrations.gguf import (
2330+
_reuse,
23302331
build_from_gguf,
23312332
verify_gguf_reuse_manifest,
23322333
)
23332334

23342335
gguf_path = tmp_path / "model.gguf"
23352336
_write_quantized_gguf(gguf_path, projection_quantization="f32")
23362337
package = build_from_gguf(gguf_path, reuse_gguf_weights=True)
2337-
package.save(str(tmp_path), progress_bar=False)
2338+
with mock.patch.object(_reuse, "_sha256", wraps=_reuse._sha256) as sha256:
2339+
package.save(str(tmp_path), progress_bar=False)
2340+
assert sha256.call_count == 1
23382341

23392342
verify_gguf_reuse_manifest(tmp_path)
23402343
manifest = json.loads((tmp_path / "gguf-reuse.json").read_text())
@@ -2392,6 +2395,36 @@ def test_mixed_save_preserves_ranges_and_runs(self, tmp_path: Path):
23922395
reference_outputs = reference_session.run(None, feeds)
23932396
np.testing.assert_allclose(outputs[0], reference_outputs[0], rtol=1e-5, atol=1e-5)
23942397

2398+
def test_save_rehashes_source_immediately_before_publish(
2399+
self,
2400+
tmp_path: Path,
2401+
monkeypatch,
2402+
) -> None:
2403+
from mobius.integrations.gguf import _reuse, build_from_gguf
2404+
2405+
gguf_path = tmp_path / "model.gguf"
2406+
_write_quantized_gguf(gguf_path, projection_quantization="f32")
2407+
package = build_from_gguf(gguf_path, reuse_gguf_weights=True)
2408+
real_write_json = _reuse._write_json_exclusive
2409+
mutated = False
2410+
2411+
def mutate_source_before_verification(path, payload):
2412+
nonlocal mutated
2413+
if path.name.startswith(".gguf-reuse.json.") and path.name.endswith(".tmp"):
2414+
source = bytearray(gguf_path.read_bytes())
2415+
source[-1] ^= 1
2416+
gguf_path.write_bytes(source)
2417+
mutated = True
2418+
return real_write_json(path, payload)
2419+
2420+
monkeypatch.setattr(_reuse, "_write_json_exclusive", mutate_source_before_verification)
2421+
with pytest.raises(ValueError, match="source identity mismatch"):
2422+
package.save(str(tmp_path), progress_bar=False)
2423+
2424+
assert mutated
2425+
assert not (tmp_path / "model.onnx").exists()
2426+
assert not (tmp_path / "gguf-reuse.json").exists()
2427+
23952428
def test_native_projection_bytes_are_not_copied_to_sidecar(self, tmp_path: Path):
23962429
from mobius.integrations.gguf import build_from_gguf
23972430
from mobius.integrations.gguf._reader import GGUFModel
@@ -5822,7 +5855,7 @@ def test_static_cache_is_rejected(self, tmp_path: Path) -> None:
58225855
({"invalid_decay": True}, "finite negative"),
58235856
({"group_count": 1}, "group_count=0"),
58245857
({"epsilon": 1e-5}, "rms_epsilon=1e-6"),
5825-
({"activation": "gelu"}, "fused SwiGLU"),
5858+
({"activation": "gelu"}, "'silu' or 'swiglu'"),
58265859
({"predefined_state": True}, "predefined initial state"),
58275860
({"head_counts": [4, 4]}, "head_count=4"),
58285861
({"kv_head_counts": [0]}, "match block_count"),
@@ -5882,7 +5915,7 @@ def test_float_import_preserves_expert_order_and_round_trips(self, tmp_path: Pat
58825915
package = build_from_gguf(path)
58835916
model = package["model"]
58845917
assert model.metadata_props["mobius.runtime_support"].endswith(
5885-
"onnxruntime/mobius#605"
5918+
"onnxruntime/mobius/issues/605"
58865919
)
58875920
assert [value.name for value in model.graph.outputs] == [
58885921
"logits",

‎src/mobius/integrations/gguf/_config_mapping.py‎

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,6 +2436,41 @@ def _falcon_h1_postprocess(
24362436
return result
24372437

24382438

2439+
def _infer_plamo2_attention_widths(
2440+
model: Any,
2441+
head_counts: tuple[int, ...],
2442+
kv_head_counts: tuple[int, ...],
2443+
) -> tuple[int, int]:
2444+
"""Infer PLaMo2 key/value widths from every attention layer's tensors."""
2445+
inferred: set[tuple[int, int]] = set()
2446+
tensor_names = set(model.tensor_names)
2447+
for layer, (q_heads, kv_heads) in enumerate(zip(head_counts, kv_head_counts)):
2448+
if kv_heads == 0:
2449+
continue
2450+
qkv_name = f"blk.{layer}.attn_qkv.weight"
2451+
output_name = f"blk.{layer}.attn_output.weight"
2452+
if qkv_name not in tensor_names or output_name not in tensor_names:
2453+
raise ValueError(
2454+
f"PLaMo2 layer {layer} is missing attention tensors required "
2455+
"to infer key/value widths"
2456+
)
2457+
qkv_shape = model.get_tensor_shape(qkv_name)
2458+
output_shape = model.get_tensor_shape(output_name)
2459+
value_width, value_remainder = divmod(int(output_shape[1]), q_heads)
2460+
key_width, key_remainder = divmod(
2461+
int(qkv_shape[0]) - kv_heads * value_width,
2462+
q_heads + kv_heads,
2463+
)
2464+
if value_remainder or key_remainder or min(key_width, value_width) <= 0:
2465+
raise ValueError(
2466+
f"PLaMo2 layer {layer} key/value widths cannot be inferred exactly"
2467+
)
2468+
inferred.add((key_width, value_width))
2469+
if len(inferred) != 1:
2470+
raise ValueError("PLaMo2 attention tensor widths are missing or contradictory")
2471+
return inferred.pop()
2472+
2473+
24392474
def _plamo2_postprocess(
24402475
config: ArchitectureConfig,
24412476
metadata: dict[str, Any],
@@ -2458,26 +2493,12 @@ def _plamo2_postprocess(
24582493

24592494
key_length = metadata.get(f"{arch}.attention.key_length")
24602495
value_length = metadata.get(f"{arch}.attention.value_length")
2461-
inferred: set[tuple[int, int]] = set()
24622496
if model is not None:
2463-
for layer, kv_heads in enumerate(kv_head_counts):
2464-
if kv_heads == 0:
2465-
continue
2466-
q_heads = head_counts[layer]
2467-
qkv_shape = model.get_tensor_shape(f"blk.{layer}.attn_qkv.weight")
2468-
output_shape = model.get_tensor_shape(f"blk.{layer}.attn_output.weight")
2469-
value_width, value_remainder = divmod(int(output_shape[1]), q_heads)
2470-
key_width, key_remainder = divmod(
2471-
int(qkv_shape[0]) - kv_heads * value_width,
2472-
q_heads + kv_heads,
2473-
)
2474-
if value_remainder or key_remainder or min(key_width, value_width) <= 0:
2475-
raise ValueError("PLaMo2 key/value widths cannot be inferred exactly")
2476-
inferred.add((key_width, value_width))
2477-
if inferred and len(inferred) != 1:
2478-
raise ValueError("PLaMo2 attention tensor shapes contradict across layers")
2479-
if inferred:
2480-
inferred_key, inferred_value = inferred.pop()
2497+
inferred_key, inferred_value = _infer_plamo2_attention_widths(
2498+
model,
2499+
head_counts,
2500+
kv_head_counts,
2501+
)
24812502
if key_length is not None and int(key_length) != inferred_key:
24822503
raise ValueError("PLaMo2 attention.key_length contradicts tensor shapes")
24832504
if value_length is not None and int(value_length) != inferred_value:

‎src/mobius/integrations/gguf/_header.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ def _gguf_architecture_from_header(
4343
little_version = struct.unpack_from("<I", data, 4)[0]
4444
if little_version in {2, 3}:
4545
byte_order = "<"
46-
version = little_version
4746
else:
48-
version = struct.unpack_from(">I", data, 4)[0]
49-
if version not in {2, 3}:
50-
raise ValueError(f"{source!r} uses unsupported GGUF version {little_version}.")
47+
big_version = struct.unpack_from(">I", data, 4)[0]
48+
if big_version not in {2, 3}:
49+
raise ValueError(
50+
f"{source!r} uses an unsupported GGUF version "
51+
f"(little-endian={little_version}, big-endian={big_version})."
52+
)
5153
byte_order = ">"
5254

5355
def read_uint32(offset: int) -> tuple[int, int]:

‎src/mobius/integrations/gguf/_mtp.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ def validate_mtp_tensor_contract(gguf_model) -> None:
350350
)
351351
if count != 1:
352352
raise ValueError(
353-
f"{architecture} GGUF declares {count} MTP heads and has {count} MTP blocks, "
354-
"but only exactly one appended MTP block can be represented; refusing to "
355-
"silently truncate the remaining heads"
353+
f"{architecture} GGUF declares {exact_key}={count}, but only exactly one "
354+
"appended MTP block can be represented; refusing to silently truncate "
355+
"the remaining heads"
356356
)
357357
if legacy_tensors:
358358
raise ValueError(

‎src/mobius/integrations/gguf/_mtp_test.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def _unexpected_build(*args, **kwargs):
456456
monkeypatch.setattr(core_builder, "build_from_module", _unexpected_build)
457457
with pytest.raises(
458458
ValueError,
459-
match=r"has 2 MTP blocks.*exactly one appended MTP block",
459+
match=r"nextn_predict_layers=2.*exactly one appended MTP block",
460460
):
461461
build_from_gguf(str(path))
462462
assert built is False
@@ -779,7 +779,7 @@ def test_unknown_nextn_tensor_is_rejected_before_graph_build(
779779
@pytest.mark.parametrize(
780780
("kwargs", "message"),
781781
[
782-
({"nextn_count": 2}, "declares 2 MTP heads"),
782+
({"nextn_count": 2}, r"nextn_predict_layers=2"),
783783
({"omit_nextn_stem": "hnorm"}, "missing required tensor stem"),
784784
({"mtp_block_index": 2}, "trailing block 1"),
785785
(

‎src/mobius/integrations/gguf/_preflight.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class GgufTypeStat:
110110
(:func:`._repacker.native_block_spec` / :func:`._repacker.repack_quant_params`)
111111
plus the float passthrough set — never a model-name allowlist:
112112
113-
* ``passthrough`` — a float block kept as-is (F32/F16/BF16).
113+
* ``passthrough`` — a float block kept as-is (F32/F16/BF16/F64).
114114
* ``native-preserve`` — byte-for-byte ``pkg.nxrt::BlockQuantizedMatMul``.
115115
* ``repack`` — repacked to ``com.microsoft::MatMulNBits``.
116116
* ``unsupported`` — no lossless path; a build would have to dequantize to

0 commit comments

Comments
 (0)