Skip to content

Support public Moshiko full-duplex exports - #541

Merged
justinchuby merged 7 commits into
mainfrom
justinchuby/catalogue-world-builds
Aug 22, 2026
Merged

justinchuby merged 7 commits into
mainfrom
justinchuby/catalogue-world-builds

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • infer 8-step public Moshi/Moshiko versus 16-step PersonaPlex depformer weights and build the matching real-weight graph
  • keep full-duplex workflow metadata valid when optimization prunes the temporal position_ids graph input
  • expose deterministic runtime sampling and standard Mimi component paths
  • add a standalone pinned Pangu-Weather packaging/evidence utility

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

  • python3 -m pytest tests/build_graph_test.py -k 'depformer_io or TestBuildMoshiLM' -q --tb=short: 4 passed
  • python3 -m pytest src/mobius/integrations/onnx_genai/duplex_workflow_metadata_test.py src/mobius/generation/_duplex_policy_test.py -q --tb=short: 29 passed, 1 skipped
  • lintrunner f --output oneline --all-files, then lintrunner -a: passed with pinned ruff 0.16.2
  • Pangu graph inspection against the published 1-hour model: exact expected ports, IR v7, opset 14
  • automated code review: no significant findings

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.

justinchuby and others added 5 commits August 21, 2026 22:05
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]>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 22, 2026 00:48
@github-actions

github-actions Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 8b5e7a3 → b25e6b9

Model Sub-model Changes Status
bert (feature-extraction) model 0 ⚪
falcon model 0 ⚪
gemma2 model 0 ⚪
gemma4 (gemma4) decoder 0 ⚪
gemma4 (gemma4) embedding 0 ⚪
gemma4 (gemma4) vision_encoder 0 ⚪
gemma4_text model 0 ⚪
gpt2 model 0 ⚪
llama model 0 ⚪
llama (static-cache) model 0 ⚪
mamba (ssm-text-generation) model 0 ⚪
phi3 model 0 ⚪
phi3 (static-cache) model 0 ⚪
qwen model 0 ⚪
qwen (static-cache) model 0 ⚪
qwen2 model 0 ⚪
qwen2 (static-cache) model 0 ⚪
qwen2_moe model 0 ⚪
qwen2_moe (static-cache) model 0 ⚪
qwen3 model 0 ⚪
qwen3 (static-cache) model 0 ⚪
qwen3_5_moe (hybrid-text-generation) model 0 ⚪
qwen3_5_text (hybrid-text-generation) model 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) decoder 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) embedding 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) vision_encoder 0 ⚪
qwen3_moe model 0 ⚪
qwen3_moe (static-cache) model 0 ⚪
qwen3_next (hybrid-text-generation) model 0 ⚪
t5 (seq2seq) decoder 0 ⚪
t5 (seq2seq) encoder 0 ⚪
whisper (speech-to-text) decoder 0 ⚪
whisper (speech-to-text) encoder 0 ⚪

No architecture changes detected. ✅


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@github-actions

github-actions Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 8b5e7a3 → b25e6b9

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 68 68 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 66 66 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 105 105 +0.0% ⚪
gpt2 model_size_bytes 388 KB 388 KB +0.0% ⚪
gpt2 num_nodes 54 54 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 60 60 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 56 56 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 94 94 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 58 58 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 54 54 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 60 60 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 264 264 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 126 126 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 428 428 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 166 166 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 8 only changes the runtime loop; when --skip-build is omitted, _build_models() still hard-codes _MODEL_ID to nvidia/personaplex-7b-v1 and 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 and reset_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 in set_seed).
        "--seed",
        type=int,
        default=0,
        help="Sampling seed for reproducible offline and streaming generation.",

examples/personaplex/moshi_ort.py:414

  • The _depformer_step docstring and its nearby comments still say it always generates 16 codebooks and accept (16,) teacher-forcing arrays, although the changed loop now uses self.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.

Comment thread examples/personaplex/moshi_ort.py Resolved
Comment thread src/mobius/models/moshi.py Resolved
Comment thread src/mobius/models/moshi.py Resolved
@justinchuby

Copy link
Copy Markdown
Member Author

Final downstream validation after the latest commit:

  • justinchuby/onnx-genai@62d6966 validate_metadata accepts the Pangu, ACT, and Moshiko packages.
  • Retired sha256, config_sha256, and base_model_fingerprint fields: none in all three metadata documents.
  • Public Moshiko package clean-downloaded at revision 426253a5a5822eb405e4ac214d6895427c64ef0c and executed encoder -> temporal -> depformer -> decoder with CUDA ORT 1.28.0.
  • Pangu and ACT package metadata were updated to remove unsupported architecture-specific component roles; explicit SSA bindings preserve their semantics.

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]>
@justinchuby
justinchuby merged commit 7295814 into main Aug 22, 2026
23 of 24 checks passed
@justinchuby
justinchuby deleted the justinchuby/catalogue-world-builds branch August 22, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants