Make changes to integrate with Whisper recipes#2450
Open
kunal-vaishnavi wants to merge 6 commits intomainfrom
Open
Make changes to integrate with Whisper recipes#2450kunal-vaishnavi wants to merge 6 commits intomainfrom
kunal-vaishnavi wants to merge 6 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Olive’s ONNX ModelBuilder and related save/quantization logic to better support multi-file ONNX outputs (e.g., Whisper encoder/decoder) produced by the ORT GenAI model builder, while improving output filename/path robustness for downstream passes and cache export.
Changes:
- Extend
ModelBuilderto detect multiple generated.onnxfiles and return aCompositeModelHandlerwith preserved component filenames. - Adjust
OnnxKQuantQuantizationoutput path handling to avoid double.onnxextensions for composite components. - Update cache export for composite ONNX components to avoid appending a second
.onnxsuffix when component names already include it.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
olive/passes/onnx/model_builder.py |
Adds composite/multi-file output support, improves output path handling, and refines additional_files filtering and annotation behavior. |
olive/passes/onnx/kquant_quantization.py |
Tweaks output path formation for composite components to prevent .onnx.onnx outputs. |
olive/cache.py |
Ensures composite ONNX component save/export doesn’t create double .onnx filenames. |
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/43ccb782-c444-474a-b13f-ecb09a594886 Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/43ccb782-c444-474a-b13f-ecb09a594886 Co-authored-by: kunal-vaishnavi <115581922+kunal-vaishnavi@users.noreply.github.com>
Contributor
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
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.
Description
This PR makes changes to work with multiple models produced by model builder.
Motivation and Context
This PR unblocks using model builder to create the Whisper models in Olive recipes such as here.
Copilot Summary
This pull request improves support for multi-file ONNX models (such as Whisper encoder/decoder) and adds robustness to model file handling in the ONNX model builder and quantization passes. The main changes ensure that output file names and paths are handled correctly for both single-file and composite models, and that annotation and metadata logic gracefully handles missing files.
Multi-file/composite model support:
.onnxfiles are generated, constructs aCompositeModelHandlerfor these cases, and ensures that component file names are preserved for downstream passes..onnxextensions to prevent double extensions when handling composite model components..onnxextensions.File handling and robustness:
.onnxfile is found, the builder falls back to using the discovered file and logs this substitution.Output path and metadata management: