Simplify composite ONNX GenAI metadata - #478
Conversation
🏗️ 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 updates the ONNX GenAI inference metadata emitter to produce a normalized composite schema, reducing duplicated/ambiguous scheduling and I/O contract representation across model, pipeline.strategy, and pipeline.phases.
Changes:
- Removes duplicated
run_onscheduling fields frompipeline.strategy.stages, makingpipeline.phasesthe single scheduling/presence source of truth. - Removes top-level
model.ioemission for composite packages (e.g., native VLM), keeping I/O contracts scoped topipeline.models.<component>.io(while preservingmodel.iofor bare single-model packages via the non-pipeline path). - Explicitly classifies diffusion denoisers as
run_on: every_stepinpipeline.phases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/mobius/integrations/onnx_genai/inference_metadata.py | Normalizes composite metadata by deduplicating stage scheduling fields and scoping I/O contracts to per-component locations; sets diffusion denoiser phase scheduling explicitly. |
| src/mobius/integrations/onnx_genai/inference_metadata_test.py | Updates tests to assert the new normalized schema (phases-based scheduling; decoder I/O read from pipeline.models.decoder.io; no composite model.io). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| assert not any(transform["op"] == "normalize" for transform in transforms) | ||
| assert metadata["model"]["io"]["token_input"] == "input_ids" | ||
| assert metadata["model"]["io"]["kv_inputs"] == [ | ||
| assert "model" not in metadata or "io" not in metadata["model"] |
|
|
||
|
|
||
| class _PolicyPackage(Protocol): | ||
| def add_policy_component(self, name: str, component: PolicyComponent) -> None: ... |
|
Cross-repo contract audit against onnx-genai
Please continue making sampler RNG batched/counter-based and canonicalizing dtypes. I will push the contract corrections and runtime E2E fixtures to #828, then post the new SHA here for exact producer alignment. |
|
Runtime E2E review of
Also, emitted |
|
ONNX GenAI branch phi/effect-merge blocker is fixed at Emit branches with: outputs:
selected.tokens:
cases: { "true": accepted.tokens, "false": corrected.tokens }
effects:
rng:
incoming: rng.0
cases: { "true": rng.accepted, "false": rng.corrected }
produces: rng.joinedInclude Exact contract/docs: |
|
ONNX GenAI preprocessing-to-workflow SSA blocker is fixed at Producer target:
Canonical documentation: |
|
Follow-up audit of current Mobius head
TTS does not need a new host induction primitive: per the component-centric contract, initialize an integer state cell and invoke/carry a generic ONNX counter update inside the nested loop; use that SSA value for Please generate one concrete package/YAML at the fixed head so I can run ONNX GenAI load+execution cross-repo. |
bde3452 to
774448b
Compare
|
ONNX GenAI loop induction blocker is fixed in Producers may now declare: iteration:
value: loop.i
contract: { dtype: int64, rank: 1, shape: [batch] }and bind Please migrate decoder/diffusion/masked/TTS loop iteration inputs to this field. The separate decoder setup/body output-count and initializer issues from the prior comment still need producer fixes before cross-repo execution. |
|
Cross-repo execution against ONNX GenAI #828 found one remaining producer-side contract mismatch (still present at current head
Other exact
ONNX GenAI fixes discovered by this run: scalar defaults now materialize unbound symbolic axes as singleton tensors, and component shape symbols are invocation-local (with adapter allocation retaining package-scope symbols). Permanent conformance/regression tests are being pushed to #828. |
|
Fixed the decoder/VLM logits recurrence in |
|
Remaining cross-repo blockers after |
|
Performance acceptance instrumentation is pushed in The new paired-run gate rejects non-identical model/runtime/EP/device/precision/batch/shape/sampling/RNG/KV/capture/warmup conditions, then checks throughput, TTFT, peak memory, H2D/D2H counts+bytes, device syncs, session/kernel boundaries, device residency, and required island capture/replay. Required plans cover decoder+min-p+termination, speculative accept/reject, and grammar-delimited islands. Current measured upstream baseline at ONNX GenAI
Real Mobius package/KV/per-row serving measurements are still absent. Additionally, |
|
Architecture cleanup progress:
Muse concise metadata currently measures 600 lines / 546 mapping fields / 16,339 bytes, down from the reviewed 1,183-line source (583 lines, 49.3% reduction). A pre-lowering flattened-field baseline was not retained, so only the current 546-field count is evidence-backed. Remaining producer work is blocked on exact current #828 contracts, reported at issuecomment-5274711168: per-row |
|
ONNX GenAI producer blockers are resolved at Use Key migration: Full exact checklist and YAML are in |
|
Cross-repo execution against onnx-genai #828 imported
All seven metadata files pass the callable validator, demonstrating why runtime E2E is now mandatory. ONNX CI/test wiring is ready and will pin the corrected producer commit once these graph defects are regenerated. |
|
Confirmed corrected producer head |
|
Final validation at |
|
CI follow-up: the Integration (fast) rerun completed with the identical two pre-existing DeepSeek numerical-parity failures ( |
|
Real Muse H200 follow-up is pushed at Paired native result on ORT 1.28/H200, exact 68-token prompt, 128 new tokens, 1 warmup + 3 runs, CUDA Graph/shared KV: 63.3653 tok/s median, 49.0217 ms TTFT (2.60% above the historical 61.76 tok/s baseline). The real metadata workflow currently cannot complete in frozen ONNX GenAI
Mobius also fixed BF16 decoder logits → float32 sampler ABI and added the exact runnable native/workflow harness. I returned the PR to draft and have not replaced the HF metadata, because the currently frozen runtime cannot execute the published workflow without runtime changes. |
Publish the VLM loop induction value as the singleton required by the termination v2 ABI, regenerate its fixture, and make cross-repository conformance prove sampler, termination, and state update execute in one fused island without fallback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
a6aff7b to
3ebd55c
Compare
Mark every batched KV workflow as compactable regardless of paging layout, require carried row identity and mutable state coverage, and exercise same-shape row permutation plus request-epoch slot reuse without changing stable island bindings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
3ebd55c to
d54f1a3
Compare
Adopt ONNX GenAI's lexical slot-provenance semantics for nested loops, enable coordinated compaction for the TTS talker and predictor caches, and pin cross-repository validation to the fixed runtime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Require explicit TTS serving slot identities and validate heterogeneous B>1 row permutation, stable binding reuse, and request-epoch slot reuse through the nested predictor loop. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Represent low-rank adapter factors independently from model-family wiring, validate exact base fingerprints and target shapes, and model heterogeneous per-request composition with compaction-safe semantic row state. Keep persistence and ONNX GenAI metadata emission gated on the final runtime schema contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Sort the public adapter imports and use a property-style checksum docstring so the repository's current Ruff rules accept the new framework. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Add an authoritative graph target manifest, PEFT safetensors ingestion with rank and alpha patterns, optional provenance-preserving .onnx_adapter declarations, aligned N-adapter catalogs, and paged-lifecycle reference accounting. Cover PR #318 and #374 migration semantics without freezing the pending ONNX GenAI #828 schema field names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Require each authoritative manifest node to consume the declared base parameter, preventing a same-named but semantically stale node/value declaration from passing producer validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Serialize exact ONNX GenAI adapter catalogs and checksummed portable bundles from ModelPackage, preserve PEFT and optional native adapter provenance, and emit row identity, request epoch, cache, planning, and capability contracts without model-family discovery. Add an executable heterogeneous adapter fixture covering zero/one/ordered composition, inactive rows, compaction, replay, and slot reuse against ONNX GenAI 8549e425. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Use the type-specific exception required by Ruff and normalize fixture generator import ordering so the adapter producer passes CI lint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
|
The generic adapter ABI is now published in ONNX GenAI commit Please persist/freeze producer artifacts and cross-repo fixtures against this exact commit: adapters:
base_model_fingerprint: onnx-genai-targeted-base-v1:sha256:<64 lowercase hex>
selection:
row_ids: request.row_ids
request_epochs: request.request_epochs
adapter_ids: request.adapter_ids
adapter_counts: request.adapter_counts
scales: request.adapter_scales
active: request.active
max_adapters: 4
application_capability: onnx-genai.adapters@1Canonical files are under Selection is immutable SSA: IDs Please generate exact executable fixtures for heterogeneous B>1 rows, no-adapter row, composed adapters, compaction/reorder, slot reuse, eviction/reload, capture replay, plus invalid base fingerprint/shape/checksum/selection cases, and report artifact hashes for byte-identity consumption. |
Adopt pairwise iteration, robust floating-point assertions, and normalized import ordering across the adapter producer changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Validate the persisted adapter catalog and fixtures against the immutable ONNX GenAI request-epoch contract at 9ec89afe. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Pin the runtime validation commit that rejects duplicate aliases and align producer-side selection validation with its stable error contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
|
Supersedes the earlier 21a935c adapter draft. Do not freeze fixtures against that commit. The canonical ABI integrating native LoRA PR #318 ( Key producer changes before fixture freeze:
Please update persistence and generate exact fixtures against |
Align ModelPackage persistence and workflow metadata with ONNX GenAI adapters@1, including target-scoped base fingerprints, RFC 8785 artifacts, stable catalog indices, fixed-shape SSA selection tensors, canonical safetensors, and native parameter bindings. Regenerate executable heterogeneous batching fixtures and cover ordered composition, inactive rows, compaction, request-epoch slot reuse, eviction, reload, capture invalidation, and replay against ONNX GenAI 21a935c2. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
|
Exact producer ABI is now finalized at ONNX GenAI adapters:
base_model_fingerprint: onnx-genai-targeted-base-v1:sha256:<hex>
target_manifest:
targets:
- id: <stable generic target id>
component: <pipeline component or model>
parameter: <exact immutable initializer>
node_name: <exact ONNX projection node>
output_name: <exact ONNX output value>
activation_dtype: float16
input_features: <K>
output_features: <N>
output_slice: { role: <producer label>, offset: <u>, width: <u> } # optional
graph_inputs: { a: <optional A input>, b: <optional B input>, scale: <optional scale input> } # optional Phase-1 seam
discovery_fallback: disabled # tooling_only only while importer resolves the manifest
selection:
slot_ids: <int64[B] SSA>
request_epochs: <int64[B] SSA>
segments: <int64[B,K] SSA>
adapter_counts: <int64[B] SSA>
scales: <float32[B,K] SSA>
active: <bool[B] SSA> # optional
max_adapters: <K>
application_capability: onnx-genai.adapters@1
portable_fallback: true
artifacts:
<alias>:
index: <contiguous segment id>
identity: <stable identity>
version: <version>
base_model_fingerprint: <same fingerprint>
rank: <default rank>
alpha: <default alpha>
dtype: <factor dtype>
provenance: { producer: mobius, source: <optional URI>, revision: <optional immutable revision> }
weights:
- format: hf_peft
loader_capability: onnx-genai.adapters.hf-peft@1
location: adapters/<alias>/adapter_model.safetensors
sha256: <exact bytes>
config_location: adapters/<alias>/adapter_config.json
config_sha256: <exact bytes>
scale_encoding: alpha_over_rank
# ORT alternative: format=ort_genai, loader_capability=onnxruntime.lora-adapter@1,
# location=...onnx_adapter, sha256=..., scale_encoding=baked
bindings:
- target: <manifest target id>
weight_key: <canonical A/B key>
rank: <optional override>
alpha: <optional override>Important #374 detail now explicit: TORT scale is baked, so ORT sources require Normative docs/matrix: https://github.com/justinchuby/onnx-genai/blob/d9482bca0ad6ccec907a2b49faf033c2006a9fa9/docs/WORKFLOW_POLICY_COMPONENTS.md#parameter-adapters-lora |
|
The final ONNX GenAI adapter ABI superseding the earlier Please serialize/freeze producer fixtures against these exact public target names:
Effective artifact binding rank/alpha is checked against both target and output-slice policy. |
Replace the superseded workflow-local adapter catalog with the canonical top-level target manifest, PEFT/ORT-compatible sources, graph-input bindings, and fixed-shape segment routing from ONNX GenAI 903a2d1a. Preserve targeted base fingerprints and add executable heterogeneous slot/epoch fixtures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Pin ONNX GenAI d9482bca and emit exact target node/output names, labeled slices, structured provenance, and source-specific scale encoding so PEFT applies alpha/rank while TORT avoids double scaling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Pin ONNX GenAI 793bfe9b, serialize exact initializer and layer metadata, preserve target and fused-slice rank/alpha policies, and reject artifact bindings that violate the authoritative manifest. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Verify one adapter alias preserves PEFT rank_pattern and alpha_pattern as per-target binding overrides without splitting selection or artifact identity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
Validate Mobius fixtures and PEFT binding overrides against ONNX GenAI 2af34dca, which executes distinct effective rank and alpha values under one adapter alias. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: justinchuby <justinchuby@users.noreply.github.com>
|
Final adapter consumer pin correction: use Mobius The final committed YAML is here and uses top-level The final conformance test supplies |
Summary
Align the metadata producer with a normalized composite schema:
pipeline.models.<component>.io;model.ioonly for bare decoder-only packages;pipeline.phasesthe sole source of component lifecycle scheduling and presence conditions;run_onfields from strategy stages;every_step.This gives the two execution sections distinct responsibilities:
strategydescribes control structure/order/loop semantics, whilephasesdescribes when each named model runs.Validation
113 passed, 2 skippedinsrc/mobius/integrations/onnx_genai/git diff --checkpassedThis is intentionally coordinated with the ONNX GenAI schema/runtime PR and does not preserve the duplicated composite representation.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com