Repository navigation
Support public Moshiko full-duplex exports - #541
Conversation
Package the published one-hour Pangu-Weather ONNX checkpoint with checksum and graph-port validation, canonical workflow metadata, pinned license provenance, and real CUDA runtime request/output evidence. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Infer the checkpoint's depformer stream count so the Moshi exporter handles both public 8-codebook Moshiko weights and 16-codebook PersonaPlex weights. Keep optimized temporal graphs valid when position_ids is pruned and expose runtime evidence fields in the duplex example. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Expose a deterministic seed in the full-duplex example so catalogue requests can be replayed with stable text and audio token outputs. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Preserve the hashless inference-metadata producer invariants from #539 and the PEFT integration from #536 while carrying the focused Moshi and Pangu catalogue changes forward. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Keep the standalone real-checkpoint packaging utility compliant with Mobius's protobuf-free graph inspection convention and apply the repository formatter after merging main. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
🏗️ Architecture Diff
No architecture changes detected. ✅ Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
Performance Comparison
|
Omit architecture-specific component port roles that ONNX GenAI main does not define. The workflow's explicit SSA bindings already preserve the weather tensor semantics without inventing runtime vocabulary. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds public 8-step Moshi/Moshiko support, duplex metadata compatibility, deterministic runtime behavior, and Pangu-Weather packaging.
Changes:
- Detects and builds matching 8-/16-step depformer graphs.
- Preserves metadata when temporal inputs are pruned.
- Adds runtime sampling, Mimi path fallbacks, and Pangu evidence packaging.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Summary | Final comments |
|---|---|---|
tests/build_graph_test.py |
Adds 8-/16-step graph tests. | No final comments. |
src/mobius/models/moshi.py |
Configurable depformer dimensions and preprocessing. | Critical (2 votes): Reject dep_q < 2; dep_q == 1 cannot execute. Nit (2 votes): Update documentation for 8-/16-step variants. |
src/mobius/integrations/onnx_genai/workflow_metadata.py |
Handles optional temporal position metadata. | No final comments. |
src/mobius/integrations/onnx_genai/duplex_workflow_metadata_test.py |
Tests pruned position IDs. | No final comments. |
src/mobius/integrations/moshi/_builder.py |
Detects depformer width from checkpoint weights. | No final comments. |
scripts/package_pangu_weather.py |
Packages and validates the pinned weather model. | No final comments. |
examples/personaplex/moshi_ort.py |
Adds runtime sampling and component loading. | Critical (2 votes): The server does not pass dep_q, so 8-step exports default to 16 substeps and fail; infer or validate the width or thread it through the server. |
Suppressed comments (5)
examples/personaplex/moshi_ort.py:752
--dep-q 8only changes the runtime loop; when--skip-buildis omitted,_build_models()still hard-codes_MODEL_IDtonvidia/personaplex-7b-v1and exports a 16-step depformer. The advertised public setting therefore builds the wrong checkpoint and then silently drives only eight steps. Add a model/checkpoint selection that determines the step count, or reject this combination.
"--dep-q",
type=int,
choices=[8, 16],
default=DEP_Q,
help="Depformer codebooks: 8 for public Moshi/Moshiko, 16 for PersonaPlex.",
examples/personaplex/moshi_ort.py:745
- The new deterministic CLI seed initializes the RNG only once, but
warmup()consumes random samples andreset_stream()resets only the LM state. Consequently a seeded stream is affected by the warmup length and repeated sessions in the same process continue from the previous RNG state, contrary to the reproducibility promised by this option. Preserve the seed and reinitialize the RNG when starting a fresh stream (while updating it inset_seed).
"--seed",
type=int,
default=0,
help="Sampling seed for reproducible offline and streaming generation.",
examples/personaplex/moshi_ort.py:414
- The
_depformer_stepdocstring and its nearby comments still say it always generates 16 codebooks and accept(16,)teacher-forcing arrays, although the changed loop now usesself.dep_q. For an 8-step public export this documents the wrong contract; make the description and shapes depend on the configured step count.
sampled = np.empty(self.dep_q, np.int64)
for cb in range(self.dep_q):
scripts/package_pangu_weather.py:169
- This new reproducibility/evidence entrypoint has no automated coverage for the checksum gate, ONNX port inspection, runtime output ordering, or emitted metadata/provenance. A regression in any of those could publish an invalid catalogue package while the existing suite remains green; add a small mocked/unit test for the helpers and manifest generation (without downloading the full checkpoint).
checksum = _sha256(model_path)
if checksum != MODEL_SHA256:
raise ValueError(f"Model SHA-256 mismatch: {checksum}")
graph = _inspect_graph(model_path)
src/mobius/models/moshi.py:446
- The new 8-step path is covered only by graph construction. The real-weight integration still loads PersonaPlex and exercises a fixed 16-step depformer (
tests/moshi_lm_integration_test.py), so the new stacking/reshape and public-checkpoint path can regress without detection. Add at least a lightweight 8-step preprocessing fixture or an 8-step real-weight parity assertion.
in_proj = torch.stack(
[sd[f"depformer_in.{i}.weight"] for i in range(dep_q)], dim=0
) # (dep_q, 1024, 4096)
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Final downstream validation after the latest commit:
|
Infer the 8- or 16-step depformer width from raw and INT4 ONNX weights, validate explicit overrides in both CLI and server paths, reject unsupported exporter widths, and refresh configurable-step documentation and tests. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Summary
Pangu script scope
The Pangu utility is intentionally a separate first commit and does not register a new Mobius architecture. It packages an already-published ONNX checkpoint, verifies its exact SHA-256 and graph ports using onnx_ir, executes deterministic real-weight inference, and emits provenance/evidence. Keeping it under scripts/ makes the catalogue result reproducible without adding an inaccurate synthetic model exporter.
Main integration and producer invariants
Merged current origin/main without rebasing. The merge retains #539's hashless producer invariants (no sha256, config_sha256, or base_model_fingerprint fields in authored inference metadata), complete attention key/value layer alias sets, and #536's PEFT changes.
Validation
Real-weight evidence
The public CC-BY-4.0 Moshiko derivative executes encoder -> temporal -> 8-step depformer -> decoder on CUDA. The pinned Pangu weather package and ACT action-rollout fallback are published separately in the catalogue dataset.