Repository navigation
Add masked-diffusion GGUF architecture cohort - #582
Merged
Merged
Conversation
Performance Comparison
|
🏗️ Architecture Diff
No architecture changes detected. ✅ Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
justinchuby
force-pushed
the
justinchuby-add-t5-gguf-cohort
branch
from
August 25, 2026 15:24
072a6de to
05d2809
Compare
Implement exact bidirectional graph, metadata, tensor closure, and quantized import paths for Dream, LLaDA, LLaDA-MoE, and RND1. Preserve architecture-specific Q/K permutation, fused QKV, MoE routing, and shifted-logit semantics while keeping runtime support deferred pending independent parity. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Fail before graph construction when Dream, LLaDA-MoE, or RND1 uses fused QKV while quantization preservation is active. The packed graph has separate Q/K/V targets, so the previous loader path could silently dequantize the fused source and leave packed parameters uninitialized. Cover affine, native-block, and mixed float/quantized sources; retain float and explicit dequantization fused-QKV support; and document why stacked MoE expert tensors do not share this hazard. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 9db6165f-5116-473a-a5d7-1b68fe8ff095 Signed-off-by: Justin Chu <[email protected]>
Construct dense masked-diffusion MLP projections with the active quantized linear factory so the rebased GGUF importer can satisfy the newer packed-consumer contract. Update preflight coverage to patch the shard-aware GGUF opener introduced on main. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Include the four masked-diffusion architectures in the explicit quantized-import policy set introduced on main. Their packed projection execution paths are covered by the focused GGUF tests. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
justinchuby
force-pushed
the
justinchuby-add-diffusion-gguf-cohort
branch
from
August 25, 2026 15:29
b229ff4 to
05b92e0
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new GGUF “masked-diffusion LM” architecture cohort (Dream, LLaDA, LLaDA-MoE, RND1) to Mobius’ GGUF import path, wiring these models to a bidirectional, cache-free masked-diffusion task contract (input_ids -> logits + proposed_tokens) while keeping runtime support explicitly deferred pending parity validation.
Changes:
- Introduces masked-diffusion model classes/config normalization (dense + MoE) and updates the masked-diffusion task to optionally apply llama.cpp-style shifted-logits semantics.
- Extends GGUF architecture registry/config mapping/tensor mapping to enforce mask-token metadata, suffix-exact tensor closure, diffusion-only task dispatch, and fused-QKV handling (including explicit rejection for quantization-preserving imports).
- Expands unit tests and GGUF builder tests/docs to cover diffusion contract validation, tensor closure, Q/K permute behavior, and execution smoke tests.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/build_graph_test.py | Updates graph-IO assertions to accommodate masked-diffusion’s cache-free ABI and extra proposed_tokens output. |
| tests/_test_configs.py | Adds tiny-config coverage entries for dream, llada_moe, and rnd1 (plus alias entries). |
| src/mobius/tasks/_masked_diffusion.py | Adds optional logits shifting before ArgMax proposals to match llama.cpp diffusion alignment. |
| src/mobius/models/llada.py | Adds Dream/LLaDA-MoE/RND1 config normalization and model classes; implements diffusion dense/MoE bidirectional graphs and Q/K norm semantics. |
| src/mobius/models/llada_test.py | Adds tests for HF alias/config normalization, shifted-logits behavior, and MoE diffusion graph execution without cache. |
| src/mobius/models/init.py | Exposes Dream/LLaDA-MoE/RND1 model classes from the public models package. |
| src/mobius/integrations/gguf/_upstream_data/llamacpp_pin.json | Pins diffusion architectures’ tensor families/names for suffix-exact closure. |
| src/mobius/integrations/gguf/_tensor_processors_test.py | Extends Q/K permute expectations for llada vs dream and diffusion MoE variants. |
| src/mobius/integrations/gguf/_tensor_mapping.py | Adds diffusion tensor-family suffix allowlists and fused-QKV mapping recipe; tightens suffix allowlist enforcement. |
| src/mobius/integrations/gguf/_config_mapping.py | Implements diffusion GGUF postprocessors enforcing mask token metadata, activation constraints, bias/fused-QKV consistency, and routing semantics. |
| src/mobius/integrations/gguf/_config_mapping_test.py | Adds diffusion config-extraction tests (defaults, rejection cases, fused/separate bias validation). |
| src/mobius/integrations/gguf/_builder.py | Adds diffusion-only task dispatch checks, fused-QKV split validation/splitting, and rejection for quantization-preserving fused-QKV diffusion imports. |
| src/mobius/integrations/gguf/_builder_test.py | Adds diffusion GGUF build/run tests (float + quantized), fused-QKV split tests, and pre-graph-build rejection tests. |
| src/mobius/integrations/gguf/_arch_registry.py | Registers diffusion architectures/specs with deferred runtime status and explicit validation-pending reasons. |
| src/mobius/integrations/gguf/_arch_registry_test.py | Updates pinned supported-count and adds diffusion architectures to closure and malformed-suffix rejection tests. |
| src/mobius/_registry.py | Registers Dream/LLaDA-MoE/RND1 model types (and aliases) to masked-diffusion task dispatch. |
| src/mobius/_configs/_base.py | Adds mask_token_id and diffusion_shift_logits fields; adjusts DFlash config construction to avoid duplicate mask_token_id kwargs. |
| docs/api/build_from_gguf.md | Documents the masked language-diffusion GGUF contract and deferred runtime rationale/artifact pinning. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dream,llada,llada-moe, andrnd1Architecture decisions
input_ids -> logits + proposed_tokens; timestep, noise schedule, remasking, seed, and iteration policy remain external[Q width, KV width, KV width]; supported affine/native projection and expert quantization is preservedValidation
LLaDA-1.5-Tiny.Q2_K.ggufSHA-256 verified; 57-tensor header census, mask token, and quantized CPU masked forward verifiedThe unfiltered broad suite has two
glm_moe_dsashape/checker failures that reproduce unchanged on the stacked base (072a6de); this PR does not alter that model.