Skip to content

Commit dfe9af5

Browse files
justinchubyCopilot
andauthored
Add truthful GGUF MTP runtime evidence (#692)
## Summary - export structurally valid GGUF target+MTP packages without artifact, tokenizer, or downstream-runtime allowlists - emit the manifest-selected MTP graph path, exact target/MTP cache namespaces and port pairs, runtime/config/graph/artifact hashes, and `runtime_unvalidated` status without claiming ORT GenAI orchestration support - record immutable combined/split Qwen3.6 and target/combined Hy3 artifact/header identities in the generated capability matrix and docs - add mutation coverage for physical trailing-block identity and cache namespace aliasing - add a reduced direct-ORT Qwen coordinator that reads shared embedding/head values directly with `gguf.GGUFReader`, threads independent target/MTP caches, and exercises accept, reject, rollback, replay, reorder, and target-only equality ## Immutable artifact evidence ### qwen35 - combined: `localweights/Qwen3.6-27B-MTP-Q4_K_M-Q8nextn-GGUF@bdc8bc1ca4d45e1152d54c4e5f1389bc7bf6e439` - `Qwen3.6-27B-MTP-Q4_K_M-Q8nextn.gguf` - 16,998,719,584 bytes (within 16 GiB) - LFS SHA-256 `6cdb1aabb6ee711938df4192938b51228df9274f01c8d7a5ff404915ad342a7c` - 16 MiB header SHA-256 `ecf4be7b831ea56596022a4cd974930f59b37f5e64ce5b62bbe21686e02e07a8` - 65 physical blocks; trailing block 64 is one NextN head - split: `ggml-org/Qwen3.6-27B-GGUF@8a7ee08e8b9bfb857107ecc25a5599d2f38b76f8` - target 19,095,766,304 bytes + MTP 1,680,270,560 bytes = 20,776,036,864 bytes (above 16 GiB) - config/tokenizer source: `Qwen/Qwen3.6-27B@6a9e13bd6fc8f0983b9b99948120bc37f49c13e9` The reduced coordinator ran 51 natural MTP proposals / 102 emitted target tokens: 1 accepted, 50 rejected, 50 dual-cache rollbacks. The accepted transaction is independently replayed; every rejected target and MTP transaction is rolled back and replayed; both cache namespaces are batch-reordered; output token IDs and final target state equal target-only execution exactly. ### hy_v3 - `AngelSlim/Hy3-GGUF@31b453f4d9b647c74e4c4f5cba632eb512332c91` - combined `Hy3-IQ1_M-mtp.gguf`: 91,756,066,272 bytes, LFS SHA-256 `c1fe984fef6f23fd9eb144e41ce6824e3941ed0a8b6b8f9f3e63da0c2a1320c2` - target-only `Hy3-IQ1_M.gguf`: 89,446,312,384 bytes, LFS SHA-256 `8c4195718dc24384a38de1c492f4bca7d21447789714d232b0a4d9cd0bb0c806` - bounded headers prove 81 blocks with trailing MTP block 80 versus exactly 80 target-only blocks - config/tokenizer source: `tencent/Hy3@a960ebc3da325ba167f069f76c41eb62c9280d22` ## Runtime status and non-claims - observed environment: ONNX Runtime 1.29.0, `CPUExecutionProvider`; ONNX Runtime GenAI 0.15.2, source tag `ed5f4e87147731e5b07810f9f5c90103b3603cdf` - ORT GenAI 0.15.2 has no two-model MTP acceptance/cache/rollback/statistics API; this is downstream `runtime_unvalidated` status only and never an export gate - Qwen full-artifact execution remains unvalidated: the exact transfer was stopped after 2,167,418,880 / 16,998,719,584 bytes when observed throughput implied a multi-hour transfer before any 32 GiB-host build; the partial payload was deleted - Hy3 real-artifact execution remains unvalidated because the smallest complete candidate is 91,756,066,272 bytes, above policy - `pre=qwen35` and `pre=hunyuan-dense` tokenizer behavior remains separately deferred; tokenizer assets are best-effort and do not gate graph/config/package export - no real-artifact full-logit, source-value, quantized-storage, target-only generation, acceptance-rate, graph-hash, or package-hash claim is made by the static evidence records - runtime packages compute their own exact artifact, graph, config, tokenizer, and runtime-payload hashes while keeping execution/source/storage claims false - production routing contains no model-ID or revision pin ## Validation - latest base: `f494a75b62ce00e550d33d99797fc0ace30becbf` - broad serial non-integration suite: 9,053 passed, 64 skipped, 12 deselected - focused latest-base MTP/export/docs/CLI suite: 474 passed - formatter and pinned lint suite: clean - generated GGUF docs/capability matrix: current - targeted strict mypy: clean - final medium independent review: no findings - artifact directory: empty; no GGUF/ONNX/package/cache payload retained ## Waivers - qwen35 real-artifact runtime execution: operationally deferred as described above; reduced direct-ORT contract evidence is explicitly synthetic - hy_v3 real-artifact runtime execution: artifact exceeds the 16 GiB evidence policy - downstream ORT GenAI MTP orchestration: runtime 0.15.2 does not expose the required API; export remains supported and truthfully marked unvalidated --------- Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[email protected]>
1 parent a1ea520 commit dfe9af5

15 files changed

Lines changed: 2875 additions & 55 deletions

‎docs/api/build_from_gguf.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ warns while downstream runtime orchestration remains unvalidated.
7272

7373
## Runtime evidence
7474

75-
The first low-cost architecture batch promotes GPT-2, GPT-NeoX/Pythia, MPT, OLMo,
76-
StarCoder, and StarCoder2 using 334,238,976 bytes of GGUF payload and 346,825,051
75+
The first low-cost architecture batch promotes GPT-2, GPT-NeoX/Pythia, MPT, OLMo, StarCoder, and StarCoder2 using 334,238,976 bytes of GGUF payload and 346,825,051
7776
download bytes including tokenizer assets. Every route is explicit-float only. The
7877
network-free selection, budget, exclusions, and fail-closed candidate reasons are recorded in
7978
`testdata/evidence/gguf_low_cost_runtime_batch.json`.
@@ -91,6 +90,8 @@ network-free selection, budget, exclusions, and fail-closed candidate reasons ar
9190
| `tiny-olmo-q2-k-ort-genai-0.15.2` | `tensorblock/tiny-random-olmo-GGUF@d0ee9498d082d6dc3e730b9765e6e87a9bb5d995`<br>`tiny-random-olmo-Q2_K.gguf`<br>33,860,576 B<br>`be1c5a22ac0e75cd5874467ffd80bcd2c8500609d3bf7ccdb5b269373e4d6da4` | `hyper-accel/tiny-random-olmo@88675ef0caa5bd10ece810c0f2a79faa7724f536` | `hyper-accel/tiny-random-olmo@88675ef0caa5bd10ece810c0f2a79faa7724f536`<br>`special_tokens_map.json` 293 B `a6188c1e366f8ed715e60ff39c46a8c500fc33508e2affeb23e8c547c5853193`, `tokenizer.json` 2,115,417 B `a094266ac6c4982efba277bc251349a5a6d6ad37efb39a2a90f53d8be2a40a40`, `tokenizer_config.json` 5,372 B `78a839c7851f14f9fb30e664c2b46166dc0628f2900679e5ec160656f702edff`<br>metadata `25efe0090ffe5a6deb777743917fe572548a0f23357f74d8bd9e969cc911fd73` | ONNX Runtime 1.29.0 `CPUExecutionProvider`; ort-genai 0.15.2; result=passed; full-logit; dynamic KV cache prefill, full-sequence replay, rollback, reorder, and 20 decode steps; Explicit-float correctness route; source GGUF blocks are dequantized. |
9291
| `tiny-starcoder-q2-k-ort-genai-0.15.2` | `RichardErkhov/bigcode_-_tiny_starcoder_py-gguf@fa6f9fdbc134d86d78a3ff9ce08ab14ba33d4718`<br>`tiny_starcoder_py.Q2_K.gguf`<br>103,899,456 B<br>`aa8c2170bb9172447baba14309916cfc0d901dbffaf10f1448f4f631e10c1f41` | `bigcode/tiny_starcoder_py@8547527bef0bc927268c1653cce6948c5c242dd1` | `bigcode/tiny_starcoder_py@8547527bef0bc927268c1653cce6948c5c242dd1`<br>`special_tokens_map.json` 532 B `0823292e24ea07b89317e9ede9d08da2a1b6c014290c06908a7ad04f1efd6719`, `tokenizer.json` 2,057,395 B `42b5a37ba11199f024f2b8873e1ecba98da33166e16f700bf7cb2304b0a5583f`, `tokenizer_config.json` 677 B `95684c52ad9a970dbbb17576ee2237cb62902c1eff6804c7c91a4d6219a4a6d7`<br>metadata `23379a715b3983ce0f1559645984431bc039c16eaf6e062b7e62bceac6fa64cd` | ONNX Runtime 1.29.0 `CPUExecutionProvider`; ort-genai 0.15.2; result=passed; full-logit; dynamic KV cache prefill, full-sequence replay, rollback, reorder, and 20 decode steps; Explicit-float correctness route; source GGUF blocks are dequantized. |
9392
| `tiny-starcoder2-q2-k-ort-genai-0.15.2` | `tensorblock/tiny-random-starcoder2-GGUF@82c9eb61d1af6ea00dff834f1ff0620144b333e8`<br>`tiny-random-starcoder2-Q2_K.gguf`<br>68,039,904 B<br>`ab0a4b4e79c906520808db065a00a317c8b097e2176638b34088975eada6e0ed` | `hyper-accel/tiny-random-starcoder2@193576733055d2108dc9906d0da6e0806ad9be57` | `hyper-accel/tiny-random-starcoder2@193576733055d2108dc9906d0da6e0806ad9be57`<br>`special_tokens_map.json` 1,300 B `0fc9ac706a35e6337b19d484bc8f866b6a0ee7ad2509b03f7305dc0838c82d2c`, `tokenizer.json` 2,060,947 B `17fa145258b20c18287f1e3bd804e074cc13333f11984a2f5a2f11c5110437aa`, `tokenizer_config.json` 7,877 B `8149d8e6b21275ad2cc346885ad92c0e9b5aa3e28a78bb5d39b7febc7e52545d`<br>metadata `38608a4848dc8535113cff0312858853a0c8e29a5cdc145f258e4a9d84b35113` | ONNX Runtime 1.29.0 `CPUExecutionProvider`; ort-genai 0.15.2; result=passed; full-logit; dynamic KV cache prefill, full-sequence replay, rollback, reorder, and 20 decode steps; Explicit-float correctness route; source GGUF blocks are dequantized. The tiny source config declares BOS/EOS ID 50256 outside its 49152-token model vocabulary. |
93+
| `hy3-iq1-m-mtp-runtime-unvalidated` | combined: `AngelSlim/Hy3-GGUF@31b453f4d9b647c74e4c4f5cba632eb512332c91/Hy3-IQ1_M-mtp.gguf` 91,756,066,272 B `c1fe984fef6f23fd9eb144e41ce6824e3941ed0a8b6b8f9f3e63da0c2a1320c2`<br>total 91,756,066,272 B; above 16 GiB<br>target-only discriminator: `Hy3-IQ1_M.gguf` 89,446,312,384 B `8c4195718dc24384a38de1c492f4bca7d21447789714d232b0a4d9cd0bb0c806` | `tencent/Hy3@a960ebc3da325ba167f069f76c41eb62c9280d22` `0c9daab42bff9cce1b6f058b10d7b730f76d583e583e28ad56e92b36373246f0` | `tencent/Hy3@a960ebc3da325ba167f069f76c41eb62c9280d22`; separately deferred; metadata `bff10dd3b99c0d4098b28fbeb1af46804184cefc2920895969b6f1ad2e548fa3` | status=runtime_unvalidated; graph/package hashes unclaimed; ORT 1.29.0 `CPUExecutionProvider`; ort-genai 0.15.2 source `ed5f4e87147731e5b07810f9f5c90103b3603cdf`; The smallest pinned public complete Hunyuan-V3 MTP artifact is 91,756,066,272 bytes, above the 17,179,869,184-byte bounded-artifact policy. The matching target-only discriminator is 89,446,312,384 bytes.<br>ORT GenAI 0.15.2 exposes no two-model draft/target binding, independent target/MTP cache orchestration, proposal rollback, or acceptance statistics.<br>The embedded tokenizer uses pre=hunyuan-dense, whose compiled llama.cpp behavior is not serialized in GGUF. This is separate from the real-artifact budget and downstream two-model runtime validation gaps.<br>Bounded headers prove that the -mtp file has 81 physical blocks with trailing block 80 while the target-only file has exactly 80 blocks. No payload values, standalone MTP forward, graph, or package is promoted as runtime evidence. |
94+
| `qwen3.6-27b-mtp-runtime-unvalidated` | combined: `localweights/Qwen3.6-27B-MTP-Q4_K_M-Q8nextn-GGUF@bdc8bc1ca4d45e1152d54c4e5f1389bc7bf6e439/Qwen3.6-27B-MTP-Q4_K_M-Q8nextn.gguf` 16,998,719,584 B `6cdb1aabb6ee711938df4192938b51228df9274f01c8d7a5ff404915ad342a7c`<br>total 16,998,719,584 B; within 16 GiB<br>split: `ggml-org/Qwen3.6-27B-GGUF@8a7ee08e8b9bfb857107ecc25a5599d2f38b76f8/Qwen3.6-27B-Q4_K_M.gguf` 19,095,766,304 B `65b753ea835627f7b511143c6ceb976525c7f21f5df8c664bc0a9c23d1c49921`, `ggml-org/Qwen3.6-27B-GGUF@8a7ee08e8b9bfb857107ecc25a5599d2f38b76f8/mtp-Qwen3.6-27B-Q4_0.gguf` 1,680,270,560 B `3d593f9e2788d59bb30d6024706b1efd5219fea466b6397c46159e3540937173`<br>total 20,776,036,864 B; above 16 GiB | `Qwen/Qwen3.6-27B@6a9e13bd6fc8f0983b9b99948120bc37f49c13e9` `69db4eb7196bc8190813231b3018ca05d8c2e3abc7b1af19d55c157af44a9d9c` | `Qwen/Qwen3.6-27B@6a9e13bd6fc8f0983b9b99948120bc37f49c13e9`; separately deferred; metadata `8d1070c727a7e6a03726687aa5746acece0255060a2a61a905c4c2285d353b68` | status=runtime_unvalidated; graph/package hashes unclaimed; ORT 1.29.0 `CPUExecutionProvider`; ort-genai 0.15.2 source `ed5f4e87147731e5b07810f9f5c90103b3603cdf`; reduced direct-ORT coordinator {'accepted': 1, 'proposal_steps': 51, 'rejected': 50, 'rollbacks': 50}; ORT GenAI 0.15.2 constructs one Model per Generator and exposes no two-model draft/target binding, independent MTP-cache orchestration, proposal accept/reject rollback, or observable acceptance statistics. Its pinned release matrix places speculative decoding on the roadmap; Generator.rewind_to only rewinds the single target generator and is not an MTP acceptance loop.<br>The embedded tokenizer uses pre=qwen35, whose compiled llama.cpp behavior is not serialized in GGUF. This tokenizer limitation is separate from downstream two-model runtime validation.<br>The under-budget combined artifact proves immutable header, physical trailing block, and layout identity only. No payload values, production tensor mapping, quantized storage execution, standalone MTP forward, graph, or package is promoted as runtime evidence. A separate tiny direct-ORT coordinator exercises target/MTP cache threading, accept/reject rollback, replay, reorder, and target-only equality without upgrading the real-artifact status.<br>The 2026-08-28 qualification transfer fetched 2,167,418,880 of 16,998,719,584 bytes before measured throughput implied a multi-hour transfer ahead of any 32 GiB-host build/runtime attempt. The partial payload was deleted; this operational deferral does not restrict export support. |
9495

9596
Runtime support above is independent from tokenizer materialization support below.
9697
### Fail-closed runtime evidence

‎docs/cli_reference.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -445,13 +445,13 @@ sidecar fail before graph construction, and ORT GenAI packaging remains
445445
deferred. See
446446
[`build_from_gguf()`](api/build_from_gguf.md#nvidia-nemotron-h-moe-support-boundary).
447447

448-
Runtime packaging requires a validated embedded `tokenizer.huggingface.json`;
449-
opaque tokenizer pre-types are never reconstructed. Deferred/rejected
450-
architecture, tokenizer, draft-pairing, or mmproj checks run before durable
451-
output. Multimodal packages use `decoder`, `vision_encoder`, optional
452-
`audio_encoder`, and `embedding`. Graph-only exports persist an admitted
453-
trailing MTP head under `mtp/`; runtime packaging currently rejects packages
454-
with an attached MTP sidecar.
448+
Runtime packaging materializes a tokenizer only when its source can be represented
449+
faithfully; opaque processors remain explicit validation warnings and do not block
450+
graph/config/package export. Intrinsic graph, tensor, source-identity, and storage
451+
errors still fail before durable output. Multimodal packages use `decoder`,
452+
`vision_encoder`, optional `audio_encoder`, and `embedding`. MTP exports persist the
453+
target and sidecar in separate manifest-selected namespaces and emit exact external
454+
cache bindings plus `runtime_unvalidated` metadata.
455455

456456
---
457457

‎src/mobius/_model_package.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ def save(
366366
When the package contains a single model, it is saved directly as
367367
``model.onnx`` in *directory*. When multiple models are present,
368368
each is saved in its own subfolder as ``{name}/model.onnx``. An attached
369-
:attr:`mtp_head` package is always saved under ``mtp/``.
369+
:attr:`mtp_head` package is saved under a collision-free directory named
370+
by ``.mobius-package.json``.
370371
371372
.. note::
372373
This method writes ONNX files only. If you need a directory that

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

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
MMPROJ_ARTIFACT_PINS,
3030
iter_projector_specs,
3131
)
32+
from mobius.integrations.gguf._mtp_runtime_evidence import (
33+
iter_mtp_runtime_evidence,
34+
)
3235
from mobius.integrations.gguf._quant_registry import (
3336
iter_quant_specs,
3437
render_quant_support_matrix,
@@ -354,6 +357,51 @@ def _runtime_evidence_table() -> str:
354357
f"{evidence.parity_kind}; {evidence.stateful_semantics}"
355358
f"{'; ' + evidence.limitations if evidence.limitations else ''} |"
356359
)
360+
for mtp_evidence in iter_mtp_runtime_evidence():
361+
layouts = "<br>".join(
362+
(
363+
f"{layout.name}: "
364+
+ ", ".join(
365+
f"`{artifact.repository}@{artifact.revision}/{artifact.filename}` "
366+
f"{artifact.size:,} B `{artifact.lfs_sha256}`"
367+
for artifact in layout.artifacts
368+
)
369+
+ f"<br>total {layout.total_size:,} B; "
370+
+ (
371+
"within 16 GiB"
372+
if layout.within_bounded_artifact_policy
373+
else "above 16 GiB"
374+
)
375+
)
376+
for layout in mtp_evidence.layouts
377+
)
378+
discriminator = mtp_evidence.target_only_discriminator
379+
if discriminator is not None:
380+
layouts += (
381+
f"<br>target-only discriminator: `{discriminator.filename}` "
382+
f"{discriminator.size:,} B `{discriminator.lfs_sha256}`"
383+
)
384+
limitations = "<br>".join(mtp_evidence.downstream_limitations)
385+
deferrals = "<br>".join(mtp_evidence.separate_deferrals)
386+
synthetic = (
387+
f"; reduced direct-ORT coordinator "
388+
f"{dict(mtp_evidence.synthetic_acceptance_statistics)}"
389+
if mtp_evidence.synthetic_coordinator_test is not None
390+
else ""
391+
)
392+
rows.append(
393+
f"| `{mtp_evidence.evidence_id}` | {layouts} | "
394+
f"`{mtp_evidence.config_repository}@{mtp_evidence.config_revision}` "
395+
f"`{mtp_evidence.config_sha256}` | "
396+
f"`{mtp_evidence.tokenizer_repository}@{mtp_evidence.tokenizer_revision}`; "
397+
f"separately deferred; metadata `{mtp_evidence.tokenizer_metadata_sha256}` | "
398+
f"status={mtp_evidence.result}; graph/package hashes unclaimed; "
399+
f"ORT {mtp_evidence.onnxruntime_version} "
400+
f"`{mtp_evidence.execution_provider}`; {mtp_evidence.runtime} "
401+
f"{mtp_evidence.runtime_version} source "
402+
f"`{mtp_evidence.runtime_source_revision}`{synthetic}; "
403+
f"{limitations}<br>{deferrals} |"
404+
)
357405
return "\n".join(rows)
358406

359407

@@ -708,8 +756,7 @@ def render_document() -> str:
708756
709757
## Runtime evidence
710758
711-
The first low-cost architecture batch promotes GPT-2, GPT-NeoX/Pythia, MPT, OLMo,
712-
StarCoder, and StarCoder2 using 334,238,976 bytes of GGUF payload and 346,825,051
759+
The first low-cost architecture batch promotes GPT-2, GPT-NeoX/Pythia, MPT, OLMo, StarCoder, and StarCoder2 using 334,238,976 bytes of GGUF payload and 346,825,051
713760
download bytes including tokenizer assets. Every route is explicit-float only. The
714761
network-free selection, budget, exclusions, and fail-closed candidate reasons are recorded in
715762
`testdata/evidence/gguf_low_cost_runtime_batch.json`.

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,23 @@ def test_hy_v3_gguf_builds_trunk_and_independent_mtp(
307307
assert len([value for value in mtp.graph.inputs if "past_key_values" in value.name]) == 2
308308
assert "model.layers.1.mlp.e_score_correction_bias" in trunk.graph.initializers
309309
assert "layers.0.mlp.e_score_correction_bias" in mtp.graph.initializers
310+
trunk_cache = {
311+
value.name
312+
for value in trunk.graph.inputs
313+
if value.name and value.name.startswith("past_key_values.")
314+
}
315+
mtp_cache = {
316+
value.name
317+
for value in mtp.graph.inputs
318+
if value.name and value.name.startswith("past_key_values.")
319+
}
320+
assert trunk_cache & mtp_cache == {
321+
"past_key_values.0.key",
322+
"past_key_values.0.value",
323+
}
324+
assert {("target", name) for name in trunk_cache}.isdisjoint(
325+
{("mtp", name) for name in mtp_cache}
326+
)
310327

311328

312329
def test_hy_v3_target_only_split_builds_without_sidecar(tmp_path: Path) -> None:

0 commit comments

Comments
 (0)