-
Notifications
You must be signed in to change notification settings - Fork 613
Arm backend: Add function to return quant params for lowered graph #12390
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Elena Zhelezina <[email protected]> Change-Id: I09de39c603d68d5ac5de4614a35eb7e3fc9ba518
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/12390
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 6 Unrelated FailuresAs of commit a50b14b with merge base a0618c8 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Perhaps I am missing something, can you help me understand the motivation please?
from executorch.exir.passes.quantize_io_pass import QuantizeInputs, QuantizeOutputs | ||
|
||
|
||
def extract_io_quant_params( |
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.
Perhaps move this to the quantize_io_pass.py?
output_idxs: Sequence[int] = (0,), | ||
) -> Dict[str, Dict[str, Dict[str, Any]]]: | ||
""" | ||
Returns quantization parameters such as scale/zero_point: |
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.
can't we get these after quantize_io_pass
and then the config methods it adds?
Thank you for the review! @digantdesai We need this function in our workflow: we have a graphic use case when we need to move out Q/DQ nodes and get scale/zero points so we prepare input data in our plugin. Then we pass it to the subgraph. Currently, we need to call these two passes and then to extract these data from config, which is not very friendly for our users. Here there is just one function call that does this job. |
Summary:
Add function to return quant params for lowered graph and remove these Q/DQ from the graph. If they are needed, then the EdgeProgramManager should be copied before use of this function.
Change-Id: I09de39c603d68d5ac5de4614a35eb7e3fc9ba518
Signed-off-by: Elena Zhelezina [email protected]
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218