Add GenAI runtime profile model variants - #2687
Open
Tianlei Wu (tianleiwu) wants to merge 5 commits into
Open
Tianlei Wu (tianleiwu) wants to merge 5 commits into
Tianlei Wu (tianleiwu) wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved correctness, validation, path-safety, and hardlink-isolation issues remain.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (5)
What changed in this PR
Adds GenAI runtime profiles for configuration overlays and alternate KV-cache decoder graphs, with supporting ModelBuilder updates.
Changes:
- Adds and registers
GenAIModelRuntimeProfiles. - Extends structured builder options and CPU embedding splitting.
- Adds focused tests and configuration registration.
| File | Summary |
|---|---|
test/passes/onnx/test_model_builder.py |
Tests structured configuration and embedding splitting. |
test/passes/onnx/test_genai_runtime_profiles.py |
Tests runtime profile and decoder variant generation. |
olive/passes/onnx/model_builder.py |
Adds structured options and CPU embedding support. |
olive/passes/onnx/genai_runtime_profiles.py |
Implements profile validation, overlays, package copying, and decoder variants. |
olive/olive_config.json |
Registers the new pass. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
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
Add an Olive post-processing pass for ONNX Runtime GenAI memory profiles. A profile can update only
genai_config.json, or derive an alternate KV-cache decoder graph while hardlinking the rest of the generated package and preserving the base external-data file.This replaces #2663 and builds on the composite ModelBuilder support now present on
main. It depends on microsoft/onnxruntime-genai#2622 for runtime profile fields and the KV-cache graph transformer.Key changes
GenAIModelRuntimeProfilesfor configuration-only and alternate-decoder profiles.ModelBuilderstructured configuration forwarding and CPU-embedding split handling needed by the combined Qwen package.model_<profile-id>.onnxfilenames and strip build-onlykv_cachesettings from emitted runtime configuration.Validation
model_32gib.onnx, retained the same hardlinkedmodel.onnx.data, and emitted the requested runtime overlay.python -m ruff check ...andpython -m ruff format --check ...passed on changed Python files.scripts/format_json.py --linter-mode ... olive/olive_config.jsonpassed.pefttest dependency; the focused test body was invoked directly.Checklist before requesting a review
GenAIModelRuntimeProfilespass enables memory-tiered GenAI packages.(Optional) Issue link