Rename SelectiveMixedPrecision heuristic algorithms - #2643
Conversation
Replace misleading k_quant heuristic names with descriptive high_precision names while preserving deprecated aliases for existing configurations and callers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1d9a8b1f-9b83-4a52-bfe4-92437196e1c1
There was a problem hiding this comment.
Pull request overview
This PR renames SelectiveMixedPrecision’s heuristic algorithm identifiers from the misleading k_quant_* names to descriptive high_precision_* names, while keeping legacy strings and helper APIs working via deprecation warnings. This helps reduce confusion with the separate KQuant pass and makes mixed-precision intent clearer to users.
Changes:
- Renamed heuristic algorithms to
high_precision_lm_head,high_precision_mlp, andhigh_precision_mlp_qkv, with legacyk_quant_*strings mapped viaFutureWarning. - Added/updated unit tests to validate warning behavior, schema/search exposure, and algorithm validation.
- Updated documentation and clarified that ORT GenAI ModelBuilder
int4_algo_configvalues are unrelated and remain unchanged.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
olive/passes/pytorch/selective_mixed_precision.py |
Introduces new canonical heuristic names, legacy-string normalization with warnings, and renames the helper to get_high_precision_config while keeping get_k_quant_config deprecated. |
test/passes/pytorch/test_selective_mixed_precision.py |
Updates end-to-end heuristic tests to new names and adds deprecation/normalization/schema coverage tests. |
olive/passes/onnx/model_builder.py |
Adds a clarifying comment that int4_algo_config values are forwarded to ORT GenAI and unrelated to SelectiveMixedPrecision’s algorithm enum. |
docs/source/blogs/quant-slms.md |
Updates the blog to reference the new high_precision_* mixed-precision configurations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
olive/passes/pytorch/selective_mixed_precision.py:663
- Direct access to these deprecated Python names does not emit the promised
FutureWarning: standard Enum alias lookup returns the canonical member directly and never invokes_missing_, which only handles value construction such asAlgorithm("k_quant_down"). The new test likewise accessesAlgorithm.K_QUANT_DOWNwithout expecting a warning. Please either add and test a warning-aware mechanism for deprecated member access or narrow the PR's compatibility/deprecation contract.
# Deprecated Python API names. Their canonical values make these Enum aliases, so normal
# iteration (and consequently schema/search generation) only exposes the canonical names.
K_QUANT_LAST = "high_precision_lm_head"
K_QUANT_DOWN = "high_precision_mlp"
K_QUANT_MIXED = "high_precision_mlp_qkv"
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1d9a8b1f-9b83-4a52-bfe4-92437196e1c1
Describe your changes
Rename the misleading
k_quant_*SelectiveMixedPrecision heuristic names to describe which layers are promoted to high precision:k_quant_last->high_precision_lm_headk_quant_down->high_precision_mlp_downk_quant_mixed->high_precision_mlp_down_qkvLegacy configuration strings remain available and emit
FutureWarning. Deprecated Python enum names remain available as silent aliases, whileget_k_quant_configremains available and emitsFutureWarning. The independent ORT GenAI ModelBuilderint4_algo_configvalues remain unchanged. Tests and quantization documentation are updated accordingly.Checklist before requesting a review
lintrunner -aRelease note: SelectiveMixedPrecision now exposes descriptive
high_precision_*names for its layer-based heuristics. Existingk_quant_*configuration strings continue to work with deprecation warnings.(Optional) Issue link
Related to #2638.