Initialize result_scale with default scale in ScaleEstimation#3997
Closed
RinZ27 wants to merge 1 commit intoopenvinotoolkit:developfrom
Closed
Initialize result_scale with default scale in ScaleEstimation#3997RinZ27 wants to merge 1 commit intoopenvinotoolkit:developfrom
RinZ27 wants to merge 1 commit intoopenvinotoolkit:developfrom
Conversation
Collaborator
Author
|
@AlexanderDokuchaev Appreciate you taking this forward in #4039 to ensure broader application and proper test coverage. Handling the fix in a more comprehensive PR seems like the right move. I'll be following the progress there. Thanks for the update! |
AlexanderDokuchaev
added a commit
that referenced
this pull request
Apr 17, 2026
### Changes Support initial_steps and scale_steps to be zero for `calculate_quantization_params` Add tests case for differ steps ### Reason for changes #3997 ### Related tickets ### Tests https://github.com/openvinotoolkit/nncf/actions/runs/24425425305 https://github.com/openvinotoolkit/nncf/actions/runs/24425387669
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.
Changes
Initialized
result_scalewith the defaultscalevalue at the start of thecalculate_quantization_paramsfunction. I noticed that if bothinitial_stepsandscale_stepsare set to zero, the variable remains uninitialized, which would cause an error during the subsequentfns.squeezecall.Reason for changes
This ensures the algorithm is robust even when optimization steps are disabled by the user. While the default configuration uses several steps, I want to make sure the code doesn't crash if someone decides to skip the estimation process entirely.
Related tickets
None
Tests
Verified the fix by manually checking the logic for the edge case where steps are zero. Everything is green in the local environment and the change is a simple safety initialization that doesn't affect the default behavior.