Repository navigation
Align inference metadata batching contract - #636
Merged
Merged
Conversation
Remove retired profile-wide batch invariance production and its CTC graph metadata source. Keep unproven encoders fail closed by omitting component batch_capacity, sync the merged onnx-genai schema, regenerate affected fixtures, and add producer/schema conformance coverage. Signed-off-by: justinchuby <[email protected]> Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns Mobius’s ONNX GenAI inference metadata with the updated batching contract by retiring profiles.*.batch_invariance emission, omitting component batch_capacity unless explicitly authored, and syncing the vendored schema + fixtures to the referenced onnx-genai revision.
Changes:
- Remove production and test expectations for retired batching declarations (
batch_invariance,continuous_batching) and drop the CTC graph-side metadata source used to infer them. - Add schema-driven conformance checks for workflow fixtures (JSON Schema validation + regeneration parity) and extend unit coverage to ensure producers/fixtures never serialize retired fields.
- Vendor the updated onnx-genai
inference_metadata.schema.jsonand refresh checked-in workflow fixtures accordingly.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/wav2vec2_ctc_metadata_integration_test.py | Updates integration assertions to reflect retired batch_invariance and fail-closed capacity behavior. |
| tests/fixtures/onnx_genai_workflows/protbert_protein_embeddings/inference_metadata.yaml | Removes retired batch_invariance from fixture metadata. |
| tests/fixtures/onnx_genai_workflows/esm2_protein_embeddings/inference_metadata.yaml | Removes retired batch_invariance from fixture metadata. |
| tests/canonical_workflow_contract_test.py | Adds “no retired batching fields” assertions, validates fixtures against the vendored schema, and checks fixture regeneration parity. |
| src/mobius/tasks/_ctc_asr.py | Removes the graph metadata propagation used to encode padding sensitivity for later metadata inference. |
| src/mobius/models/wav2vec2.py | Removes batch_padding_sensitive property now that batching permission isn’t inferred from normalization. |
| src/mobius/integrations/onnx_genai/workflow_metadata.py | Stops emitting batch_invariance and documents that batch_capacity is intentionally omitted unless explicitly authored. |
| src/mobius/integrations/onnx_genai/encoder_embedding_metadata_test.py | Adds conformance tests for schema surface + fixture regeneration parity; updates batching assertions. |
| src/mobius/integrations/onnx_genai/ctc_runtime_test.py | Removes padding-sensitivity inference tests and asserts batching permission is not inferred. |
| src/mobius/integrations/onnx_genai/_schema/README.md | Updates the referenced upstream schema revision. |
| src/mobius/integrations/onnx_genai/_schema/inference_metadata.schema.json | Vendors the updated upstream schema (including the new component batch_capacity contract and other upstream changes). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🏗️ Architecture Diff
gpt2 / model — 37 change(s)Op summary: 54 → 54 nodes No op-sequence changes. Connectivity changes:
Initializer changes:
Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
justinchuby
added a commit
that referenced
this pull request
Aug 26, 2026
## Summary - promote `bailingmoe`, original `deepseek`, and `dots1` from deferred to exact GGUF config/tensor-map/graph support while keeping runtime support deferred - preserve authoritative routing contracts: Bailing full-softmax top-k; DeepSeek unnormalized softmax top-k; Dots1 metadata-selected softmax/sigmoid, selection-only correction bias, pinned `2^-14` normalization floor, and route scaling - validate exact dense-prefix/routed/shared-expert schedules, including all-dense DeepSeek/Dots1 files with absent or zero inactive expert metadata - enforce full-head RoPE for all three, full MHA for Dots1, complete supported YaRN metadata, pinned beta/attention defaults, and fail-closed rejection of unsupported scaling - close tensor families and shapes, packed fused-QKV splits, bias alternatives, shared experts, output ownership, auxiliary quantization sidecars, and out-of-range tensors - preserve llama.cpp Q/K inverse permutation for Bailing/DeepSeek while retaining Dots1's Qwen2 checkpoint row order across F32 and Q4 packed weights/scales/zero-points - preserve existing PhiMoE output-head, GLM-MoE-DSA CPU/grouped-routing, LFM2MoE correction-bias, dense/multimodal/specialized/runtime/package, inference-metadata, and Qwen3.5 ORT GenAI contracts ## Exact base and head - base: `c8803afb8251136e850010aba2cc4b8bf9854082` (includes #636, #638, and #631) - head: `6df92b6c80e250fe45d1a6378426fb55220cc045` - the isolated 12-commit MoE series was replayed conflict-free onto this exact live-main SHA and force-updated with a lease against old remote head `a66de72595afdfdb9d94da9fad0b361ffd1803cf` ## Evidence - focused registry/config/tensor/processor/closure/builder/docs/model suite: `1899 passed, 1 skipped` - shared MoE/build regression suite: `204 passed, 8 skipped, 1374 deselected` - broad serial non-integration: `8120 passed, 57 skipped, 12 deselected, 1 subtest passed`, explicit `PYTEST_EXIT=0` - promoted packed fused-QKV value/runtime coverage includes F32 and Q4_0 weights, scales, zero-points, biases, graph construction, and ORT execution - initialized all-files lint: clean - generated GGUF documentation closure: clean - final GPT-5.6 Sol medium architecture review: approved, no findings - final GPT-5.6 Sol medium regression review: approved, no findings An intermittent libc++ `recursive_mutex` teardown diagnostic was previously reproduced after an assertion-clean parallel run. It did not reproduce in the serial GGUF builder probe or final serial broad suites; clean serial process exits are the publication evidence. ## Runtime waiver Runtime remains `DEFERRED` for all three promotions. No practical immutable small real-weight GGUF artifact was available to establish full CLI/ORT GenAI generation parity without downloading production-scale checkpoints. Graph execution, synthetic numerical routing parity, packed tensor value checks, and ORT execution are covered; runtime metadata does not claim support from architecture-name matching. ## Residual deferred MoE Different whole-model contracts remain separate batches: - `ernie4_5-moe`, `hunyuan-moe`, `minimax-m2`, `mellum`: unmatched per-layer schedules or Q/K norm/RoPE ordering - `arctic`, `dbrx`, `grok`, `smallthinker`: incompatible residual topology, norm order/type, fused/clamped attention, scaling/softcaps, router input, expert activation, or per-layer RoPE - `afmoe`, `laguna`, `granite_swa`, conditional `granite`/`minicpm`: unmatched gates, SWA/cache contracts, architecture scales, or value transforms - `grovemoe`: grouped dual-bank routing is unsupported - `gpt-oss`: value-changing MXFP4 packed expert conversion is unsupported - `minimax-m3`: second sparse-index cache ABI is unsupported - `bailingmoe3`, `deepseek4`, Kimi/DeltaNet/Mamba hybrids: heterogeneous recurrent/compressed state ABI - DeepSeek NextN/MTP families: executable MTP/cache ABI is owned by the separate deferred MTP batch - multimodal MoE backbones remain excluded from this text-only cohort --------- Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[email protected]>
justinchuby
added a commit
that referenced
this pull request
Aug 26, 2026
## Summary - explicitly author `batch_capacity` for audited row-independent decoder, image-diffusion, video, TTS, and adapter workflow components - derive uniform non-request dimensions only after that semantic permission is explicit, and stamp schema v1.1 - preserve hierarchical audio's fixed 2-row internal expansion as `request_expanded` instead of misclassifying it as two requests - generalize request-axis discovery to the unique `batch` symbol, including multi-axis rotary tensors - regenerate all affected producer fixtures and add mutation-sensitive capacity, legacy, YAML/schema round-trip, and image/video/audio coverage ## Root cause and authority onnx-genai's runtime admission is intentionally fail-closed: absent `batch_capacity` means exactly one logical request per component invocation. Mobius had updated to the new schema but still omitted the semantic permission from workflows whose conformance tests intentionally execute multiple rows. Shapes can locate a request axis, but cannot prove row independence, so the runtime check is not relaxed and capacity is not inferred from a dynamic leading dimension. The seven signal failures were producer-side metadata gaps: - decoder: `decoder_state_initializer` - Euler image diffusion: `tensor_scale` - parameter adapters: `overlay` - guided image diffusion: `latent_noise` - video diffusion: `video_latent_init` - TTS: `tts_state_initializer` - hierarchical audio: `global_initializer` used `request_aligned` for a fixed 2-row expansion; this is corrected to `request_expanded` This follows onnx-genai #2009, #2010, and runtime admission #2137, while preserving Mobius #636's rule that unproven ESM/ProtBERT encoders remain capacity-absent. ## Validation - exact producer generation + fixture comparison: all 15 packages matched - onnx-genai `validate_metadata`: all 15 generated packages valid - onnx-genai workflow conformance with ORT 1.29.0: **15 passed, 0 failed** - onnx-genai `encoder_batching`: **109 passed** - onnx-genai capacity-removal mutation: `undeclared_capacity_never_admits_multiple_requests` passed - Mobius metadata producer selection: **350 passed, 3 skipped, 60 deselected** - focused post-rebase coverage: **60 passed** - Ruff check + format check: passed - onnx-genai Clippy (`onnx-genai-metadata`, `onnx-genai-engine`, all targets, warnings denied): passed Original failing signal: https://github.com/justinchuby/onnx-genai/actions/runs/32925051072 Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot <[email protected]> Copilot-Session: d60eb808-7cc6-4abc-b48d-2a6dd3841624
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
profiles.*.batch_invarianceproduction and its CTC graph-metadata sourcebatch_capacitywhen grouped semantics have not been explicitly authoredcb7baf924, regenerate ESM-2/ProtBERT fixtures, and validate every generated workflow fixtureValidation
PYTHONPATH="$PWD/src" python3 -m pytest src/mobius/integrations/onnx_genai/encoder_embedding_metadata_test.py src/mobius/integrations/onnx_genai/ctc_runtime_test.py tests/canonical_workflow_contract_test.py -q --tb=short --basetemp=.pytest_metadata— 302 passedPYTHONPATH="$PWD/src" python3 -m pytest src/mobius/integrations/onnx_genai/ -q --tb=short --basetemp=.pytest_metadata— 318 passedqwen_image_test.py— 7,843 passed, 50 skippedgit diff --checkThe unfiltered fast suite has five pre-existing Qwen Image failures caused by the installed Diffusers
QwenEmbedRopeAPI drift (max_txt_seq_lenremoved /txt_seq_lensnow required); no Qwen Image files are changed here.Post-merge republish
Regenerate and republish these Mobius-produced hosted examples so their provenance returns to the canonical producer (their currently corrected metadata already omits the retired field):
justinchuby/onnx-genai-example-esm2-t6-8mjustinchuby/onnx-genai-example-prot-bert