Skip to content

Commit

Permalink
Add unit tests for nncf quantization functions (#2526)
Browse files Browse the repository at this point in the history
### Details

- Added unit tests for quantization and accuracy control functions
- Files tested: 
*
[nncf/quantization/algorithms/accuracy_control/evaluator.py](https://app.codecov.io/gh/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/accuracy_control/evaluator.py)
*
[nncf/quantization/algorithms/accuracy_control/subset_selection.py](https://app.codecov.io/gh/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/accuracy_control/subset_selection.py)
*
[nncf/quantization/algorithms/accuracy_control/openvino_backend.py](https://app.codecov.io/gh/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/accuracy_control/openvino_backend.py)
*
[nncf/quantization/algorithms/accuracy_control/ranker.py](https://app.codecov.io/gh/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/accuracy_control/ranker.py)
    
*
[nncf/quantization/algorithms/accuracy_control/algorithm.py](https://app.codecov.io/gh/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/accuracy_control/algorithm.py)
- For
[ranker.py](https://github.com/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/accuracy_control/ranker.py),
I am not sure how to test the case with multithreading, so I have left
that out for now.
- For
[algorithm.py](https://github.com/openvinotoolkit/nncf/blob/develop/nncf/quantization/algorithms/accuracy_control/algorithm.py),
I am not sure how to test some of the more complex functions like
`apply`, so I have left that out for now.
- Addresses #2496
  • Loading branch information
Candyzorua authored Mar 15, 2024
1 parent 38be944 commit 86ea8f6
Show file tree
Hide file tree
Showing 4 changed files with 826 additions and 17 deletions.
2 changes: 1 addition & 1 deletion nncf/quantization/algorithms/accuracy_control/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def disable_iteration_count(self) -> None:
"""
self._enable_iteration_count = False

def is_metric_mode(self) -> bool:
def is_metric_mode(self) -> Optional[bool]:
"""
Returns mode of `Evaluator`.
Expand Down
Loading

0 comments on commit 86ea8f6

Please sign in to comment.