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

Add SmoothQuant and ChannelAlignment to HyperparameterTuner #2154

Merged

Conversation

andrey-churkin
Copy link
Contributor

@andrey-churkin andrey-churkin commented Sep 25, 2023

Changes

  • Add the Pipeline class. To use the algorithm with the HyperparameterTuner, it should be wrapped within a Pipeline object.

Reason for changes

  • Add the SmoothQuant and ChannelAlignment algorithms to the parameter optimization process.

Related tickets

Ref: 117471

Tests

@andrey-churkin andrey-churkin requested a review from a team as a code owner September 25, 2023 07:15
@github-actions github-actions bot added the NNCF PTQ Pull requests that updates NNCF PTQ label Sep 25, 2023
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Merging #2154 (e95b8a2) into develop (9b75974) will increase coverage by 0.04%.
The diff coverage is 66.66%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2154      +/-   ##
===========================================
+ Coverage    36.57%   36.62%   +0.04%     
===========================================
  Files          484      486       +2     
  Lines        43310    43373      +63     
===========================================
+ Hits         15841    15885      +44     
- Misses       27469    27488      +19     
Files Coverage Δ
nncf/quantization/quantize_model.py 46.47% <66.66%> (ø)
nncf/quantization/algorithms/pipeline.py 96.42% <96.42%> (ø)
...quantization/algorithms/post_training/algorithm.py 86.20% <70.00%> (+8.65%) ⬆️
.../quantization/algorithms/post_training/pipeline.py 90.00% <90.00%> (ø)
...tion/algorithms/hyperparameter_tuner/param_grid.py 55.88% <54.16%> (-10.79%) ⬇️
...ation/algorithms/hyperparameter_tuner/algorithm.py 57.89% <17.02%> (-4.43%) ⬇️

... and 1 file with indirect coverage changes

@andrey-churkin andrey-churkin force-pushed the ac/add_pipeline branch 3 times, most recently from a0e42ff to cbeb182 Compare September 25, 2023 08:41
Copy link
Contributor

@alexsu52 alexsu52 left a comment

Choose a reason for hiding this comment

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

I'm OK with this solution. Please clean code and write doc strings.

@github-actions github-actions bot added NNCF PT Pull requests that updates NNCF PyTorch NNCF OpenVINO Pull requests that updates NNCF OpenVINO NNCF ONNX Pull requests that updates NNCF ONNX labels Sep 26, 2023
@andrey-churkin andrey-churkin force-pushed the ac/add_pipeline branch 2 times, most recently from 183412a to 8575880 Compare September 26, 2023 14:48
Copy link
Contributor

@alexsu52 alexsu52 left a comment

Choose a reason for hiding this comment

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

LGTM

@andrey-churkin andrey-churkin force-pushed the ac/add_pipeline branch 2 times, most recently from 5346d9b to e95b8a2 Compare October 16, 2023 12:28
@andrey-churkin
Copy link
Contributor Author

Build: 10740

@andrey-churkin andrey-churkin merged commit 5150867 into openvinotoolkit:develop Oct 17, 2023
Comment on lines -182 to -189
for algorithm in self.first_stage_algorithms:
if isinstance(algorithm, SmoothQuant) and backend != BackendType.OPENVINO:
nncf_logger.debug(f"{backend.name} does not support SmoothQuant algorithm yet.")
continue

if isinstance(algorithm, ChannelAlignment) and backend != BackendType.OPENVINO:
nncf_logger.debug(f"{backend.name} does not support ChannelAlignment algorithm yet.")
continue
Copy link
Collaborator

@daniil-lyakhov daniil-lyakhov Oct 18, 2023

Choose a reason for hiding this comment

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

Looks like this part is missing in the new realization, quantization of transformers for torch backend is failing because pipeline tries to apply smoothquant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NNCF ONNX Pull requests that updates NNCF ONNX NNCF OpenVINO Pull requests that updates NNCF OpenVINO NNCF PT Pull requests that updates NNCF PyTorch NNCF PTQ Pull requests that updates NNCF PTQ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants