Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

wwwind
Copy link
Collaborator

@wwwind wwwind commented Jul 11, 2025

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

Signed-off-by: Elena Zhelezina <[email protected]>
Change-Id: I09de39c603d68d5ac5de4614a35eb7e3fc9ba518
Copy link

pytorch-bot bot commented Jul 11, 2025

🔗 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 Failures

As of commit a50b14b with merge base a0618c8 (image):

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.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 11, 2025
@wwwind wwwind added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: arm Changes to the ARM backend delegate labels Jul 11, 2025
Copy link
Contributor

@digantdesai digantdesai left a 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(
Copy link
Contributor

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:
Copy link
Contributor

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?

@wwwind
Copy link
Collaborator Author

wwwind commented Jul 11, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants