Repository navigation
Add Ministral-3-3B VLM olive-recipe demo + enhance genai integration - #161
Conversation
Performance Comparison
|
There was a problem hiding this comment.
Pull request overview
Adds a complete, self-contained Olive-recipe-style end-to-end demo under examples/olive/ministral-3-3b-vlm/ for exporting and running the Ministral-3-3B vision-language model using Olive (text decoder) plus mobius (vision/embedding), with ORT GenAI inference and an AI2D eval script.
Changes:
- Introduces an export/optimize driver (
optimize.py) that runs Olive for the text decoder, mobius for vision+embedding, and then patches GenAI runtime configs/tokenizer metadata. - Adds runnable inference (
inference.py) and AI2D benchmark evaluation (eval.py) scripts. - Adds CPU/CUDA Olive configs, example-specific requirements, and documentation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/olive/ministral-3-3b-vlm/user_script.py | Lazy HF config loader exposing model constants used by the pipeline. |
| examples/olive/ministral-3-3b-vlm/requirements.txt | Example dependency list for running the recipe. |
| examples/olive/ministral-3-3b-vlm/README.md | Step-by-step instructions for export, inference, and evaluation. |
| examples/olive/ministral-3-3b-vlm/optimize.py | End-to-end export/assembly/config generation script (Olive + mobius). |
| examples/olive/ministral-3-3b-vlm/inference.py | ORT GenAI text+image inference CLI (including interactive mode). |
| examples/olive/ministral-3-3b-vlm/eval.py | AI2D multiple-choice evaluation for ONNX and optional PyTorch comparison. |
| examples/olive/ministral-3-3b-vlm/cuda/text.json | Olive ModelBuilder config for CUDA FP16 decoder export. |
| examples/olive/ministral-3-3b-vlm/cpu_and_mobile/text.json | Olive ModelBuilder config for CPU INT4 decoder export. |
| examples/olive/ministral-3-3b-vlm/.gitignore | Ignores generated model artifacts and Olive cache for the example. |
|
The author of this PR, titaiwangms, is not an activated member of this organization on Codecov. |
|
@justinchuby Can you elaborate more regarding having olive recipe e2e but mostly mobius-based? The example would be not runnable without having genai and olive-recipe though. What kind of code and docs do you have in mind in this PR scope? Like a offline example? Would it be more helpful we write it as a SKILL.md if it's for better shipping? |
9726f46 to
95309a7
Compare
What I was thinking was a demonstration of a olive pipeline that leverages mobius fully + quantization with Olive, which will produce model components that can be run by genai / foundry local. This can be a demo on how we expect users to ship model. We may iterate on this until we feel good about formalizing as a skill. For now it should remain an example as a proof of concept. |
dc845cf to
a00bbe1
Compare
justinchuby
left a comment
There was a problem hiding this comment.
Thanks! Hopefully it has been validated locally?
528d760 to
e0ec3d4
Compare
09a97e0 to
373556c
Compare
373556c to
5192004
Compare
|
I will merge Ministral-3-3B to olive-recipe first. |
60dcd76 to
be90928
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds an end-to-end Olive-recipe style demo for exporting/running the Ministral-3-3B VLM under examples/olive/, and extends the ORT GenAI integration to better support VLM processor configs (including Pixtral) plus tokenizer compatibility fixes.
Changes:
- Enhanced ORT GenAI export to write a full vision processor transform pipeline (
processor_config.json) for VLMs (with Pixtral-specific steps) and added tokenizer config/chat-template fixups. - Added/updated unit tests covering new ORT GenAI config + processor/tokenizer behaviors.
- Added a Ministral-3-3B VLM Olive demo directory with export, inference, evaluation scripts, and sample Olive configs.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/mobius/integrations/ort_genai/auto_export.py |
Adds processor pipeline generation, tokenizer class remap, and chat template fixups in ORT GenAI artifact export. |
src/mobius/integrations/ort_genai/auto_export_test.py |
Adds tests for the new processor pipeline format, Pixtral-specific pipeline, and tokenizer/chat-template fixups. |
src/mobius/integrations/ort_genai/genai_config_test.py |
Adds a regression test for decoder filename subdirectory handling in VLM configs. |
examples/olive/ministral-3-3b-vlm/requirements.txt |
Documents example dependencies for export/inference/eval. |
examples/olive/ministral-3-3b-vlm/optimize.py |
Adds an export script using mobius + optional Olive quantization for the text decoder. |
examples/olive/ministral-3-3b-vlm/inference.py |
Adds an ORT GenAI inference script supporting text-only and image+text prompts. |
examples/olive/ministral-3-3b-vlm/eval.py |
Adds an AI2D evaluation script comparing ONNX (ORT GenAI) vs HF PyTorch. |
examples/olive/ministral-3-3b-vlm/cuda/text.json |
Olive config for CUDA FP16 ModelBuilder export/quantization of the text decoder. |
examples/olive/ministral-3-3b-vlm/cpu_and_mobile/text.json |
Olive config for CPU/mobile INT4 ModelBuilder export/quantization of the text decoder. |
examples/olive/ministral-3-3b-vlm/README.md |
Documents setup, export, output layout, inference, and evaluation for the demo. |
examples/olive/ministral-3-3b-vlm/.gitignore |
Ignores generated artifacts for the example. |
.github/copilot-instructions.md |
Updates contributor guidance about squashing/batching commits to reduce CI churn. |
d67c8d2 to
1fdbd08
Compare
Enhance _write_processor_config in ort_genai auto_export to generate full image transform pipeline for Pixtral VL models. Add tokenizer class remapping (TokenizersBackend -> LlamaTokenizer). Update examples/olive/ministral-3-3b-vlm/ to leverage the enhanced genai integration with optional Olive quantization. Closes #158 Co-authored-by: Copilot <[email protected]> Signed-off-by: Ti-Tai Wang <[email protected]>
1fdbd08 to
c280900
Compare
Critical: - Add missing Permute3D + PixtralImageSizes transforms to Pixtral pipeline (5 steps → 7 steps, matching olive-recipes reference) - Fix config_filename mismatch: Pixtral with_vision() now passes config_filename="processor_config.json" (was using default "image_processor.json") Medium: - Extract _build_vision_transform_pipeline() shared helper to DRY the Pixtral and generic VLM branches (~80 duplicated lines removed) Low: - Add mistral3 to _ORT_GENAI_MODEL_TYPE + _PIXTRAL_MODEL_TYPES - Update module docstring to mention processor_config.json - Improve pixtral test: verify 7-step pipeline, all transform types in order, Permute3D dims, and output filename Co-authored-by: Copilot <[email protected]>
c280900 to
0f8d8ab
Compare
Summary
Add an end-to-end olive-recipe demo for Ministral-3-3B VLM and enhance the mobius genai integration with Pixtral processor config support and tokenizer class remapping.
Changes
Core: genai integration enhancements (
src/mobius/integrations/ort_genai/)_write_processor_config: Enhanced to generate full ORT-extensions image transform pipeline for VL models. Dispatches by model type (Pixtral: longest_edge resize; generic: smart_resize). Derives normalization params from HF processor config._fix_tokenizer_config: New function with_TOKENIZER_CLASS_REMAPdict to remap unsupported tokenizer classes (e.g.TokenizersBackend→LlamaTokenizer). Called automatically fromwrite_ort_genai_config().Example: olive-recipe demo (
examples/olive/ministral-3-3b-vlm/)build()→save()→write_ort_genai_config()) with optional Olive quantization via--olive-configSkills
olive-recipeskill documenting the mobius + Olive hybrid pipeline patternort-genai-configskill with Pixtral processor config and tokenizer remap infoReferences
Closes #158