Skip to content

Let quantizers add custom meta data to GraphModule #2711

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 1 commit into
base: main
Choose a base branch
from

Conversation

per
Copy link

@per per commented Aug 7, 2025

Make the 'custom' meta data field in the GraphModule be propageted with any data that is added by the quantizer.

Make the 'custom' meta data field in the GraphModule be propageted
with any data that is added by the quantizer.

Signed-off-by: Per Åstrand <[email protected]>
Copy link

pytorch-bot bot commented Aug 7, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2711

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 3b487e3 with merge base 5d99ce4 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla 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 Aug 7, 2025
@per
Copy link
Author

per commented Aug 8, 2025

@msaroufim, @cpuhrsch: You are marked as code owners, so reaching out to you. Who do I ping to get the workflow running and reviewers added?

@@ -116,13 +116,17 @@ def calibrate(model, data_loader):
model = quantizer.transform_for_annotation(model)
quantizer.annotate(model)
quantizer.validate(model)
# Store the 'custom' meta data if any added by quantizer
annotated_meta = model.meta.get("custom", {})
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the intended use for this?

Copy link
Author

Choose a reason for hiding this comment

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

I want to pass on a list of the annotated nodes to the partitioner and then on to the exported programs graph_module in order to validate the quantization folding decisions in the backend when we start to mix INT and FP. The ET part of it (passing on the 'custom' meta to the edge program) is also needed, but otherwise the 'custom' field is handled in the re-exports to survive all the way to that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants