Fix ort genai model builder compatible issue - #2665
Merged
Merged
Conversation
Use the new quantized loader modules and public group_size setter without legacy compatibility. Require GenAI 0.16 in test environments and align the Qwen3 smoke model special tokens with its tokenizer.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Two unresolved critical findings remain in olive/passes/onnx/model_builder.py.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This pull request updates ORT GenAI ModelBuilder compatibility for newer loader layouts and quantized models, with expanded regression coverage.
Changes:
- Updates quantization loader integration and group-size handling.
- Adds loader-patching and quantization tests.
- Aligns Qwen3 token configuration.
- Cleans up test requirements formatting.
File summaries
| File | Summary |
|---|---|
test/requirements-test-cpu.txt |
Removes extraneous formatting. |
test/passes/onnx/test_model_builder.py |
Adds loader and quantization regression coverage. |
test/cli/test_cli_test_model_smoke.py |
Validates matching Qwen3 token IDs. |
olive/passes/onnx/model_builder.py |
Updates loader patching and quantized tensor handling. Critical (3 votes, line 493): unconditional newer loader imports break older ORT GenAI versions. Critical (1 vote, line 585): group_size=-1 must be normalized to the input dimension. |
Review details
Suppressed comments (1)
olive/passes/onnx/model_builder.py:585
- Changing the assignment from
_group_sizetogroup_sizeis only valid for the new loader class, which added a writable setter. The legacyQuantizedTensorModuleexposesgroup_sizeas a read-only property backed by_group_size, so a legacy fallback would raiseAttributeErrorwhile loading every quantized tensor; use a compatibility helper or assign the appropriate backing field for each loader version.
for q_attr, q_value in [("bits", local_bits), ("group_size", local_group_size)]:
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Jambay Kinley (jambayk)
approved these changes
Sep 14, 2026
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
Fix ort genai model builder compatible issue
Checklist before requesting a review
lintrunner -a(Optional) Issue link