Skip to content

Audit all GGUF tokenizer routes - #645

Merged
justinchuby merged 1 commit into
mainfrom
justinchuby-audit-all-gguf-tokenizers
Aug 26, 2026
Merged

justinchuby merged 1 commit into
mainfrom
justinchuby-audit-all-gguf-tokenizers

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • add a public, machine-readable census for all 87 pinned tokenizer.ggml.pre identifiers and aliases across 56 semantic groups
  • promote exact artifact-scoped tokenizer evidence for Qwen3.5, Qwen2.5, LFM2, and SmolLM, including ordered token/merge/type hashes, source assets, special IDs, representative encodings, padding constraints, and final materialized hashes
  • generate concise drift-checked docs with 4 validated pinned-source routes and 83 concrete compiled-llama.cpp semantic blockers; tokenizer evidence remains independent from graph/runtime support

Validation

  • initialized all-files lint; all checks pass
  • focused tokenizer/docs suite: 71 passed
  • broad non-integration serial suite: 8331 passed, 57 skipped, 12 deselected
  • direct GPT-5.6 Sol medium review completed; scores-only tokenizer evidence support was added from review

Serialized remaining batches

  1. Alias cohorts (38): a.x-4.0, bailingmoe, bailingmoe2, chatglm-bpe, cohere2moe, deepseek-r1-qwen, exaone4, f2llmv2, falcon-h1, falcon3, gemma4, gigachat, glm4, gpt-2, gpt-4o, granite-embed-multi-311m, jina-de, jina-es, jina-v1-en, jina-v2-code, jina-v2-de, jina-v2-es, jina-v5-nano, kanana2, kormo, llada-moe, llama-bpe, llama-v3, llama3, llama4, mellum, midm-2.0, modern-bert, phi-2, pixtral, roberta-bpe, talkie, tiny_aya.
  2. Singleton cohort A (23): afmoe, bloom, chameleon, codeshell, command-r, dbrx, deepseek-coder, deepseek-llm, deepseek-v3, default, exaone, exaone-moe, falcon, gpt3-finnish, granite-docling, granite-embed-multi-97m, grok-2, hunyuan, hunyuan-dense, jais, jais-2, joyai-llm, kimi-k2.
  3. Singleton cohort B (22): laguna, megrez, mellum2, minerva-7b, minicpm5, minimax-m2, mpt, olmo, poro-chat, refact, sarvam-moe, seed-coder, smaug-bpe, solar-open, stablelm2, starcoder, superbpe, tekken, trillion, viking, whitespace, youtu.

Generate an exact machine-readable disposition for all 87 pinned tokenizer pre identifiers and aliases. Promote artifact-scoped Qwen2, Qwen3.5, LFM2, and SmolLM tokenizer materialization with ordered vocabulary, merges, token types, source assets, special IDs, representative encodings, and final tokenizer hashes. Keep graph and runtime support independent and document every remaining compiled-semantics blocker.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 26, 2026 05:41
@justinchuby
justinchuby merged commit cafb2f2 into main Aug 26, 2026
17 of 24 checks passed
@justinchuby
justinchuby deleted the justinchuby-audit-all-gguf-tokenizers branch August 26, 2026 05:41
@github-actions

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 9eaf20e → 15db40d

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 9eaf20e → 15db40d

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.

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 the GGUF integration’s tokenizer auditing surface by (1) expanding “tokenizer evidence” to bind more GGUF tokenizer semantics (including tokenizer.ggml.pre, token types, and optional scores), and (2) adding a public, registry-derived census that assigns every pinned tokenizer.ggml.pre identifier/alias an explicit disposition. It also updates the generated GGUF docs to reflect the new evidence/census reporting and expands tests accordingly.

Changes:

  • Extend GGUFTokenizerEvidence with pre_identifier, token-type digests, and optional score semantics; add iter_tokenizer_evidence() and strengthen evidence matching.
  • Add tokenizer_route_census() + GGUFTokenizerRouteAudit as a machine-readable census for all pinned tokenizer pre identifiers and aliases.
  • Update GGUF docs generation + snapshot docs, and expand tests to validate the first evidence batch and census completeness.

Reviewed changes

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

Show a summary per file
File Description
src/mobius/models/talkie_test.py Formatting-only adjustments in existing Talkie tests.
src/mobius/integrations/gguf/_tokenizer_evidence.py Expand tokenizer evidence schema and matching; add iter_tokenizer_evidence().
src/mobius/integrations/gguf/_tokenizer_evidence_test.py Add tests for evidence batching, scores-vs-merges schema rules, and census completeness.
src/mobius/integrations/gguf/_tokenizer_census.py New registry-derived census API for all tokenizer pre identifiers/aliases.
src/mobius/integrations/gguf/_docs.py Update docs summary/matrix and render multiple tokenizer evidence rows.
src/mobius/integrations/gguf/_docs_test.py Update docs expectations for the expanded tokenizer evidence and dispositions.
src/mobius/integrations/gguf/init.py Export the new census types/functions from the public GGUF integration API.
docs/api/build_from_gguf.md Regenerated API docs reflecting the updated tokenizer evidence and census matrix.

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

Comment on lines 491 to +494
and evidence.merge_count == merge_count
and evidence.ordered_merges_sha256 == merges_sha256
and evidence.ordered_merges_sha256 == (merges_sha256 or None)
and evidence.score_count == score_count
and evidence.ordered_scores_sha256 == (scores_sha256 or None)
Comment on lines +328 to +336
proof = (
f"metadata `{evidence.tokenizer_metadata_sha256}`<br>"
f"tokens {evidence.token_count:,} `{evidence.ordered_vocabulary_sha256}`<br>"
f"merges {evidence.merge_count:,} `{evidence.ordered_merges_sha256}`<br>"
f"types `{evidence.ordered_token_types_sha256}`; scores={evidence.score_count}<br>"
f"source IDs `0..{evidence.source_token_count - 1}`; {padding}; "
f"rows={evidence.embedding_vocabulary_size:,}<br>"
f"materialized `{evidence.materialized_tokenizer_sha256}`<br>{encodings}"
)
justinchuby added a commit that referenced this pull request Aug 26, 2026
## Summary

- pin the exact `llama-vocab.cpp` source identity, dispatch line,
pre-type, and flag overrides for all 38 batch-2 tokenizer identifiers
- add an exact GPT-2 GGUF-to-official-source tokenizer witness and share
evidence only across identifiers with mechanically checked identical
pinned dispatch behavior
- promote 22 requested routes and keep 16 fail-closed with the concrete
`pinned-artifact-source-parity-pending` blocker
- add a deterministic 38-identifier fixture, network-free evidence
tests, and generated API documentation

## Proven identifiers (22)

`a.x-4.0`, `deepseek-r1-qwen`, `exaone4`, `f2llmv2`, `falcon-h1`,
`falcon3`, `gigachat`, `gpt-2`, `jina-de`, `jina-es`, `jina-v2-de`,
`jina-v2-es`, `jina-v5-nano`, `kormo`, `llama-bpe`, `llama-v3`,
`llama3`, `mellum`, `midm-2.0`, `modern-bert`, `phi-2`, `pixtral`

## Artifact-blocked identifiers (16)

`bailingmoe`, `bailingmoe2`, `chatglm-bpe`, `cohere2moe`, `gemma4`,
`glm4`, `gpt-4o`, `granite-embed-multi-311m`, `jina-v1-en`,
`jina-v2-code`, `kanana2`, `llada-moe`, `llama4`, `roberta-bpe`,
`talkie`, `tiny_aya`

Their pinned dispatch semantics are proven, but no exact qualifying
GGUF-to-official-source tokenizer parity record was established in this
batch. The next coherent sub-batch is `jina-v1-en` / `jina-v2-code` /
`roberta-bpe`, using a pinned Jina/RoBERTa GGUF witness and official
tokenizer assets.

## Validation

- `lintrunner f --output oneline --all-files`
- focused tokenizer/docs tests: 74 passed
- broad serial non-integration suite: 8,334 passed, 57 skipped, 12
deselected
- direct GPT-5.6 Sol medium review; fixed deferred-route docs to expose
exact pinned dispatch lines

This PR is based directly on `main` at PR #645 merge
`cafb2f2460eb47b984cf4731314246792059f625`. Tokenizer evidence is
intentionally independent of graph/runtime support.

Signed-off-by: Justin Chu <[email protected]>
justinchuby added a commit that referenced this pull request Aug 27, 2026
## Summary

- classify every unresolved authoritative GGUF architecture, projector,
tokenizer, MTP, and speculative-draft route exactly once
- generate concrete implementation, evidence, ABI/dependency, artifact,
and rejection batches from live registries
- preserve exact registry reasons in machine-readable census records and
reconcile PRs #645, #651, #652, and #656 without claiming open work as
supported
- distinguish ordinary runtime evidence from ORT GenAI
heterogeneous-state schema issue #605
- pin availability-only F16/Q8_0 sidecar identities for LFM2-VL and
Pixtral without implying tensor closure, graph parity, or runtime
support

## Census

- 285 unresolved routes: 144 architectures, 60 projectors, 57
tokenizers, 22 MTP routes, and 2 draft routes
- 67 immediately implementable
- 95 evidence-only
- 100 dependency/runtime-ABI blocked
- 4 artifact unavailable
- 19 intentionally rejected

## Validation

- generated documentation check
- 1,371 focused GGUF tests passed, 1 skipped
- broad deterministic suite: 8,467 passed, 62 skipped, 1 subtest passed
- Ruff/format lint passed
- strict mypy passed for changed source modules
- independent incremental review found no significant issues

## Waivers

- no large model payloads downloaded; availability pins use immutable
repository revisions plus API-reported LFS SHA-256 and byte size
- open PRs #651/#652/#656 are dependency records only and are not
promoted as current-main capability
- no unsupported cache/state ABI is forced; packed quantized support
remains governed by existing fail-closed capability records

Do not merge yet.

---------

Signed-off-by: Justin Chu <[email protected]>
Copilot-Session: d1a98adf-88cb-471b-8c46-7a84083db24c
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