Skip to content

Support reproducible text-only MobiusBuilder exports - #2634

Open
Ti-Tai Wang (titaiwangms) wants to merge 4 commits into
mainfrom
titaiwang/mobius-builder-forward-revision
Open

Support reproducible text-only MobiusBuilder exports#2634
Ti-Tai Wang (titaiwangms) wants to merge 4 commits into
mainfrom
titaiwang/mobius-builder-forward-revision

Conversation

@titaiwangms

@titaiwangms Ti-Tai Wang (titaiwangms) commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

Extend MobiusBuilder so direct exports can reproducibly select the text backbone of supported multimodal checkpoints:

  • forward the input HfModelHandler revision to mobius.build;
  • expose an optional text_only pass setting, defaulting to false;
  • pass text_only=True to Mobius only when explicitly requested, preserving compatibility for existing recipes;
  • keep Mobius task auto-detection unchanged;
  • forward the same revision and trust_remote_code policy to ORT GenAI config/tokenizer asset generation.

text_only selects the model architecture during Mobius build. It is intentionally distinct from components_to_export, which filters components after a package has already been built and therefore cannot produce a complete standalone runtime package by itself.

This enables VLM-capable checkpoints such as Qwen/Qwen3.6-35B-A3B to produce a single standalone text decoder with root-level model.onnx and decoder-only GenAI configuration while keeping weights and tokenizer assets on one immutable Hugging Face revision.

Validation

  • 35 MobiusBuilder tests passed
  • coverage for default omission and explicit forwarding of text_only
  • coverage that the HfModel task is not forwarded and Mobius continues auto-detection
  • coverage for revision/trust forwarding to both build and GenAI config generation
  • existing components_to_export regression coverage preserved
  • targeted lint/format and diff checks passed; only the repository's pre-existing CPY001 header findings reproduce on the unchanged base files

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all relevant tests can pass.
  • Update public pass configuration documentation in the implementation docstring.
  • Lint and apply fixes.
  • Include a user-facing release note.

Release note: MobiusBuilder can now export a supported multimodal checkpoint's standalone text backbone while honoring the configured Hugging Face revision for weights and runtime assets.

Ensure direct Mobius exports use the requested model snapshot so unquantized baselines remain comparable with quantized workflows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e10674c1-6909-4b09-9f5a-d41b28c89d2d
Copilot AI lite review requested due to automatic review settings August 20, 2026 20:43

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

This pull request updates Olive’s MobiusBuilder ONNX pass to forward the Hugging Face model revision (from HfModelHandler load kwargs) into mobius.build, ensuring exports stay pinned to the intended Hugging Face snapshot and aligning behavior with workflows that materialize a local pinned checkpoint upstream.

Changes:

  • Forward revision from HfModelHandler.get_load_kwargs() into mobius.build(...).
  • Add a unit test asserting that the revision kwarg is passed through to mobius.build.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
olive/passes/onnx/mobius_model_builder.py Extracts revision from HF load kwargs and passes it into mobius.build to pin exports to the requested snapshot.
test/passes/onnx/test_mobius_model_builder.py Adds a unit test that verifies the revision kwarg is forwarded to mobius.build.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Expose Mobius text-only architecture selection and keep generated runtime assets on the same immutable Hugging Face revision.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 72aa2acc-7ef6-4fe4-b760-921d80d29dd7
@titaiwangms Ti-Tai Wang (titaiwangms) changed the title Forward Hugging Face revision to MobiusBuilder Support reproducible text-only MobiusBuilder exports Aug 26, 2026
@xiaoyu-work

Copy link
Copy Markdown
Collaborator

do we still need this?

@titaiwangms

Copy link
Copy Markdown
Contributor Author

Yes, this is still needed for two reasons:

  1. components_to_export selects which components are saved after Mobius has built a model. It does not change the model architecture. For example, filtering a VLM package to decoder leaves a decoder whose input is inputs_embeds; it does not produce the standalone text model whose root input is input_ids.
  2. A direct FP16 export of a VLM-capable checkpoint such as Qwen/Qwen3.6-35B-A3B needs a model-level selection before the build so Mobius chooses the registered text sibling and generates a complete decoder-only package. Quantized flows can appear to work without it because an upstream quantization pass first materializes a local text model.

The revision forwarding is also still needed: MobiusBuilder otherwise drops the revision from the input HfModelHandler, and model weights plus GenAI/tokenizer assets may be resolved from different snapshots.

The distinction may be clearer if the Olive-facing setting is named model_to_export: "text" rather than exposing Mobius' boolean text_only; components_to_export would remain the separate package-component filter. I can make that naming change in this PR if preferred.

Replace misleading k_quant heuristic names with descriptive high_precision names while preserving deprecated aliases for existing configurations and callers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1d9a8b1f-9b83-4a52-bfe4-92437196e1c1
@justinchuby

Copy link
Copy Markdown
Contributor

LGTM. Would leave to Jambay Kinley (@jambayk) Xiaoyu (@xiaoyu-work) for an approval

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.

4 participants