Skip to content

Add truthful GGUF MTP runtime evidence - #692

Merged
justinchuby merged 3 commits into
mainfrom
justinchuby-prove-mtp-runtime-evidence
Aug 28, 2026
Merged

justinchuby merged 3 commits into
mainfrom
justinchuby-prove-mtp-runtime-evidence

Conversation

@justinchuby

Copy link
Copy Markdown
Member

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

@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 28, 2026 16:38
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing a1ea520 → c20e9c9

Model Sub-model Changes Status

No architecture changes detected. ✅


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing a1ea520 → c20e9c9

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 68 68 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 66 66 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 105 105 +0.0% ⚪
gpt2 model_size_bytes 324 KB 324 KB +0.0% ⚪
gpt2 num_nodes 54 54 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 60 60 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 56 56 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 94 94 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 58 58 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 54 54 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 60 60 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 265 265 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 127 127 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 450 450 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 176 176 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

Emit external target/MTP cache contracts and artifact, graph, config, and package hashes without gating export or claiming downstream ORT GenAI support.

Record exact Qwen3.6 combined/split and Hy3 artifact identities, and exercise direct ORT proposal acceptance, rollback, replay, reorder, and target-only equality on a reduced independent coordinator.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Mobius’s GGUF + MTP export story by making the “what we can prove” vs “what remains unvalidated” explicit and machine-readable. It adds pinned immutable GGUF artifact/header identities and downstream-runtime limitations as structured evidence, and ensures MTP sidecars export an external coordination contract while clearly marking combined target/MTP execution as runtime_unvalidated.

Changes:

  • Add a new GGUF MTP runtime-evidence registry (qwen35 + hy_v3) and surface it in the generated quantization capability matrix and docs.
  • Emit mtp_config.json for ORT GenAI exports (including attached sidecars) with explicit cache namespace bindings and runtime_unvalidated status, plus additional tests.
  • Extend GGUF runtime packaging to record package/config/tokenizer hash identities and separate target/MTP cache namespaces (without gating export on real-artifact validation).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testdata/evidence/gguf_quantization_capabilities.json Adds mtp_runtime_evidence section with pinned unvalidated MTP runtime facts.
src/mobius/integrations/ort_genai/auto_export.py Emits mtp_config.json contract + adds tokenizer copy option plumbing.
src/mobius/integrations/ort_genai/auto_export_test.py Tests attached-sidecar MTP cache contract + unvalidated status metadata.
src/mobius/integrations/gguf/_runtime_package.py Writes mtp_runtime_status.json with hashes and cache namespace separation; adds safety checks.
src/mobius/integrations/gguf/_runtime_package_test.py Adds coverage for MTP runtime status hashing and new rejection behavior.
src/mobius/integrations/gguf/_quant_capabilities.py Integrates MTP runtime evidence into capability matrix output.
src/mobius/integrations/gguf/_quant_capabilities_test.py Ensures MTP runtime evidence is machine-readable and never selected as “supported”.
src/mobius/integrations/gguf/_mtp_test.py Adds identity + coordinator contract tests (accept/reject/rollback/reorder + target-only equality).
src/mobius/integrations/gguf/_mtp_runtime_evidence.py New canonical registry + validation for immutable MTP artifact/runtime-status records.
src/mobius/integrations/gguf/_mtp_runtime_evidence_test.py Closure tests for evidence invariants and pinned downstream ABI limitations.
src/mobius/integrations/gguf/_hy_v3_test.py Adds cache namespace aliasing guard assertions for HyV3 MTP.
src/mobius/integrations/gguf/_docs.py Extends runtime evidence table to include MTP runtime-unvalidated records.
src/mobius/_model_package.py Updates save() docs to reflect collision-free manifest-based MTP sidecar directory naming.
docs/cli_reference.md Updates CLI docs: tokenizer materialization becomes warning-based; MTP exports emit unvalidated coordination metadata.
docs/api/build_from_gguf.md Adds MTP runtime-unvalidated evidence rows to runtime-evidence section.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@justinchuby
justinchuby force-pushed the justinchuby-prove-mtp-runtime-evidence branch from e2b6cb5 to 9c5aaab Compare August 28, 2026 16:43
justinchuby and others added 2 commits August 28, 2026 09:53
Derive ORT MTP metadata from the current in-memory package so stale output manifests cannot diverge from ModelPackage.save. Cover both save/config orders and stale sidecar layouts, preserve the authoritative NextN count fallback, and keep local-only tokenizer misses best-effort.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Prefer authoritative GGUF NextN metadata over default-zero architecture fields, reject absent or invalid prediction counts, and never infer proposal width from hidden-layer depth.

Keep tokenizer copying best-effort only for missing optional Hub files while propagating online cache, permission, disk, network, and destination-write failures across supported Hub versions.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby merged commit dfe9af5 into main Aug 28, 2026
16 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-prove-mtp-runtime-evidence branch August 28, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants