nncf
nncf copied to clipboard
[Good First Issue][NNCF]: Replace common tensor_statistics by experimental tensor_statistics
Context
Historically, NNCF has maintained two sets of tensor statistics: the old tensor statistics and the new tensor statistics. The new tensor statistics, located in the experimental/common/tensor_statistics directory, offer improved functionality and better performance. However, the codebase still contains references to the old tensor statistics, leading to redundancy and potential confusion.
What needs to be done?
- Search the codebase for all instances where the old tensor statistics are being used. This includes algorithms, tests, and any utility functions.
- Modify the identified algorithms to utilize the new tensor statistics from
experimental/common/tensor_statistics. - Update the corresponding tests to ensure they are compatible with the new tensor statistics.
- Replace the contents of
common/tensor_statistics/collectorswith the corresponding implementations fromexperimental/common/tensor_statistics. - Once all references to the old tensor statistics have been updated, remove the
experimental/common/tensor_statistics. - Remove
common/tensor_statistics/reductionif it is not needed anymore.
In the end, there should be no experimental/common/tensor_statistics.
Example Pull Requests
https://github.com/openvinotoolkit/nncf/pull/2117
Resources
- Contribution guide - start here!
- Intel DevHub Discord channel - engage in discussions, ask questions and talk to OpenVINO developers
- How to link your Pull Request to an issue
Contact points
@kshpv
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
@kshpv So basically functionally replace everything in old files(common) with the new files(Experimental) and then delete the new files(Experimental) ?
@AHB102, you also need to be sure that all tests passed and no regression is introduced
@kshpv Great! I've reviewed the example and will create a PR for a single-file change. We can go from there
@AHB102 I am really sorry, but @olegkkruglov already picked this GFI. I suggest you to pick another one. We have many things to do. I think we probably open new GFIs in the following days. If you are interested I can ping you. What do you say?
@kshpv Yup no problem 😄
hey @olegkkruglov - do you need any support or you may not have a time to finish the task?
hey, the work is in progress. sorry, I didn't have enough time to finish. I think I will be able to do it during this weekend, is it ok?
of course :)
Hi @AHB102 https://github.com/openvinotoolkit/nncf/issues/3120 - this is probably for you :)
@kshpv By the time I looked, someone else had taken the issue. Maybe next time.
I'm unassigning the task due to assignee's inactivity. @kshpv could you please unassign the task? I don't have appropriate permissions in the NNCF issues.
Do we need to merge PR https://github.com/openvinotoolkit/nncf/pull/3106/ before working on this issue?
Do we need to merge PR #3106 before working on this issue?
If you want, you can continue working on this issue. In this case, you should open your PR, creating a branch from PR #3106. You can then rebase your branch to develop and respond to reviewers' comments. After you open your PR, I will close PR #3106 due to lack of activity.
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
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.
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.
Hi is this open?
Hi @kshpv ,
I've been working on the tensor statistics migration issue assigned to me and wanted to check in to ensure I've understood the task correctly.
From my investigation, I see that NNCF currently maintains two sets of tensor statistics:
- The old implementation in
nncf/common/tensor_statisticswith files: aggregator.py, collectors.py, init.py, reduction.py, statistic_point.py, statistics.py, statistics_serializer.py, and statistics_validator.py - The new implementation in
nncf/experimental/common/tensor_statisticswith fewer files: collectors.py, init.py, statistical_functions.py, and statistics.py
I've written a script to search for references to both implementations across the codebase to identify which files need to be updated.
My understanding of the migration task is:
- Update all algorithms, tests, and utility functions to use the new tensor statistics from the experimental implementation
- Replace the contents of
nncf/common/tensor_statistics/collectorswith the corresponding implementation fromnncf/experimental/common/tensor_statistics/collectors - Remove
nncf/common/tensor_statistics/reductionif it's no longer needed - Finally, remove the experimental implementation (
nncf/experimental/common/tensor_statistics) once all references have been migrated
Since the new implementation has fewer files, I'm wondering how the functionality has been reorganized. Has the functionality from files like statistic_point.py, statistics_serializer.py, and statistics_validator.py been consolidated into the remaining files, or is some of it no longer needed?
I'd appreciate your guidance on whether my understanding is correct and if there's anything important I've missed or should be particularly careful about during this migration.
Thank you!
@darshil929 Please make note of this comment:
Do we need to merge PR #3106 before working on this issue?
If you want, you can continue working on this issue. In this case, you should open your PR, creating a branch from PR #3106. You can then rebase your branch to develop and respond to reviewers' comments. After you open your PR, I will close PR #3106 due to lack of activity.
@shumaari I'll take a note of it, Thanks.