Skip to content

Make quantization config parameters searchable#2573

Open
shaahji wants to merge 2 commits into
mainfrom
shaahji/tencent
Open

Make quantization config parameters searchable#2573
shaahji wants to merge 2 commits into
mainfrom
shaahji/tencent

Conversation

@shaahji

@shaahji shaahji commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Make quantization config parameters searchable

  • Updated SelectiveMixedPrecision & generic quant_config parameters to be searchable. Each is updated with reasonable searchable constants.
  • Fixed an aliasing issue when processing footprints

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

Callers pass kwargs by field alias
(e.g. Footprint.record forwards `model_config=...`),
matching how FootprintNode(**kwargs) constructs a node. Pydantic accepts
aliases at construction time, but setattr only accepts real field names.
Since `model_config` is reserved by Pydantic v2, the field is declared as
`model_config_data` with alias="model_config", so a raw
setattr(self, "model_config", v) raises "FootprintNode object has no
field model_config". Map aliases back to field names first.
Copilot AI review requested due to automatic review settings July 16, 2026 20:23
@shaahji
shaahji enabled auto-merge (squash) July 16, 2026 20:23
Comment thread olive/search/search_parameter.py Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances Olive’s search-mode usability by making key quantization-related pass config parameters explicitly searchable (via search_defaults) and fixes a footprint update bug caused by Pydantic field aliasing.

Changes:

  • Added a CategoricalBool search parameter alias for clearer boolean search defaults in pass configs.
  • Expanded/added search_defaults for quantization and selective mixed precision parameters so they can participate in search.
  • Fixed FootprintNode.update to correctly handle Pydantic field aliases (e.g., model_config).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
olive/search/search_parameter.py Adds CategoricalBool as a readability-oriented alias for boolean categorical search parameters.
olive/passes/pytorch/selective_mixed_precision.py Broadens and adds searchable defaults for selective mixed precision parameters (algorithm/bits/group sizes/bools/ratio).
olive/passes/pytorch/quant_utils.py Adds searchable defaults for shared quantizer config parameters used by multiple PyTorch quantization passes.
olive/passes/pytorch/gptq.py Makes damp_percent searchable via categorical defaults.
olive/engine/footprint.py Fixes footprint node updates when callers pass field aliases (notably model_config).

Comment thread olive/passes/pytorch/selective_mixed_precision.py
Comment thread olive/passes/pytorch/selective_mixed_precision.py Outdated
Comment thread olive/passes/pytorch/selective_mixed_precision.py Outdated
Comment thread olive/passes/pytorch/selective_mixed_precision.py Outdated
Comment thread olive/passes/pytorch/quant_utils.py Outdated
Updated SelectiveMixedPrecision & generic quant_config parameters to be
searchable. Each is updated with reasonable searchable constants.

Remove CategoricalBool; served no purpose as it was a duplicate of
Boolean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants