-
Notifications
You must be signed in to change notification settings - Fork 124
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
Transition to a newer NNCF API for PyTorch model quantization #630
Transition to a newer NNCF API for PyTorch model quantization #630
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
@AlexKoff88 @alexsu52 could you please review this PR? |
@echarlaix, as we agreed, this is the first PR in the series of changes to deprecate legacy NNCF functions and move all the actual optimization functionality under OVQuantizer API. Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good thanks @nikita-savelyevv
@@ -360,7 +358,7 @@ def _quantize_torchmodel( | |||
logger.info( | |||
"No configuration describing the quantization process was provided, a default OVConfig will be generated." | |||
) | |||
ov_config = OVConfig(compression=DEFAULT_QUANTIZATION_CONFIG) | |||
ov_config = OVConfig() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used for quantization (but now only for the save_onnx_model
parameter) so not sure we need to create an instance when not provided, we can only give save_onnx_model
a default value instead. Also no need to save the configuration after the quantization + export steps for the same reason : would remove saving the config here
ov_config.save_pretrained(save_directory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the suggested changes, also removed ov_config from list of arguments altogether. In the future will bring it back to pass quantization parameters through it.
Post-Training Quantization for PyTorch backend with
nncf.create_compressed_model()
API is obsolete and should be replaced withnncf.quantize()
call which is used for OV backend.What does this PR do?
Replace
nncf.create_compressed_model()
call withnncf.quantize()
call for quantization of PyTorch models.Before submitting