Add ONNX export and quantization skill - #238
Merged
Merged
Conversation
Document the full workflow for exporting models with mobius CLI and quantizing with Olive: - mobius build CLI flags and EP variants (default/cuda/onnx-standard) - INT4 quantization: Q4_K_M (k-quant) and NF4 with Olive - GPU-accelerated quantization with cupy (19-51x speedup) - HuggingFace Hub upload structure and verification - Common issues: MoE weight mapping, hybrid attention, BF16 mismatches - Testing quantized models (L4 golden data, L5 smoke test) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Justin Chu <justinchu@microsoft.com>
Performance Comparison
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new reusable skill document under .agents/skills/ describing the mobius ONNX export workflow and Olive INT4 quantization workflow (aimed at standardizing how Gemma4 exports are produced, validated, and uploaded).
Changes:
- Add a new skill doc for
mobius buildexport flags, EP variants, and multi-model output layout. - Document INT4 quantization approaches (Q4_K_M / NF4), including optional GPU acceleration with cupy.
- Document HuggingFace Hub directory layout, common failure modes, and suggested testing (golden + smoke tests).
titaiwangms
approved these changes
May 4, 2026
Address all 5 review findings plus remove --optimize from examples: 1. Fix --optimize description: clarify it applies mobius rewrite rules (group_query_attention, packed_attention, skip_norm), not general constant folding. Remove from basic command examples since it's optional, not default. 2. Fix EP descriptions: 'default' is portable ONNX (not CPU-specific), 'onnx-standard' inlines custom-domain functions (not DML-specific). Add note about 'mobius list eps' for all available EPs. 3. Replace Olive direct-API snippets with config-driven olive.run() pattern matching the repo's examples/olive/ convention. Reference the ministral example for a complete working setup. 4. Add tokenizer + processor config files to the multi-model quantization copy step — without these ORT GenAI won't load. 5. Replace fabricated generate_golden_data() with the real scripts/generate_golden.py entrypoint and compare_golden() from mobius._testing.parity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Justin Chu <justinchu@microsoft.com>
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.
Document the Gemma4 ONNX export and INT4 quantization workflow as a reusable skill.
What this adds
New skill at
.agents/skills/onnx-export-quantization/SKILL.mdcovering:mobius buildflags, EP variants (default/cuda/onnx-standard), multi-model outputsThis captures the workflow used for the Gemma4 ONNX exports so future model exports follow the same pattern.