Repository navigation
Support complete sharded GGUF imports - #652
justinchuby wants to merge 1 commit into
Conversation
Assemble strict local shard sets as one lazy logical GGUF model and resolve Hub sets at an immutable revision with cache-aware capacity preflight. Preserve quantized tensor paths, deterministic metadata, runtime identity hashing, and single-file behavior. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Performance Comparison
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds first-class support for split (multi-shard) GGUF models across local files and Hugging Face Hub references, including stricter shard-set validation and stable artifact identity hashing.
Changes:
- Extend sharded GGUF assembly/validation (container compatibility checks, deterministic merged metadata, tensor source routing).
- Add Hugging Face Hub shard-set resolution/download that pins an immutable commit, preflights cache space, and blocks incomplete sets.
- Update runtime evidence to hash “identity paths” (regular-file blob targets) while preserving logical shard filenames.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mobius/integrations/gguf/_shard_set.py | Adds merged metadata, container compatibility validation, tensor source helpers, and identity-path plumbing for shard sets. |
| src/mobius/integrations/gguf/_builder.py | Implements Hub shard-set selection, pinned complete-set downloads with free-space preflight, and binds shard identity paths for evidence hashing. |
| src/mobius/integrations/gguf/_runtime_evidence.py | Hashes shard “identity paths” (regular files) while incorporating logical shard filenames into the digest. |
| src/mobius/integrations/gguf/_reader.py | Exposes _tensor_source() to support per-tensor parsing against the owning file/offset. |
| src/mobius/integrations/gguf/_shard_set_test.py | Adds tests for metadata-only first shard, split metadata mismatches, and Hub shard resolution behavior. |
| src/mobius/integrations/gguf/_runtime_evidence_test.py | Adds test coverage for identity hashing with snapshot symlinks resolving to blob files. |
| src/mobius/integrations/gguf/_builder_test.py | Adds sharded quantized build coverage and updates incomplete-shard Hub failure expectations. |
| src/mobius/integrations/gguf/_docs.py | Documents split GGUF behavior and Hub pinning/preflight guarantees. |
| src/mobius/integrations/gguf/init.py | Updates public example usage to include local and Hub shard references. |
| docs/api/build_from_gguf.md | Mirrors docs update for split GGUF and Hub shard resolution behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
## 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
## Stack - Depends on #655 (`justinchuby-finish-qwen4exp-core`). - Includes the sharded GGUF importer commit from #652 (`eacf244864284cc96bd70f1187b145446783aab4`) so the three-file artifact is evaluated as one complete model. ## Summary - register `general.architecture=qwen4exp` as `qwen4_exp_text` with the exact Qwen3.8 Flash-Next config, DeltaNet/QSA schedule, hyper-connections, PLE, routed/shared MoE, and output HC mixer metadata - pin `unsloth/Qwen3.8-Flash-Next-GGUF@d3bc75ee6ccef3efc1e228ec00a6cc2cdb1e2249`, all three shard sizes/LFS SHA-256 identities, and the metadata-only shard-0 closure `0 + 595 + 629 = 1224` - map every GGUF tensor family, including GGUF split indexer Q/K rows reconstructed exactly into Hugging Face's fused `index_qk_proj` - validate every tensor name, logical shape, and dynamic qtype using the complete bounded-header manifest digest `25a1e6a2073caf19d3a3835dd23702a19fa09cc651506e11a13de7b48076359d` - preserve existing official fused HF indexer checkpoints while accepting only the exact GGUF split representation on the GGUF path - fail closed before Hub payload download when header policy cannot be established, source/revision/shard identity differs, or either payload mode is requested ## Fail-closed payload policy The only published `UD-IQ1_S` route is intentionally not emitted as an executable ONNX payload: - `per_layer_token_embd.weight` is an enormous IQ4_NL embedding with no compatible native gather ABI - rank-3 routed expert banks dynamically mix IQ1_S/IQ2_XXS gate/up with IQ4_NL down tensors; released runtime evidence does not establish a matching mixed-format sparse native-block MoE ABI - these tensors are not ordinary affine rank-2 `MatMulNBits` - float32 dequantization would materialize roughly 191 GiB for the PLE table alone, exceeding the bounded 8 GiB single-tensor policy The exact header/config/mapping support is therefore a truthful preflight foundation for future ABI work, not a quantized-runtime claim. ## Validation - targeted Qwen4Exp/GGUF/registry review suite: `1187 passed, 2 skipped` - complete GGUF + Qwen4Exp + graph serial suite: `4865 passed, 54 skipped` - broad serial non-integration suite: `8409 passed, 64 skipped, 12 deselected, 1 subtest passed` - `lintrunner f --output oneline --all-files && lintrunner -a`: clean - GPT-5.6 Sol medium review run twice; fused-HF compatibility, complete qtype evidence, config pinning, and Hub fallback findings were resolved ## Waivers - No full payload download, real-weight runtime execution, L4, or L5 claim is made for the GGUF route. The exact pinned artifact is deliberately rejected before its 72+ GB payload is downloaded because neither supported native preservation nor bounded dequantization is truthful under the current Mobius/ORT ABI. - Runtime support remains deferred. This PR must not be interpreted as ORT or ORT GenAI execution evidence for the quantized artifact. --------- Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[email protected]>
|
Closing as superseded by the sharded GGUF implementation and subsequent hardening that landed through the Qwen4Exp/mainline work. The unresolved Copilot findings are being audited against current main; any still-applicable gaps will be fixed in a focused follow-up rather than merging this conflicting historical branch. |
## Summary - resolve local sharded-GGUF symlinks to their verified regular-file targets before artifact identity hashing, while retaining logical shard filenames in the digest - make missing `split.count`, `split.no`, and `split.tensors.count` diagnostics deterministic - add regressions covering the `build_from_gguf` symlink path, artifact hashing, missing targets, and reversed shard ordering This follows up on the still-applicable Copilot findings from #652 after its sharded import functionality was superseded on `main` by #656. ## Validation - `python -m pytest src/mobius/integrations/gguf/_shard_set_test.py -q --tb=short` (51 passed) - `python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q -k "not phi4mm and not apply_weights_unknown" --tb=short -n auto` (8627 passed, 64 skipped) - `lintrunner f --output oneline --all-files` - independent code review: no findings --------- Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[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]>
Summary
split.no, matchingsplit.countandsplit.tensors.count, compatible metadata/container properties, tensor extents, and unique tensor namesTests
python -m pytest src/mobius/integrations/gguf/_reader_test.py src/mobius/integrations/gguf/_shard_set_test.py src/mobius/integrations/gguf/_preflight_test.py src/mobius/integrations/gguf/_runtime_evidence_test.py src/mobius/integrations/gguf/_builder_test.py -q --tb=short(538 passed)python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q -k 'not phi4mm and not apply_weights_unknown' --tb=short(8,362 passed, 57 skipped, 12 deselected)lintrunner f --output oneline --all-fileslintrunner -aAll shard coverage uses tiny generated GGUF files and mocked Hub metadata/download boundaries. The motivating multi-gigabyte artifact was not downloaded.