Skip to content

Promote exact Qwen2 and LFM2 GGUF runtime evidence - #642

Merged
justinchuby merged 2 commits into
mainfrom
justinchuby-prove-gguf-runtime-support
Aug 26, 2026
Merged

justinchuby merged 2 commits into
mainfrom
justinchuby-prove-gguf-runtime-support

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

Promotes two exact graph-supported GGUF routes to runtime-supported under the released onnxruntime-genai==0.15.2 contract:

  • Qwen2.5-0.5B-Instruct Q8_0: Qwen/Qwen2.5-0.5B-Instruct-GGUF@9217f5db79a29953eb74d5343926648285ec7e67, qwen2.5-0.5b-instruct-q8_0.gguf, 675,710,816 bytes, SHA-256 ca59ca7f13d0e15a8cfa77bd17e65d24f6844b554a7b6c12e07a5f89ff76844e, 291 tensors (F32=121, Q8_0=170).
  • LFM2-350M F16: LiquidAI/LFM2-350M-GGUF@8fdc9d526b7ed346b19257551b05816c7912ecc2, LFM2-350M-F16.gguf, 711,482,304 bytes, SHA-256 379ffdcbf08147c0313f6f1ce7ff558a2bc935eda633f4b46c52347032419c42, 148 tensors (F16=93, F32=55).

Evidence binds exact artifact, import route, tokenizer assets/revisions, graph identity, runtime-package identity, complete logits, 20-step decode, deterministic generation, replay/rollback/non-vacuous batch reorder, ModelPackage save/load, CLI publication, and OGA 0.15.2 execution. The inherited SmolLM runtime record was also refreshed after #641 changed its route identity, with exact real parity and OGA probes rather than accepting a structural fingerprint alone.

Identities

  • Qwen route f7391f2aac9a7617c1c10e397e91b6f31b80bb3c5f338966b46e7d3935246500; graph b0d1814ea69dddd405e30541e9009ba6fb73930f98538921d5c2eaa4a14f5d2c; package cb43c76e1bc3db07a6a3631c7a99e7c47b6891807fecffdb3b70fddd9c108173.
  • LFM2 route c961bba579ea33a2472a7c5d3f469c76f1f8c7aae8440a7eaa86bc6e878a42f4; graph 2a15694cd5ff9f5c9f798feeca91cc41174842065ada80a18b288478725b3342; package 87b8cdd1edc8c5be948716df3efe551f5fc8f96762d7ea3f99b27688ca9f24af.
  • Qwen tokenizer Qwen/Qwen2.5-0.5B-Instruct@a338b55dd21219a5f4da42bc11a9313d1a27d4cc; LFM2 tokenizer LiquidAI/LFM2-350M@73e3c253078a3b97c2e14b4c4665679f4d9b6d56.

Validation

  • Exact Qwen and LFM2 final-main probes: passed.
  • Refreshed SmolLM F16 parity/package and OGA 0.15.2 probes: passed.
  • Refreshed SmolLM2 F16 and Q4/dequantized route probes: passed.
  • Focused evidence/package/tokenizer/YAML gates: 626 passed, 9 deselected.
  • Broad serial non-integration: 8,305 passed, 57 skipped, 12 deselected.
  • Initialized all-files formatter and lint: passed.
  • Direct GPT-5.6 Sol medium evidence/security review: fixed overlapping HF/ORT/OGA lifetimes, added 2x free-space enforcement, tightened Hub-cache symlink containment including parent escapes, aligned the 16 GiB ceiling, and added explicit stale-route fail-closed coverage.

Census and scope

The documentation records the complete 90-route graph-supported census and attempted/blocked candidates. Larger and unsupported routes—including encoder/seq2seq registry gaps, GPT-2 combined-cache ABI, recurrent-state limitations, and candidates lacking an exact immutable <=16 GiB GGUF—remain deferred. No runtime claim is inferred from graph construction alone.

Base: fcd5b3bb42dbc2ca7ca4bc62e9ee502e8446085a (#641). All named artifact, package, graph, and isolated Hub caches were deleted after evidence generation.

justinchuby and others added 2 commits August 25, 2026 21:28
Checkpoint the validated Qwen and LFM2 runtime evidence, tokenizer metadata, state-reorder proof, and 16 GiB artifact census before recovering the interrupted session.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 43bb31ac-c136-44bc-8cdf-70cbcedd4a42
Signed-off-by: Justin Chu <[email protected]>
Bind Qwen, LFM2, and inherited SmolLM evidence to their exact post-#641 import routes. Harden tokenizer cache containment and serialize HF, ORT, and OGA model lifetimes in real probes.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: af2b8208-9638-4f6e-9651-7d3da21c0af8
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 26, 2026 04:45
@github-actions

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing fcd5b3b → 35f9a10

Model Sub-model Changes Status

No architecture changes detected. ✅


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

@github-actions

Copy link
Copy Markdown

Performance Comparison

Comparing fcd5b3b → 35f9a10

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.

@justinchuby
justinchuby merged commit 99cbb5a into main Aug 26, 2026
17 of 26 checks passed
@justinchuby
justinchuby deleted the justinchuby-prove-gguf-runtime-support branch August 26, 2026 04:47

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 promotes two GGUF import routes (qwen2 via Qwen2.5-0.5B-Instruct Q8_0, and lfm2 via LFM2-350M F16) from graph-supported to runtime-supported under the released onnxruntime-genai==0.15.2 contract by adding exact, pinned “runtime evidence” and enforcing it through tests, schema, registry, and documentation.

Changes:

  • Add full “runtime evidence” records for the pinned Qwen2.5 Q8_0 and LFM2-350M F16 GGUF artifacts, and mark qwen2/lfm2 as runtime-supported with those evidence IDs.
  • Expand integration coverage to validate end-to-end runtime packaging + exact-logit parity + state semantics (replay/rollback/reorder) + deterministic OGA decode for the promoted routes.
  • Tighten tokenizer asset handling/validation (Hub-cache symlink containment + deterministic GGUF vocab padding materialization) and extend ORT GenAI compatibility metadata/schema to cover the specialized LFM2 runtime path.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/gguf_small_model_runtime_integration_test.py Adds promoted-route runtime evidence integration test and improves parity checks by capturing full reference logits across decode steps.
testdata/cases/schema.json Raises per-case download budget cap and extends ORT GenAI capabilities schema to allow LFM2 specialized capability sets.
testdata/cases/causal-lm/qwen2.5-0.5b-instruct-q8.yaml New pinned case YAML for promoted Qwen2.5 Q8_0 GGUF runtime evidence enrollment.
testdata/cases/causal-lm/lfm2-350m-f16.yaml New pinned case YAML for promoted LFM2-350M F16 GGUF runtime evidence enrollment.
src/mobius/integrations/ort_genai/auto_export.py Generalizes runtime compatibility metadata generation to support LFM2’s pinned minimum/tested versions.
src/mobius/integrations/ort_genai/auto_export_test.py Adds unit coverage for LFM2 runtime compatibility pinning behavior.
src/mobius/integrations/gguf/_tokenizer.py Hardens local Hub-cache asset resolution and supports deterministic materialization of GGUF vocab padding into tokenizer.json.
src/mobius/integrations/gguf/_tokenizer_test.py Adds tests for non-SmollM pipeline hash-binding, deterministic padding, and Hub-cache symlink containment/escape rejection.
src/mobius/integrations/gguf/_runtime_evidence.py Adds exact runtime evidence records for Qwen2.5 Q8_0 and LFM2-350M F16; refreshes SmolLM route config hash.
src/mobius/integrations/gguf/_runtime_evidence_test.py Extends matching-evidence negative coverage to ensure fail-closed behavior when no unique evidence exists.
src/mobius/integrations/gguf/_docs_test.py Updates expected structured runtime-evidence coverage list to include qwen2 and lfm2.
src/mobius/integrations/gguf/_arch_registry.py Promotes qwen2 and lfm2 runtime status to SUPPORTED with evidence IDs and restriction text.
docs/api/build_from_gguf.md Updates census counts and documents the bounded runtime-evidence census + promoted routes and remaining deferred families.

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

Comment on lines +1053 to +1062
graph_dir = tmp_path / "graph-identity"
graph_dir.mkdir()
for filename in evidence.graph_files:
os.link(output_dir / filename, graph_dir / filename)
graph_identity = gguf_graph_package_identity(graph_dir)
assert graph_identity.files == evidence.graph_files
assert graph_identity.sha256 == evidence.graph_sha256
captured.clear()
del package
gc.collect()
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