Repository navigation
Fuse GLM native-block routed experts into sparse pkg.nxrt::BlockQuantizedMoE (+ build_from_gguf wiring) - #591
Conversation
…zedMoE Rewrite a dense-fallback GGUF/native-block MoE (each routed expert its own gate/up/down BlockQuantizedMatMul, masked after the fact) into a single sparse top-k pkg.nxrt::BlockQuantizedMoE that reads only the selected experts' native blocks. - Reuses the IQ/native blocks byte-for-byte (expert-major stack/concat, no dequant/requant); there are no scales or zero-points to carry. - Expresses GLM-5.2 UD-IQ1 mixed per-projection formats (gate/up in one native format, down in another) via block_layout_version=2 and fc1/fc2/fc3_format; a uniform-format layer stays on v1. - Reconstructs routing gate-agnostically from the graph's selected_experts / routing_weights tensors: a [tokens,experts] one-hot mask feeds router_logits and the scattered per-expert weights feed router_weights with normalize_routing_weights=0, so softmax / sigmoid+bias+scaling gates all fuse. Verified correct against both the CPU oracle and the CUDA route kernel (both gather router_weights at the selected experts). - Property-gated and fails closed with a typed reason (mixed formats across experts, biased experts, incomplete/untraceable groups); never silently dense-evaluates every expert. Shared expert preserved. Structural + byte-preservation + routing-reconstruction tests included; numeric parity lives in the onnx-genai Rust CPU oracle. Co-authored-by: Copilot <[email protected]>
Independent review found that the fusability check only verified the traced expert ids were gap-free (ids == range(len(ids))). A dropped highest-id expert leaves survivors 0..E-2, which still looks contiguous, so the layer would fuse an expert bank narrower than the router selects over -- leaving ScatterElements to index out of bounds. Record the full declared-id set from the per-expert Equal masks up front and require every declared expert to be fully traced; otherwise fail closed and keep the dense graph. Add regression tests for a dropped trailing expert and for an expert wired to a non-shared routing-weights tensor. Co-authored-by: Copilot <[email protected]>
…e_moe Integrate with the sparse-MoE honesty gate merged in #581. The fusion now uses the shared mobius.integrations.gguf.SparseMoEExportError instead of a private best-effort skip: a routed native-block MoE that cannot be collapsed into one expert-major bank (mixed native formats, per-expert bias, incomplete/untraceable expert group, ragged shapes) fails closed by default, matching build_from_gguf's gate. allow_dense_moe (defaulting to the MOBIUS_ALLOW_DENSE_MOE_EXPERTS flag) downgrades the abort to a loud warning that keeps the runnable dense fallback. Split _fuse_layer into a pure _plan_layer (all validation + byte-stacking, no graph mutation) and _emit_layer, and run the driver in two passes so every candidate is validated before any node is emitted -- a fail-closed layer never leaves the graph half-rewritten. A selector with no native-block experts is still skipped silently (e.g. int4 MatMulNBits MoE). SparseMoEExportError / _flags are imported lazily so the generic rewrite_rules layer keeps no import-time edge into the GGUF export stack. Update fail-closed tests to assert the typed error + untouched graph, and add an allow_dense_moe opt-in test. Co-authored-by: Copilot <[email protected]>
Collapse GLM-style routed native-block expert storms into one sparse top-k pkg.nxrt::BlockQuantizedMoE per layer at the single post-export authority point in build_from_gguf, and fail closed honestly when the target runtime cannot represent the layer. Rewrite (fuse_block_quantized_moe): * Add a perproj_v2_runtime capability flag. A layer that mixes native block formats across its fc1/fc2/fc3 banks (GLM-5.2 UD-IQ1: iq1 gate/up + a higher-bit down) can only be expressed with the block_layout_version=2 per-projection ABI. When the runtime does not implement v2, _plan_layer now fails closed (typed reject) before any graph mutation instead of emitting an unrunnable v2 node. The rewrite is a pure transform, so the flag defaults to True; the GGUF export authority passes the real runtime capability. Builder integration (build_from_gguf): * Move the sparse-MoE honesty gate from the pre-export torch-module level to the final graph state. The pre-export gate call is removed (it would reject the very layers the fusion can now collapse); Batty's gate functions stay defined for their direct unit tests. New step 9b runs after pkg.apply_weights (once every native block carries real packed bytes): _fuse_native_block_moe collapses the routed storm byte-for-byte, then _assert_sparse_moe_graph is a backstop that fails closed on any surviving routed per-expert BlockQuantizedMatMul storm. allow_dense_moe (default False) warns + retains the dense fallback with no throughput claim. * _perproj_bqmoe_v2_runtime_available gates v2 emission on MOBIUS_ENABLE_BQMOE_PERPROJ_V2 (default False) so mixed-format GLM-5.2 layers typed-reject until the onnx-genai v2 runtime ABI ships rather than overclaim. Tests: * Rewrite unit tests for the v2-runtime gate (uniform fuses without v2; mixed typed-rejects without v2; mixed emits v2 when opted in). * New builder-integration suite exercises the step 9b helpers on synthetic exported packages (default fail-closed, v2 opt-in, dense retention, byte-preserving banks, deterministic external data, final-state backstop) and drives five end-to-end build_from_gguf builds on synthetic native-block MoE GGUFs (qwen3_moe / qwen2_moe): uniform -> one BlockQuantizedMoE + no storm; mixed -> SparseMoEExportError; mixed + v2 opt-in -> one v2 node; allow_dense_moe -> dense storm retained; shared expert stays dense. Co-authored-by: Copilot <[email protected]>
Performance Comparison
|
Independent review verdict — PR #591 (native-block routed MoE → one
|
…verclaim Reviewer revision (Gaff REJECT-WITH-REVISION on #591): the block_layout_version=2 opt-in was a bare environment flag wired into the production export path, so MOBIUS_ENABLE_BQMOE_PERPROJ_V2=1 could make build_from_gguf emit a v2 node the current runtime cannot execute while still reporting a green build. No shipped onnx-genai runtime implements the per-projection v2 ABI and there is no typed runtime-capability handshake yet, so v2 must never be reachable from production. Honesty fix (narrow; approved fusion/builder behavior unchanged): * Remove _perproj_bqmoe_v2_runtime_available() and the now-unused os import. The production authority path (_fuse_native_block_moe) no longer enables v2 at all: a mixed-format layer always typed-rejects with SparseMoEExportError. The env var is retired and has no effect on any build. * Flip the public fuse_block_quantized_moe default from perproj_v2_runtime=True to fail-closed, and rename the parameter to the private, test-only _allow_perproj_v2_schema (default False). A direct public caller now rejects a mixed-format v2 layer by default; the only way to emit a v2 node is an explicit schema-construction test opt-in, unreachable from the builder, CLI, or environment, and the node it builds is schema-only and never runnable. * Update the _plan_layer reject message: no env override; v2 stays a schema-construction test path until a typed runtime-capability handshake ships. Tests: * New: setting the retired MOBIUS_ENABLE_BQMOE_PERPROJ_V2 (every truthy spelling) cannot bypass the blocker -- _fuse_native_block_moe and end-to-end build_from_gguf both still raise SparseMoEExportError with the dense graph left untouched; env + allow_dense keeps the runnable dense fallback, never a v2 node. * Direct public fuse_block_quantized_moe rejects mixed-format v2 by default; v1 uniform still fuses; the private schema hook stays covered for the v2 shape. * Removed the two runtime-probe tests and the two v2-via-env emission tests (the env capability they asserted no longer exists). Focused 42 passed; full rewrite_rules/ + integrations/gguf/ 575 passed, 1 skipped. ruff check + ruff format --check clean on all four changed files. Co-authored-by: Copilot <[email protected]>
Revision — v2 honesty blocker addressed (narrow), for Gaff re-reviewAddresses the single blocker in the REJECT-WITH-REVISION verdict ( Since no shipped onnx‑genai runtime implements the per‑projection v2 ABI and no typed capability handshake exists yet, I took the fail‑closed option (verdict option 2, made strict): production never emits v2. What changed (revision commit
|
APPROVE FOR MERGEIndependent re-review of the narrow Batty revision at exact HEAD Blocker resolution — verifiedEnv pseudo-capability fully removed from production/CLI/direct defaults.
All truthy old env values cannot emit v2.
Public API fails closed by default.
Private schema-only hook is unreachable from production and clearly non-runnable.
v1 approved behavior and graph atomicity unchanged.
Independent test/lint runs (isolated worktree,
|
There was a problem hiding this comment.
Pull request overview
This PR adds a graph rewrite + GGUF builder integration to collapse dense routed native-block MoE “expert storms” (per-expert pkg.nxrt::BlockQuantizedMatMul gated by Equal masks) into a single sparse pkg.nxrt::BlockQuantizedMoE node per layer, preserving native-block bytes and enforcing a fail-closed “no dense-all-expert export by default” policy at the final (post-apply_weights) graph state.
Changes:
- Introduces
fuse_block_quantized_moe()rewrite to detect, validate, and fuse dense routed native-block MoE subgraphs into oneBlockQuantizedMoEper layer. - Wires the fusion into
build_from_ggufafterpkg.apply_weights, plus a final-graph-state backstop gate to fail closed if any routed.experts.storms remain. - Adds unit + builder integration tests (including end-to-end synthetic GGUF builds) to assert structural collapse and byte preservation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mobius/rewrite_rules/_block_quantized_moe_fusion.py | Implements the two-pass (plan/emit) native-block MoE fusion rewrite and fail-closed error path. |
| src/mobius/rewrite_rules/_block_quantized_moe_fusion_test.py | Adds structural/byte-preservation tests and fail-closed scenarios for the rewrite. |
| src/mobius/rewrite_rules/init.py | Exposes fuse_block_quantized_moe from the rewrite_rules package. |
| src/mobius/integrations/gguf/_builder.py | Integrates fusion at step 9b and adds a final-graph-state sparse-MoE honesty gate. |
| src/mobius/integrations/gguf/_block_quantized_moe_builder_test.py | Tests builder-side wiring, honesty policy, determinism, and end-to-end synthetic GGUF builds. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| moe_out = moe.outputs[0] | ||
| moe_out.name = f"{prefix}.bqmoe_output" | ||
| moe_out.type = ir.TensorType(ir.DataType.FLOAT) | ||
| moe_out.shape = moe_input.shape | ||
|
|
| for node in model.graph: | ||
| if node.op_type != "BlockQuantizedMatMul": | ||
| continue | ||
| weight = node.inputs[1] if len(node.inputs) > 1 else None |
| A layer that mixes native formats across its fc1/fc2/fc3 banks (GLM-5.2 | ||
| UD-IQ1) can only be expressed with the ``block_layout_version=2`` | ||
| per-projection ABI, which no shipped onnx-genai runtime executes yet. The | ||
| production builder therefore never enables v2: such layers always | ||
| typed-reject here rather than emit an unrunnable node. There is no | ||
| environment or CLI opt-in -- v2 stays a schema-construction test path until a | ||
| real typed runtime-capability handshake exists. |
| bias_inputs = None | ||
| if bias_expert == e: | ||
| bias_arr = rng.standard_normal(INTER).astype(np.float32) | ||
| bias_inputs = _init(graph, f"expert{e}.down.bias", bias_arr, ir.DataType.FLOAT) | ||
| dw = _init(graph, f"expert{e}.down_proj.weight", down_w, ir.DataType.UINT8) |
…on primitives (DRAFT) (#602) ## Summary DeepSeek-V4 real-checkpoint blocker **B2**: generic **block-FP8 / packed-FP4 weight-loading + expert-emission primitives**, classified by tensor *properties* (never by model name). Separate artifact from PR #591 (native BQMoE fusion) — touches none of its files, and does not touch `deepseek_v4.py` (Deckard/CSA #593). ### Root cause `QuantizationConfig.from_transformers` treated `quant_method='fp8'` as ordinary per-tensor float8 and returned `None`, so the model built bf16 `Linear` initializers. The real experts are **FP4-packed in int8** (E2M1, block-32, UE8M0 micro-scales), so a packed `[2048,2048]` expert was compared to its logical `[2048,4096]` initializer → confusing `Weight shape mismatch`. Projections are **block-FP8** (E4M3 weight + 2D UE8M0 `[128,128]` block scales). ### What this adds (`mobius.integrations._block_quant`) - **`BlockQuantScheme`** — property parser over `quantization_config` + top-level `expert_dtype`. Per-tensor fp8 (no `weight_block_size`) is *not* owned. - **`QuantizedTensorDescriptor`** — clean, breaking contract: logical **and** packed shape, weight qtype, block geometry, scale name/dtype/shape/layout, exact byte counts, routed/shared role. - **`classify_tensor` / `validate_descriptor`** — distinguish `ORDINARY`, `BLOCK_FP8`, `FP4_PACKED`, `UNSUPPORTED`. Logical-vs-packed shape, scale pairing, and wrong/missing/orphan scales fail closed. **No dequantization, no copy-to-float.** - **`read_raw_tensor_bytes` / `LazyRawTensor`** — byte-exact, header-only, bounded lazy per-shard loading (one tensor resident). - **`stack_expert_bank` / `PackedExpertBank`** — byte-exact expert-major bank packing (reusable lowering primitive; ragged banks are a hard error). - **`runtime_representation_gap` / `plan_routed_expert_bank`** — the **emission gate**. ### ABI verdict (why it typed-rejects, no fake fusion) onnx-genai `nxrt` CPU kernels (`block_quantized_{matmul,moe}.rs`) accept only the **interleaved llama.cpp `block_mxfp4`** layout (QK=32, 17 bytes/block) and the `iq*` GGUF formats: - **block-FP8** projections → no `block_fp8` BlockFormat + no E4M3×2D-UE8M0 dequant path → **typed reject**. - **FP4 experts** are numerically MXFP4 but stored **planar** (separate I8 nibbles + separate E8M0 block-32 scale), while nxrt MXFP4 needs a **single interleaved tensor** → **typed reject** (planar→interleaved transcode is unproven; no planar-FP4 bank ABI). `plan_routed_expert_bank` raises `BlockQuantExportError` naming the exact gap rather than emitting an unrunnable node. **No dense fallback, no env-flag emission.** ### `from_transformers` change (property-guarded) Block-scaled fp8 / fp4-expert checkpoints now surface a precise typed blocker instead of `None → shape-mismatch`. Ordinary per-tensor fp8 still returns `None`; GPTQ/AWQ/GGUF/ModelOpt paths unchanged. ### Preflight (B2 moved) `ArchitectureConfig.from_file(<real checkpoint>)` now raises `BlockQuantExportError` with the exact layout + ABI gap — the failure moved from a confusing shape-mismatch to an actionable typed reject. ### Tests Real `quantization_config` + a measured slice of the checkpoint index metadata + tiny synthetic packed safetensors (real `I8` / `F8_E4M3` / `F8_E8M0` dtypes): classification, logical-vs-packed validation, byte preservation, scale pairing (missing/duplicate/orphan/wrong), shared-vs-routed, bounded lazy load, byte-exact bank stacking, emission typed-reject. An opt-in suite exercises the mounted checkpoint headers directly. `ruff check` + `ruff format` clean. ### Deckard #593 handoff (stable public API) `from mobius.integrations._block_quant import (BlockQuantScheme, QuantizedTensorDescriptor, QuantKind, classify_tensor, validate_descriptor, build_descriptors, pair_weight_scales, read_raw_tensor_bytes, LazyRawTensor, stack_expert_bank, PackedExpertBank, plan_routed_expert_bank, runtime_representation_gap, BlockQuantError, BlockQuantValidationError, BlockQuantExportError)`. No edits to `deepseek_v4.py`. ### Remaining typed blockers (not this PR) 1. nxrt has **no block-FP8 BlockFormat**. 2. FP4 experts are **planar**, nxrt MXFP4 is **interleaved** — needs a proven byte-exact planar→interleaved transcode **or** a planar-FP4 bank ABI extension. 3. End-to-end runnable export additionally needs Deckard's model wiring (#593). No A100 benchmark (no runnable shape-faithful path yet). **Draft — do not merge.** 🤖 Flagged for squad review (needs review): touches the shared `QuantizationConfig.from_transformers` config seam. Co-authored-by: Copilot <[email protected]>
…ion) [Slice 3B] (#599) ## Slice 3B — Mobius opt-in `--paged-attention` export (dense MLA, LATENT) Emits `com.microsoft::PagedAttention` v1 in **LATENT / absorbed-MLA** mode for property-compatible **dense MLA** (DeepSeek-V2/V3, GLM-5.2 `--glm-full-attention`). Builds on the merged onnx-genai native runtime contract: audit/typed-validator/oracle (#1940), KV index emission (#1955), CUDA LATENT kernel (#1978). ### Guarantees - **Default off.** Feature-off exports are **byte-identical** to the current dense-MLA graph (all new code is gated behind the flag/task). A byte-identical test locks this. - **Property-based eligibility, never model names.** Decided from semantic geometry: latent width, `v_head_size`, partial-RoPE suffix (`rotary_offset = kv_lora_rank`), cache dtype (fp16/bf16), and the onnx-genai-kv page/block constraints (head_size %8, kv_lora %8, rotary_dim %16, rotary_offset %8, block pow2 ≥16). - **Typed reject, never silent fallback.** Active query-dependent sparse selection (GLM **DSA/IndexShare**, DeepSeek-V4 **CSA/HCA**), **MTP**, **quantized cache**, **head_sink**, **qk-norm**, **sliding window** all raise a typed reason at model construction / build. Feature-on with an incompatible geometry errors. GLM's *vestigial* indexer config (dropped under `--glm-full-attention`) does **not** reject. - **One cache authority.** The op consumes/mutates caller-owned page buffers in place; Mobius **allocates no pages** and creates no second cache manager. `onnx-genai-kv` stays the sole authority. The graph binds caller-owned `block_table` / `slot_mapping` / cumulative + past lengths / per-layer LATENT `key_cache`, aliases the cache in place, and derives token positions from the length tensors (no `position_ids` input). ### Emitted contract - One `PagedAttention` node per layer, `_domain="com.microsoft"`, LATENT attrs (`kv_cache_layout=LATENT`, `kv_num_heads=1`, explicit `scale`, `v_head_size=kv_lora_rank`, `rotary_offset=kv_lora_rank`, `do_rotary=1`); `rotary_dim` is **derived** from `cos_cache`, never emitted. - Model inputs: `input_ids`, `block_table` (i32), `slot_mapping` (i32), `cumulative_sequence_length` (i32), `past_seqlens` (i32), per-layer `key_cache.{i}` `[num_blocks, block_size, 1, head_size]`. Outputs: `logits`, `updated_key_cache.{i}` (aliases input). - `kv_b_proj` is absorbed into the query/output projections at weight-apply time; numeric contract mirrors the onnx-genai equivalence oracle. ### Tests (same commit) - **component** (`components/_paged_mla_test.py`): eligibility rejects, absorption, numpy **decomposed-vs-absorbed LATENT parity** (rel < 1e-6), structural emission. - **model-level** (`models/paged_mla_export_test.py`): feature-off byte-identical; feature-on structural + exact op attrs/inputs/outputs/model IO; typed rejects (DSA/CSA/HCA/MTP/window); torch-tensor weight absorption; DeepSeek-V3 path proves eligibility is not name-gated. - **CLI** (`tests/cli_test.py`): `--features paged-attention` plumbing + task resolution + mutual-exclusion errors. - Existing GLM / DeepSeek / task / build-graph tests pass unchanged. ### Scope / gates - **No full-size performance claim.** Tiny correctness only. Native runtime full-size verification is separate. - Executing the emitted graph needs **ORT ≥ 1.29 CUDA** (contrib op is unknown to the base onnx checker, so model-level assertions are structural). - Avoids #578 (GGUF preflight) and #591 (BQMoE) files. **Draft — do not merge.** Independent review required (reviewer excluding Leon/Sapper; Gaff or Roy final approval). Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
Native-block sparse-MoE fusion +
build_from_ggufintegrationCollapses GLM-style routed native-block expert storms (a per-expert
pkg.nxrt::BlockQuantizedMatMulfor every gate/up/down of every expert,dispatched by an
Equalone-hot mask) into one sparse top-kpkg.nxrt::BlockQuantizedMoEper layer, reusing the existing native blocksbyte-for-byte (no dequantize, no requantize). Gated on graph/tensor
structure, never on model names.
What's here
rewrite_rules/_block_quantized_moe_fusion.py) — the transform:finds the dense-fallback MoE subgraph, validates all layers, then emits.
Two-pass so an unfusable layer fails atomically with the graph untouched.
integrations/gguf/_builder.py) — wires the fusioninto
build_from_ggufat the single post-export authority point (step9b, after
pkg.apply_weights, once every native block carries real packedbytes), then a final-graph-state honesty gate.
Applicability verdict (Phase-1 audit)
layer (fused
gate==upin iq1_s/iq1_m;downin a higher-bit format such asiq4_xs). A v1 single-
formatBlockQuantizedMoEtherefore fuses 0 GLMlayers.
block_layout_version=2per-projection ABI (
fc1_format/fc2_format/fc3_format). That runtimeABI lives on an unmerged onnx-genai branch, so mobius's runnable runtime
does not yet have it.
(
SparseMoEExportError, message namesblock_layout_version=2) until theruntime ships v2 — we never emit an unrunnable v2 node by default. Uniform
native-block routed MoE does fuse today (v1).
Honesty / fail-closed policy
allow_dense_moe=False. Unsupported layers (mixed w/o v2, per-expertbias, ragged/incomplete groups) raise the shared
SparseMoEExportErroratomically; the graph is left as the original dense storm.
_perproj_bqmoe_v2_runtime_available()gates v2 emission onMOBIUS_ENABLE_BQMOE_PERPROJ_V2(default off). Flip it only once theonnx-genai v2 runtime ships.
layers the fusion now collapses); enforcement moved to the final graph
state — the fusion's atomic reject + a
_assert_sparse_moe_graphbackstopthat fails closed on any surviving routed
.experts.BlockQuantizedMatMulstorm. Single mechanism, no duplicate gate. Batty's
_assert_sparse_moe_capability/
_routed_dense_block_expert_paths(Direct multi-shard GGUF import + GLM-5.2 (glm-dsa→glm_moe_dsa) resolution #581) stay defined for their unit tests.allow_dense_moe=Truemay warn + retain the dense fallback, but nevercounts as a performance path (no throughput claim).
Emitted ABI (unchanged runtime contract)
BlockQuantizedMoE9 inputs, FLOAT32:[input, router_logits, fc1_experts_weights(uint8 4D), fc1_bias?, fc2_experts_weights, fc2_bias?, fc3_experts_weights?, fc3_bias?, router_weights?]. Uniform layer →formatattr (v1). Mixed layer →
block_layout_version=2+fc1_format/fc2_format/fc3_format. Expert banks are the source native blocks stacked verbatim(byte-preservation asserted in tests).
Tests (same commits)
_block_quantized_moe_fusion_test.py, 23): GLM-styleSigmoid+TopK+normalize routing, top-k {1,8}, byte-preserving stacking,
atomic fail-closed (dropped/duplicate/ragged/mixed-bias experts), structural
proof the expert matmuls collapse, and the new v2-runtime gate (uniform
fuses without v2; mixed typed-rejects without v2; mixed emits v2 when opted in).
_block_quantized_moe_builder_test.py, 20): step-9bhelpers on synthetic exported packages (default fail-closed, v2 opt-in, dense
retention, byte-preserving banks, deterministic external data, final-state
backstop) plus 5 real end-to-end
build_from_ggufbuilds on syntheticnative-block MoE GGUFs (
qwen3_moe/qwen2_moe, which lower through theidentical routed dense-loop →
BlockQuantizedMatMulstorm and the same step-9bauthority point):
BlockQuantizedMoE, only attention matmuls remain (no storm);SparseMoEExportError(GLM-5.2's honest path);MOBIUS_ENABLE_BQMOE_PERPROJ_V2=1→ one v2 node;allow_dense_moe=True→ dense storm retained (no fused node);Full
rewrite_rules/+integrations/gguf/suites: 576 passed, 1 skipped.ruff check+ruff format --check: clean.Remaining typed blockers (not overclaimed)
mixed-format typed-rejects end-to-end until it ships. Uniform native-block
MoE fuses today.
importer path exists (GLM-5.2 can't build to a runnable graph until v2 lands).
Full-model speed is not claimed.
_builder.pymerge coordination — Sapper's GGUF export preflight: block-preserving lossless-only classification + budget (reconciled into #581) #578 (unmerged) also rewrites_builder.py; a future rebase will need coordinator-mediated conflictresolution. No live collision on this base.
Dependency on Batty's sharded import
Builds on the merged #581 (
GgufShardSet,glm-dsa→glm_moe_dsabridge,shared
SparseMoEExportError) and #576; rebased cleanly on059bf5f. Onlyuses those committed public interfaces — no edits to shard-reader / architecture-
mapping files.
Draft — do not merge. Requesting independent review (excluding author).