Repository navigation
Prevent incomplete hierarchical audio metadata exports - #537
Conversation
Detect global-frame/local-codebook audio generation packages before generic diffusion dispatch. Fail with the exact missing canonical workflow contracts so component exports cannot be mislabeled as executable runtime packages. 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
|
There was a problem hiding this comment.
Pull request overview
This PR adds a fail-closed guard in the ONNX GenAI auto-export dispatch logic to prevent hierarchical audio-generation packages (global-frame AR + local RVQ + flow + vocoder) from being incorrectly treated as a generic diffusion pipeline and exported with incomplete/inaccurate runtime metadata.
Changes:
- Add a structural detector for hierarchical audio generation package topology that must take precedence over generic diffusion detection.
- Refuse to emit ONNX GenAI metadata for these packages until a canonical workflow can be represented (raises
NotImplementedErrorwith a detailed message). - Add a regression test ensuring hierarchical audio packages are not misclassified as diffusion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/mobius/integrations/onnx_genai/auto_export.py | Adds hierarchical-audio topology detection and fail-closed dispatch before diffusion metadata emission. |
| src/mobius/integrations/onnx_genai/auto_export_test.py | Adds a unit test asserting hierarchical audio packages raise a precise NotImplementedError instead of dispatching as diffusion. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Resolve modular pipeline indexes, component configs, optional metadata, and weight shards directly from a pinned local checkout. This makes large checkpoint exports reproducible without re-querying the Hub and preserves external component resolution when no local subfolder exists. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Construct graph-backed placeholder components so the hierarchical package regression respects ModelPackage validation on every supported Python version. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Replace the fail-closed hierarchical-audio dispatch with graph-derived canonical metadata covering two-row Global decoding, stateless seven-codebook RVQ recomputation, one Global KV service group, warmup/stop/frame-cap semantics, hidden fusion, 200/100 chunking, 172-latent overlap carry, 30-step flow matching, vocoder stitching, and buffered 44.1-to-32 kHz audio delivery. Add reusable policy graphs and exact text-assembly assets with focused runtime tests. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Mark the Global KV cache as two contiguous classifier-free-guidance rows per request so canonical metadata remains truthful while allowing runtime-owned cache compaction. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Keep the gathered stop logit rank-two before concatenating it with semantic candidates, and execute the policy under ORT in regression coverage. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Keep split embedding outputs aligned with decoder precision, describe dynamic workflow state truthfully, and evaluate Snake reciprocals in float32 so fp16 CUDA vocoder execution remains finite. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
|
Executable real-weight update (commit
Private package upload is in progress under |
|
Final package: https://huggingface.co/justinchuby/onnx-genai-example-minimax-music3 (private), revision |
Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Generate a deterministic no-network nested audio package, declare CFG-expanded Global rows correctly, and align image and shared-state metadata with canonical validation. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Bring files merged from main into compliance with the pinned Ruff checks that run against the PR merge history. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
State-service aliases describe updating past/present pairs; shared-state denoiser readers remain ordinary workflow inputs and no longer emit the retired access field. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
|
Updated open PR at The branch now emits CFG-expanded Global contracts correctly, canonical image ranges/read-only state aliases, and a deterministic no-network hierarchical-audio package that executes the nested Global/RVQ/30-step-flow/vocoder path in ONNX GenAI producer CI. All completed checks pass; only the queued |
Persist policy graphs registered during hierarchical-audio metadata generation and regress the normal save-before-metadata CLI order. Execute the generated nested audio workflow with a pinned ONNX GenAI runtime in Mobius CI, including CFG row collapse, finite stereo output, and request-state reset checks. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
|
@copilot merge from main. |
Integrate current workflow metadata, policy component, and validation updates while preserving the hierarchical audio producer contracts. Signed-off-by: GitHub <[email protected]> Co-authored-by: justinchuby <[email protected]>
|
|
Signed-off-by: Justin Chu <[email protected]>
| build_waveform_stitch( | ||
| dtype=next(iter(pkg["vocoder"].graph.outputs)).dtype, | ||
| latent_hop_length=512, | ||
| crop_left_latents=86, |
There was a problem hiding this comment.
Are these different across models? Can they be encoded in modeling code?
There was a problem hiding this comment.
Resolved in 2b54205 (latest head ec48bbe): hierarchical metadata now reads model-varying execution values from a pinned, provenance-bearing workflow contract; component roles are resolved structurally from the package config, tensor geometry/vocabulary bounds/audio dimensions are validated from graphs and component configs, tokenizer sentinel IDs are resolved from tokenizer.json, and missing facts fail closed. Two materially different synthetic configurations verify emitted dimensions/tokens/steps/audio contracts vary without Music3 constants leaking.
Merged latest main in |
Derive component roles and tensor geometry from package graphs, require a validated pinned workflow contract for execution-only values, and add variant/fail-closed producer coverage. Restore runtime conformance CI and refresh generated fixtures. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Bring the branch up to date with current main before final review while preserving generalized hierarchical-audio metadata and conformance coverage. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Validate the requested runtime before creating output artifacts or opening the GGUF file, matching the CLI contract on every supported platform and Python version. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Derive the semantic boundary from the complete tokenizer vocabulary, fail closed on inconsistent token or graph ranges, source guidance-row splice values from the pinned workflow contract, and exercise raw speech text assembly through the HTTP API in producer conformance. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Fail closed in the direct metadata writer when stop or unconditional token IDs are negative, overlap the semantic range, or exceed the ONNX logits vocabulary. Cover direct and auto-export paths and verify no metadata, processor, or policy artifacts are emitted. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Resolve policy-component and workflow detector conflicts while preserving direct hierarchical-audio token validation and current video diffusion dispatch. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Address the architectural review of the hierarchical-audio (MiniMax Music3) metadata support so mobius owns only model-agnostic Python producer code and downstream runtime conformance stays in ONNX GenAI. What changed and why: - Remove ONNX GenAI runtime tests from mobius. Delete tests/onnx_genai_speech_conformance.rs and revert the Music3/hierarchical additions to tests/onnx_genai_workflow_conformance.rs. Rust/HTTP end-to-end conformance belongs to onnxruntime-genai, not the mobius producer. - Delete the model-specific "producer contract" src/mobius/integrations/diffusers/workflow_contracts/hierarchical_audio_flow_v1.json and its pyproject package-data registration. It encoded MiniMax constants (vocab 16384, guidance scales, flow_steps=30, 32kHz, prompt literals) as a hidden generic default, which it is not. - Introduce a typed, model-agnostic HierarchicalAudioWorkflowConfig dataclass that carries exactly the runtime facts a hierarchical-audio pipeline cannot derive from its neural graphs (semantic-vocabulary boundary, CFG schedule, chunked flow plan, prompt-assembly template). It ships no defaults, names no model, and self-validates on construction (fails closed). The metadata producer consumes this config only, keeps the two control-token bounds (nonnegative, below semantic_vocabulary_start, below the graph's global logits width) as writer authority against the built graph, and emits no artifact or policy component before all validation passes. - Resolve the config in build_diffusers_pipeline from an explicit caller argument or a pinned source-model asset (mobius_workflow.json at the requested revision), never by pipeline/model/class name. Structural role extraction still recognizes MiniMax component classes to wire the graphs, but the generator branches only on structural roles and graph/config fields. When no config is available the graphs still build and the package is marked workflow_kind="hierarchical_audio" so ONNX GenAI metadata emission fails closed with an instruction to supply the config instead of misclassifying the package as diffusion. - Replace the contract-file tests with Python tests that construct explicit HierarchicalAudioWorkflowConfig values and prove emitted policy/template fields follow the input, plus a mocked source-asset loader test and an auto_export fail-closed test. Keep the tokenizer/graph-derived validation and the save-policy-artifact assertions. - Drop the unrelated SenseNova pixel-flow denoiser cache-alias edits from this PR (revert shared_state_flow_metadata.py and sensenova_u1_test.py to main); regenerate the shared_state_pixel_flow fixture so only the required 3D-latent row_shape change remains. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Signed-off-by: justinchuby <[email protected]>
Merging latest main brought in a `yarn_apply_mscale` helper whose signature line exceeds the 95-character limit and was committed without running ruff format, leaving the repo's Lint (lintrunner --all-files) red. Wrap the signature so `ruff format` is clean across the whole tree. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
The hierarchical-audio workflow config (semantic-token boundary, guidance schedule, chunked flow plan, prompt template) carries runtime facts that cannot be read back from the exported neural graphs. Previously the builder required these to arrive from an explicit caller argument or an external `mobius_workflow.json` source-model asset, else it failed closed -- too strict, since mobius is the canonical model-name -> model-information registry and already owns MiniMax token constants here. Move the Music 3 defaults into the diffusers config-adapter layer, following the existing `from_diffusers` prior art: - Add named `MINIMAX_MUSIC3_*` workflow defaults + a `MiniMaxMusic3WorkflowConfig` adapter in `_configs.py`. Its `from_diffusers` builds the typed, generic `HierarchicalAudioWorkflowConfig` from source component configs (the global decoder's context window) plus the mobius-owned defaults, with provenance comments. A divergent checkpoint overrides any field. - Select the adapter by pipeline class in the builder via a small `_resolve_hierarchical_workflow_config` helper: an explicit `workflow_config` argument always wins; otherwise mobius supplies the adapter defaults; an unrecognised hierarchical topology still fails closed (marked so ONNX GenAI metadata emission stops with an instruction). Remove the `mobius_workflow.json` asset loader and `HIERARCHICAL_AUDIO_WORKFLOW_ASSET`. - Keep the generic metadata writer fully model-agnostic: zero model-name/class checks and no MiniMax literals; it validates normalized fields and the two token ids against the graph's global logits width. - Drive the checked-in hierarchical_audio validation fixture through the new adapter (byte-identical output), and add adapter/resolution tests proving default ownership, context-window generalization, explicit-argument override, and fail-closed behavior for unknown pipelines. Co-authored-by: Copilot <[email protected]> Signed-off-by: justinchuby <[email protected]>
Summary
The offline path is required for the 54 GB pinned checkpoint: it avoids mutable/repeated Hub lookups after provenance is fixed and enables H200 validation from the required catalogue directory.
Real checkpoint evidence
fbdf52fbaaca799592917417eb05f1899f1255ec/datadisks/disk1/justinchu/inference-metadata-catalogue/minimax-music3/onnx-components-f16model.layers.0.input_layernorm.weightmax abs delta2.98e-08, correlation0.9999999999998486, identical L2 normThis is real-weight export evidence, not L4/L5 runtime evidence. No package has been published.
Validation
python3 -m pytest src/mobius/integrations/diffusers/_builder_test.py -q --tb=short(37 passed)Part of #504. Canonical nested workflow emission remains the next producer commit; the guard intentionally stays fail-closed until that executable workflow exists.