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

[Good First Issue][NNCF]: Optimize memory footprint by removing redundant collected statistics #2557

Closed
kshpv opened this issue Mar 7, 2024 · 8 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@kshpv
Copy link
Collaborator

kshpv commented Mar 7, 2024

Context

One of the most frequently used algorithm inside NNCF is PostTrainingQuantization.

This algorithm operates within a pipeline structure, comprising multiple steps. Each step is independent and may involve the iterative application of one or more algorithms to a model.

During the execution of each step, all statistics points requested by all participating algorithms are gathered. Then, based on the provided statistics points, statistics are collected for all algorithms inside the step and preserved throughout the entire step's lifecycle.

Need to note that some statistics could be utilized by more than one algorithm, some - only by one.

What is statistic point? - https://github.com/openvinotoolkit/nncf/blob/develop/nncf/common/tensor_statistics/statistic_point.py#L20
How does the statistics point collection for a step looks like? - https://github.com/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/pipeline.py#L170
How does the execution of a step looks like? - https://github.com/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/pipeline.py#L95

What needs to be done?

The objective is to minimize memory usage following the execution of an algorithm within a pipeline step by eliminating redundant statistics that are solely utilized by previously applied algorithms.

  • Implement a function in the StatisticPointsContainer class that enables the removal of statistics points associated with a particular algorithm.
  • Integrate this function into the pipeline workflow, calling it after each algorithm application.
  • Evaluate the impact of these changes on memory consumption using NNCF examples for Torch, TensorFlow, OpenVINO, and ONNX.
  • Write a test covering the proposed functionality.

Example Pull Requests

N/A

Resources

Contact points

@kshpv

Ticket

120377

@kshpv kshpv added the good first issue Good for newcomers label Mar 7, 2024
@kshpv kshpv moved this to Contributors Needed in Good first issues Mar 7, 2024
@awayzjj
Copy link

awayzjj commented Mar 7, 2024

.take

Copy link

github-actions bot commented Mar 7, 2024

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

@awayzjj awayzjj removed their assignment Mar 8, 2024
@AdiKsOnDev
Copy link
Contributor

.take

Copy link

github-actions bot commented Mar 8, 2024

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

@kshpv
Copy link
Collaborator Author

kshpv commented Mar 8, 2024

I will be out on the following week. Please, contact @KodiaqQ for any questions.

@AiGaf1
Copy link

AiGaf1 commented Mar 9, 2024

.take

Copy link

github-actions bot commented Mar 9, 2024

Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor. Please communicate with the assigned contributor to confirm the status of the issue.

@alexsu52 alexsu52 moved this from Contributors Needed to Assigned in Good first issues Mar 11, 2024
@alexsu52 alexsu52 moved this from Assigned to In Review in Good first issues Mar 11, 2024
@kshpv
Copy link
Collaborator Author

kshpv commented Apr 8, 2024

After conducting experiments with #2563, it was observed that the proposed changes have negligible impact. Therefore, the decision was made not to merge them and to close the issue.

@kshpv kshpv closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2024
@github-project-automation github-project-automation bot moved this from In Review to Closed in Good first issues Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants