Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aggregator.py #2995

Merged
merged 11 commits into from
Oct 17, 2024
Merged

Update aggregator.py #2995

merged 11 commits into from
Oct 17, 2024

Conversation

zina-cs
Copy link
Contributor

@zina-cs zina-cs commented Sep 27, 2024

Changes

Added an error message

Reason for changes

send warning message to avoid Inconsistencies arise when the dataset size is less than the provided or default 'subset_size'.

Related tickets

Closes: #2562

I had an inquiry:
I noticed that subset_size is sometimes put as 100, or 300, or specified in the advanced parameters. Should a default be used here, or could you point me to where I can find the correct subset_size to be imported?

@zina-cs zina-cs requested a review from a team as a code owner September 27, 2024 15:52
@github-actions github-actions bot added the NNCF Common Pull request that updates NNCF Common label Sep 27, 2024
@alexsu52 alexsu52 requested a review from l-bat September 30, 2024 09:41
nncf/common/tensor_statistics/aggregator.py Outdated Show resolved Hide resolved
nncf/common/tensor_statistics/aggregator.py Outdated Show resolved Hide resolved
nncf/common/tensor_statistics/aggregator.py Outdated Show resolved Hide resolved
@zina-cs
Copy link
Contributor Author

zina-cs commented Oct 5, 2024

Great, any other changes required to close this issue?

@l-bat
Copy link
Collaborator

l-bat commented Oct 7, 2024

Great, any other changes required to close this issue?

No, once the PR passes all checks, we’ll merge it

@zina-cs
Copy link
Contributor Author

zina-cs commented Oct 7, 2024

Is a set value to be used for subset_size, or do I import it from somewhere?

@l-bat
Copy link
Collaborator

l-bat commented Oct 8, 2024

Please fix linter
nncf/common/tensor_statistics/aggregator.py:92:121: E501 Line too long (133 > 120)

nncf/common/tensor_statistics/aggregator.py Outdated Show resolved Hide resolved
nncf/common/tensor_statistics/aggregator.py Outdated Show resolved Hide resolved
nncf/common/tensor_statistics/aggregator.py Outdated Show resolved Hide resolved
nncf/common/tensor_statistics/aggregator.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@l-bat l-bat left a comment

Choose a reason for hiding this comment

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

Thank you!

@zina-cs
Copy link
Contributor Author

zina-cs commented Oct 10, 2024

Thank you for your assistance!!

raise nncf.ValidationError(EMPTY_DATASET_ERROR)
if self.stat_subset_size is not None and self.stat_subset_size > processed_samples:
nncf_logger.warning(
f"Dataset contains only {processed_samples} samples, "
Copy link
Contributor

Choose a reason for hiding this comment

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

@l-bat, @eaidova, @nikita-savelyevv please check that this is not impact NNCF examples, OpenVINO notebooks and optimum-intel.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@zina-cs Could you please provide subset_size to the nncf.quantize in the following examples?

  1. https://github.com/openvinotoolkit/nncf/tree/develop/examples/post_training_quantization/openvino:
    • anomaly_stfpm_quantize_with_accuracy_control - subset_size=109
    • yolov8 - subset_size=128
    • yolov8_quantize_with_accuracy_control - subset_size=128
  2. https://github.com/openvinotoolkit/nncf/tree/develop/examples/post_training_quantization/onnx/yolov8_quantize_with_accuracy_control - subset_size=128
  3. https://github.com/openvinotoolkit/nncf/tree/develop/examples/post_training_quantization/torch/ssd300_vgg16 - subset_size=128

@zina-cs zina-cs mentioned this pull request Oct 14, 2024
@alexsu52 alexsu52 merged commit e6a4752 into openvinotoolkit:develop Oct 17, 2024
13 checks passed
alexsu52 pushed a commit that referenced this pull request Oct 21, 2024
### Changes

Add `subset_size` to PTQ samples after merging
#2995 to remove the warning
message
CI: https://github.com/openvinotoolkit/nncf/actions/runs/11436915496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NNCF Common Pull request that updates NNCF Common
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Good First Issue][NNCF]: Dump actual_subset_size to ov.Model
3 participants