Repository navigation
Preserve original GGUF weights with opset 29 - #827
Conversation
Normalize the upstream indexed_attention spelling to the existing QSA implementation, preserving checkpoint full_attention compatibility. Compare position history at its current indexer-cache owner while retaining support for older Transformers references. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Bind packed and typed GGUF tensors directly to their original external byte ranges. Lower exact layout operations, use grouped expert matmuls where appropriate, and preserve source bindings through optimization and package roundtrips. Remove lossy affine rounding and requantization routes, fail closed on unsupported layouts and floating reparameterization, and refresh the bounded per-format/per-architecture survey. Consolidate obsolete GGUF design documentation. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Performance Comparison
|
🏗️ Architecture Diff
No architecture changes detected. ✅ Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
There was a problem hiding this comment.
🟡 Changes recommended
Packed-package saves and loads fail on supported Python 3.10, and the packed-save path bypasses required weight validation, allowing models with missing initializer weights to be saved.
2 open issues
What changed in this PR
Adds an experimental opset-29 GGUF import path that integrates with Mobius’s existing graph builder while retaining original weight files as ONNX external data. Runtime kernel support remains separate.
Changes:
- Adds exact weight-layout operations, selected-row embedding decoding, and
GroupedMatMulgraphs for ordinary experts. - Removes lossy legacy conversions and adds source-integrity checks and optimization safeguards.
- Updates tests and GGUF documentation, plus Qwen4 attention-label compatibility.
| File | Description |
|---|---|
src/mobius/models/qwen4_exp_test.py |
Tests attention aliases and updated reference cache positions. |
src/mobius/integrations/gguf/_shard_set.py |
Identifies the original shard owning each tensor. |
src/mobius/integrations/gguf/_repacker.py |
Removes lossy repacking and rejects unsupported conversions. |
src/mobius/integrations/gguf/_repacker_test.py |
Replaces lossy-conversion expectations with rejection checks. |
src/mobius/integrations/gguf/_reader.py |
Exposes tensor ownership without reading payloads. |
src/mobius/integrations/gguf/_quant_registry.py |
Restricts legacy routes to supported exact representations. |
src/mobius/integrations/gguf/_quant_registry_test.py |
Updates expected routes and rejection behavior. |
src/mobius/integrations/gguf/_quant_capabilities.py |
Updates capability reporting and evidence references. |
src/mobius/integrations/gguf/_quant_capabilities_test.py |
Verifies revised capability claims. |
src/mobius/integrations/gguf/_packed.py |
Adds external bindings, layout translation, selected-row decoding, and persistence. |
src/mobius/integrations/gguf/_packed_test.py |
Covers formats, parity, integrity, round trips, and optimization protection. |
src/mobius/integrations/gguf/_opset29_survey_test.py |
Validates survey coverage without implying runtime qualification. |
src/mobius/integrations/gguf/_mtp_test.py |
Updates unsupported quantized-head and explicit-float expectations. |
src/mobius/integrations/gguf/_kimi_k3_test.py |
Replaces removed quantized-import expectations with rejection checks. |
src/mobius/integrations/gguf/_granite_test.py |
Tests rejection of an unsupported fused quantized layout. |
src/mobius/integrations/gguf/_docs.py |
Adds survey results to generated capability documentation. |
src/mobius/integrations/gguf/_builder.py |
Wires packed imports and grouped experts into the build pipeline. |
src/mobius/integrations/gguf/_builder_core_test.py |
Removes obsolete lossy-route tests and updates diagnostics. |
src/mobius/integrations/gguf/_builder_architectures_test.py |
Removes expectations for discontinued quantized fallback routes. |
src/mobius/components/_moe.py |
Adds GroupedMoELayer for ordinary bias-free experts. |
src/mobius/components/__init__.py |
Exports the grouped-expert component. |
src/mobius/_optimizations.py |
Protects original external weights from constant folding. |
src/mobius/_model_package.py |
Integrates packed-package save and load handling. |
src/mobius/_configs/_base.py |
Normalizes indexed_attention as Qwen sparse attention. |
docs/design/qwen4-exp-text-core.md |
Explains accepted Qwen attention labels. |
docs/design/gguf-support-proposal.md |
Replaces historical proposals with the current import design. |
docs/api/build_from_gguf.md |
Documents experimental usage, packaging limits, and migration. |
Review effort: Balanced
Preserve missing-weight validation and Python 3.10-compatible source hashing. Gate experimental GGUF tests on installed standard schemas, qualify them in the existing current-ONNX CI job, and fail before source loading when schemas are absent. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Annotate the pytest monkeypatch fixture to avoid version-dependent trailing-comma formatting in CI. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The Gather replacement renames a public graph output, breaking callers that request the original name; preserve the output name and verify it survives binding, saving, and loading.
1 open issue
2 resolved since last review
Review effort: Balanced
Keep the original Gather output name when replacing packed embedding reads, including graph outputs and package roundtrips. Remove the installed-schema prerequisite from construction; schema-aware checking remains separate. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Use explicit standardized packed layouts instead of parsing runtime schema docs during binding. Exercise unavailable schema lookup in the construction regression and conditionally run schema conformance checks in the supported CI leg. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Limit schema skips to checker, optimizer validation, grouped construction and reference execution. Keep per-codec binding and package integrity coverage in released-ONNX jobs. Collect and upload dedicated opset29 coverage and JUnit reports, retaining CI artifacts. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
) Stacked on #827. Extend exact grouped dispatch to ordinary/shared experts and Flash-Next fused expert banks. Add original-byte multi-component/MTP packaging and functional standalone Janus-Pro mmproj conversion. Align LinearAttention with merged independent value heads and optional recurrence trajectories. The capability survey documents remaining specialized-architecture, projector, runtime-fusion and whole-model rollback restrictions; this does not claim universal efficient MoE execution. --------- Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[email protected]>

Keep packed and typed GGUF tensors in their original files as ONNX external data. Use DequantizePacked, exact layout operations, selected-row embedding decoding, and GroupedMatMul for ordinary gated experts.
Remove lossy affine rounding/requantization; unsupported legacy routes and floating reparameterizations now fail explicitly. Consolidate GGUF docs and add a per-format/per-architecture survey.
Current scope is flat, little-endian packages. Runtime kernels, selected-bank fusion, multi-component packaging, and remaining architecture contracts are documented gaps. DequantizePacked-29 addresses the primary representation request in onnx/onnx#8359.