Skip to content

Promote first GGUF text architecture cohort - #677

Merged
justinchuby merged 17 commits into
mainfrom
justinchuby-promote-gguf-text-cohort
Aug 27, 2026
Merged

justinchuby merged 17 commits into
mainfrom
justinchuby-promote-gguf-text-cohort

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Promote five previously immediately-implementable GGUF architecture routes with architecture-owned metadata, tensor, graph, and fail-closed capability contracts:

  • granite: exact dense/MoE union, Granite scaling, optional biases/shared experts, fused/split QKV transforms, tied output, and validated LongRoPE/no-RoPE paths. Packed import remains supported only where the transforms are proven; unmapped YaRN metadata is rejected.
  • jina-bert-v3: dedicated dense RoPE encoder with fused/split QKV closure, post-norm GELU blocks, pooling, singleton token-type transform, and mandatory encoder-only task/cache guards. Unreachable MoE and packed preservation are rejected.
  • maincoder: dedicated post-RoPE learned Q/K RMSNorm decoder with tied output and exact dynamic/static KV semantics. Packed import is rejected.
  • plamo: shared-pre-norm parallel attention/SwiGLU decoder, cyclic 5-to-40-head KV expansion/cache, and inverse converter Q/output shuffles. Packed preservation, static cache, and external weight reuse are rejected.
  • smallthinker: unnormalized-input routing, ReGLU experts, softmax/sigmoid gating normalization, and exact SWA/NoPE/local-RoPE schedules. Non-integral gating enums and unproven routing scales fail closed; packed import and static cache are rejected.

All five routes keep downstream runtime packaging explicitly deferred pending representative real-weight parity. No production routing pins, defaults, or rejects Hugging Face revisions by model_id; revision=None and arbitrary explicit revisions are unchanged. Immutable Maincoder/Jina revisions are test-only. PLaMo/SmallThinker use explicit model-coverage exemptions because their exact semantics are restored only by GGUF metadata postprocessing, not a native HF config alias.

The generated GGUF census/docs now remove these routes from immediately-implementable and record their exact import, quantization, and runtime dispositions.

Review corrections

  • Exclude encoder_fused_qkv from unrelated route fingerprints while retaining it for Jina-v3; regression coverage proves the llama, qwen2, lfm2, and qwen35moe evidence routes are invariant.
  • Add immutable test-only L2 IDs/revisions for Maincoder and Jina-v3; document explicit GGUF-only exemptions for PLaMo and SmallThinker.
  • Add Jina-v3 to the encoder-only guard so static cache and incompatible task overrides fail before task dispatch.
  • Reject Granite YaRN until every serialized parameter, including attn_factor, has an exact mapping.
  • Require SmallThinker gating enums to be finite integers and reject any nonzero expert_weights_scale absent from the pinned loader contract.

Validation

  • Rebased onto origin/main 20a29ed2a935f01ec0cf2fc82939e50bc71dcdea.
  • Five-finding regression selection: 96 passed, 5 skipped.
  • Focused cohort suite: 575 passed, 33 skipped.
  • Exact model coverage: 786 passed, 257 justified skips.
  • Pinned Maincoder/Jina L2 config and full-graph validation: 6 passed.
  • Broad serial non-integration suite: 8,703 passed, 64 skipped, 12 deselected.
  • Generated GGUF docs/registry suite: 1,146 passed, 1 skipped.
  • Full lintrunner formatting/lint and git diff --check pass.
  • Configured mypy was rerun; it reports the repository's existing type-error baseline, with no diagnostic on a changed line. The new route modules retain their prior targeted type-check evidence.
  • Independent review of the complete correction diff found no significant issues.

Artifact budget and cleanup

Recorded bounded artifact/source reads total at most 34,042,487 bytes plus small metadata responses, far below the 16 GiB limit. Only two 16 MiB GGUF ranges were read (Maincoder and JinaBERT-v3); Granite, PLaMo, and SmallThinker downloaded no model payloads. The correction pass downloaded config-only L2 metadata, not model weights. Sparse headers, pinned source scratch files, transient outputs, caches, and temporary packages were deleted. No .gguf, .onnx, .safetensors, or model .bin payload remains in the worktree.

Deferred evidence / waivers

  • Representative real-weight full-logit prefill/cached-decode parity and deterministic generation remain deferred for all five routes; suitable immutable artifacts either exceed the per-route budget or were not required to prove the narrowed import contract.
  • ORT GenAI/runtime packaging, CUDA/DML, L4/L5 goldens, and deployment claims remain deferred.
  • JinaBERT-v3, Maincoder, PLaMo, and SmallThinker native packed quantization remain rejected. Granite packed import is covered by synthetic packed graph/value evidence, not a real-weight runtime parity claim.
  • PLaMo’s smallest immutable public GGUF is 4,910,733,280 bytes, above the 3 GiB route ceiling, so no payload was downloaded.

@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 27, 2026 15:53
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing b0fb5af → b592189

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 promotes the first cohort of GGUF text(-adjacent) architectures from “immediately implementable” to implemented, by adding architecture-owned config/tensor/graph contracts and wiring them through the GGUF build pipeline and registries (while keeping runtime packaging explicitly deferred pending real-weight parity).

Changes:

  • Add exact graph/model implementations and task wiring for PLaMo, Maincoder, and SmallThinker GGUF routes; extend Granite handling and add JinaBERT-v3 GGUF encoder support.
  • Enforce fail-closed GGUF metadata/tensor/qtype closure validation for the new routes and add synthetic/contract tests.
  • Update GGUF census pins and docs to reflect the promoted routes and their supported/deferred/rejected capability dispositions.

Reviewed changes

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

Show a summary per file
File Description
tests/gguf_plamo_parity_test.py Adds synthetic prefill + cached-decode parity test for the exact PLaMo GGUF graph.
tests/_test_configs.py Extends tiny test config matrix to cover promoted GGUF routes (maincoder/smallthinker/jina-v3/plamo).
src/mobius/tasks/_plamo.py Introduces a dedicated PLaMo causal-LM task selecting dynamic cache behavior.
src/mobius/tasks/_causal_lm.py Adds a dedicated SmallThinker GGUF causal-LM task with dynamic concat-grow KV ABI.
src/mobius/tasks/init.py Exposes new tasks and adds task-name dispatch entries for SmallThinker GGUF and PLaMo.
src/mobius/models/smallthinker.py Implements the exact SmallThinker GGUF decoder (router/experts/schedule) as a CausalLMModel.
src/mobius/models/maincoder.py Implements Maincoder’s post-RoPE Q/K norm attention ordering and tied-head causal LM.
src/mobius/models/granite.py Adjusts Granite text model construction (quantized linear selection; optional RoPE path).
src/mobius/models/gguf_plamo.py Adds exact PLaMo decoder model with cyclic KV expansion, RoPE, and caching behavior.
src/mobius/models/gguf_encoders.py Extends specialized GGUF encoders with JinaBERT-v3 support (post-norm + seq GELU).
src/mobius/models/init.py Exports newly added model classes (PLaMo/Maincoder/SmallThinker/JinaBERT-v3).
src/mobius/integrations/gguf/_upstream_data/llamacpp_pin.json Pins/records exact llama.cpp tensor inventory for JinaBERT-v3.
src/mobius/integrations/gguf/_tensor_processors.py Adds PLaMo-specific inverse shuffles for Q and output projections after conversion.
src/mobius/integrations/gguf/_tensor_mapping.py Adds mapping tables for PLaMo, SmallThinker, and JinaBERT-v3 GGUF tensor→HF names.
src/mobius/integrations/gguf/_specialized_encoders_test.py Adds JinaBERT-v3 contract, closure, and synthetic execution tests.
src/mobius/integrations/gguf/_smallthinker_test.py Adds SmallThinker tensor-contract, config restoration, and module-level functional tests.
src/mobius/integrations/gguf/_route_census_test.py Updates expected route-census category counts after promotions.
src/mobius/integrations/gguf/_plamo_test.py Adds PLaMo contract/config/mapping/value-transform validation tests.
src/mobius/integrations/gguf/_maincoder_test.py Adds Maincoder pinned-profile tests, closure validation, and synthetic ORT execution checks.
src/mobius/integrations/gguf/_granite_test.py Adds Granite exactness tests for dense/MoE unions, scaling, and LongRoPE factor handling.
src/mobius/integrations/gguf/_conventional_decoder_test.py Removes “conventional decoder mismatch” expectations for newly-promoted routes.
src/mobius/integrations/gguf/_config_mapping.py Adds/extends GGUF config postprocessors for SmallThinker, Granite, PLaMo, Maincoder, and JinaBERT-v3.
src/mobius/integrations/gguf/_config_mapping_test.py Adds regression test ensuring non-integer gating metadata fails closed for LFM2MoE.
src/mobius/integrations/gguf/_builder.py Wires new fail-closed tensor-contract validators and task restrictions into GGUF build.
src/mobius/integrations/gguf/_builder_test.py Updates builder test expectations to reflect promotion of SmallThinker route.
src/mobius/integrations/gguf/_arch_registry.py Promotes new GGUF architecture specs (plamo/maincoder/granite/jina-v3/smallthinker) with dispositions.
src/mobius/integrations/gguf/_arch_registry_test.py Updates supported-architecture counts and promoted conventional decoder set.
src/mobius/_registry.py Registers new model_types (maincoder/gguf_plamo/smallthinker_gguf/jina_bert_v3_gguf) for build dispatch.
src/mobius/_configs/_base.py Adds encoder_fused_qkv config field for JinaBERT-v3 fused-vs-split attention selection.
docs/api/build_from_gguf.md Updates published GGUF support census counts and route classifications.

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

Comment thread tests/gguf_plamo_parity_test.py Resolved
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing b0fb5af → b592189

Model Sub-model Changes Status
bert (feature-extraction) model 0 ⚪
falcon model 0 ⚪
gemma2 model 0 ⚪
gemma4 (gemma4) decoder 0 ⚪
gemma4 (gemma4) embedding 0 ⚪
gemma4 (gemma4) vision_encoder 0 ⚪
gemma4_text model 0 ⚪
gpt2 model 0 ⚪
llama model 0 ⚪
llama (static-cache) model 0 ⚪
mamba (ssm-text-generation) model 0 ⚪
phi3 model 0 ⚪
phi3 (static-cache) model 0 ⚪
qwen model 0 ⚪
qwen (static-cache) model 0 ⚪
qwen2 model 0 ⚪
qwen2 (static-cache) model 0 ⚪
qwen2_moe model 0 ⚪
qwen2_moe (static-cache) model 0 ⚪
qwen3 model 0 ⚪
qwen3 (static-cache) model 0 ⚪
qwen3_5_moe (hybrid-text-generation) model 0 ⚪
qwen3_5_text (hybrid-text-generation) model 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) decoder 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) embedding 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) vision_encoder 0 ⚪
qwen3_moe model 0 ⚪
qwen3_moe (static-cache) model 0 ⚪
qwen3_next (hybrid-text-generation) model 0 ⚪
t5 (seq2seq) decoder 0 ⚪
t5 (seq2seq) encoder 0 ⚪
whisper (speech-to-text) decoder 0 ⚪
whisper (speech-to-text) encoder 0 ⚪

No architecture changes detected. ✅


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

@justinchuby
justinchuby force-pushed the justinchuby-promote-gguf-text-cohort branch from d6a3380 to 2a081ad Compare August 27, 2026 18:23
justinchuby added a commit that referenced this pull request Aug 27, 2026
Preserve both the sharded-import errno dependency from #675 and the cohort fingerprint dataclass dependency after rebasing PR #677.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchuby-promote-gguf-text-cohort branch from 2a081ad to e3ac351 Compare August 27, 2026 18:25
justinchuby and others added 17 commits August 27, 2026 12:47
Implement a dedicated Maincoder decoder that applies adjacent-pair RoPE before learned per-head Q/K RMSNorm and preserves tied-output, sequential SwiGLU, and KV-cache semantics.

Promote only explicit float GGUF import with strict metadata, tensor-shape, qtype, and suffix closure validation. Keep packed quantization rejected and runtime support deferred pending independent evidence.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Implement the pinned dense JinaBERT-v3 tensor, config, RoPE attention, post-norm residual, sequential GELU, pooling, and singleton token-type contracts. Fail closed on the unreachable MoE schedule, packed quantization, classifier heads, malformed tensor unions, and runtime packaging claims.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Implement the source-level shared-pre-norm parallel decoder, cyclic expanded-KV cache contract, fixed converter metadata and tensor closure, and inverse Q/output projection shuffles. Reject packed shuffle preservation, static cache, external weight reuse, and unsupported variants before export while keeping runtime support deferred.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Promote the canonical granite architecture with strict dense-or-MoE tensor closure, fused and split QKV processing, Granite scaling, optional biases, shared experts, tied output, and tensor-backed LongRoPE.

Reject unsupported deep-stack inputs, single-factor RoPE, malformed layouts, and unsupported scaling variants while leaving real-weight runtime validation explicitly deferred. Add focused graph, config, tensor-value, quantized-path, and negative tests.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Register a representative reduced PLaMo configuration so the promoted GGUF model participates in L1 graph construction and registry completeness checks.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Implement SmallThinker's pre-norm routing, ReGLU experts, metadata-selected gating, and per-layer sliding-attention and RoPE schedules. Add strict tensor and qtype closure, a dedicated dynamic-cache task, and fail-closed quantization/runtime capabilities with focused graph and synthetic execution coverage.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Regenerate the authoritative route census for all five promotions, remove the stale Maincoder blocker, and cover PLaMo in L1 graph construction. Fix Granite no-RoPE graph construction and tighten required RoPE/cache invariants for Maincoder and PLaMo.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Keep architecture-qualified fail-closed errors after sharing the expert-gating validation path with SmallThinker, and cover the non-integer metadata case.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Preserve established runtime-evidence fingerprints while retaining Jina fused-QKV semantics, enforce encoder-only Jina dispatch, and fail closed on unsupported Granite YaRN and SmallThinker routing metadata. Add pinned L2 coverage where the native config route is exact and explicit GGUF-only exemptions otherwise.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Preserve the batch axis in the independent causal-mask oracle and add two-row full-logit ORT parity coverage so the reference cannot pass only by coincidence at batch size one.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Reject Granite LongRoPE until its serialized attention factor can be represented exactly, close unsupported modern and legacy RoPE metadata for the affected cohort routes, and avoid constructing an attention bias from a missing static-cache mask. Add mutation and ORT-load regressions and synchronize generated GGUF support docs.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Close standalone Granite attention-factor metadata, record merged PR #651 in the authoritative route census, and regenerate deterministic GGUF support documentation after rebasing the cohort.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Preserve both the sharded-import errno dependency from #675 and the cohort fingerprint dataclass dependency after rebasing PR #677.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Derive Granite routed expert width from feed_forward_length exactly, reject contradictory serialized expert widths without lossy numeric conversion, and reconcile the authoritative route census with closed #652 plus merged #656 and #675.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Restore strict DBRX tensor closure, isolate architecture-specific graph fingerprint fields, and reconcile post-merge route/model coverage counts. Add explicit GGUF-only coverage dispositions for the merged MoE cohort.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Apply repository lint formatting to the architecture-specific fingerprint map and its regression assertion.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Reject DBRX head geometries that cannot satisfy grouped-query attention and lock Jina-v3 explicit feature extraction to the pooled GGUF output ABI with builder regressions.

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

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchuby-promote-gguf-text-cohort branch from e3ac351 to b592189 Compare August 27, 2026 20:34
@justinchuby
justinchuby merged commit e8f1ad0 into main Aug 27, 2026
22 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-promote-gguf-text-cohort branch August 27, 2026 20:51
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