Add Mobius exporter support to olive optimize - #2658
Open
Tommaso Adani (tadani3) wants to merge 4 commits into
Open
Add Mobius exporter support to olive optimize#2658Tommaso Adani (tadani3) wants to merge 4 commits into
Tommaso Adani (tadani3) wants to merge 4 commits into
Conversation
Copilot started reviewing on behalf of
Tommaso Adani (tadani3)
September 10, 2026 22:34
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Three moderate issues remain involving MCP precision validation, OpenVINO pass scheduling, and Mobius splitting.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds mobius exporter support to olive optimize, including precision handling, test-model reuse, MCP dependency resolution, documentation, and tests.
Changes:
- Adds Mobius exporter scheduling and validation.
- Reuses saved test-model weights for discrepancy checks.
- Updates MCP package discovery and documentation.
File summaries
| File | Description |
|---|---|
test/passes/onnx/test_mobius_model_builder.py |
Tests Mobius test-model handling. |
test/mcp/test_packages.py |
Tests MCP dependency resolution. |
test/cli/test_cli.py |
Tests Mobius CLI scheduling and validation. |
olive/passes/onnx/mobius_model_builder.py |
Uses saved local test models for export. |
olive/cli/optimize.py |
Adds Mobius exporter configuration and pass scheduling. |
mcp/src/olive_mcp/tools.py |
Documents Mobius options. |
mcp/src/olive_mcp/packages.py |
Adds mobius-onnx dependency resolution. |
docs/source/reference/python_api.md |
Documents Mobius requirements and supported precisions. |
Review details
Suppressed comments (2)
mcp/src/olive_mcp/packages.py:130
- MCP preflight validation does not enforce Mobius's precision restriction:
optimize(exporter="mobius", precision="int4")passes_validate_params, causes this dependency setup (and even addsdatasets), and only fails later when the Olive CLI rejects the precision. Mirror the fp32/fp16/bf16 check in the MCP validation so invalid jobs are rejected before creating a virtual environment.
elif exporter == "mobius":
extra_packages.append("mobius-onnx")
olive/cli/optimize.py:515
- The new Mobius path leaves
--num_split/--memorycombinations enabled. Those options scheduleCaptureSplitInfobefore this exporter andSplitModelafterward;SplitModelreadssplit_assignmentsonly from ONNX metadata, while MobiusBuilder only carries the assignments in the returned handler attributes and does not annotate the exported graph, so the workflow reachesNo split assignments found in the model metadata. Reject splitting with Mobius or propagate the assignments into the exported ONNX metadata.
return self.is_hf_model and self.args.exporter == "mobius"
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+513
to
+515
| def _enable_mobius_builder_pass(self) -> bool: | ||
| """Return true if condition to add MobiusBuilder pass is met.""" | ||
| return self.is_hf_model and self.args.exporter == "mobius" |
Member
|
duplicated as #2640? |
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.
Describe your changes
Adds Mobius exporter support to
olive optimize.mobiusto the supported--exportervalues while preservingmodel_builderas the default.MobiusBuilderas the sole initial ONNX exporter.fp32,fp16, andbf16.--test, ensuring discrepancy checks use identical weights.mobius-onnxto MCP dependency discovery.Testing
Checklist before requesting a review
lintrunner -a.Release notes
olive optimizenow supports--exporter mobius. Mobius export requiresmobius-onnxand supportsfp32,fp16, andbf16. In test mode, theMobius-produced ONNX model is exported from the same saved Hugging Face model
used as the discrepancy-check reference.
(Optional) Issue link
N/A