-
Notifications
You must be signed in to change notification settings - Fork 606
Statically Quantize Image Encoder #4648
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4648
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b0fed6b with merge base 2405f74 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@mcr229 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
# quantizer | ||
quantizer = XNNPACKQuantizer() | ||
quantizer.set_global(get_symmetric_quantization_config()) | ||
prepared = prepare_pt2e(manager.pre_autograd_graph_module, quantizer) | ||
|
||
# calibrate once | ||
prepared(*manager.example_inputs) | ||
|
||
# convert quantized | ||
converted = convert_pt2e(prepared) | ||
|
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.
This is part of the API in LLMEdgeManager
: https://fburl.com/vnyea8af. Can you use that API?
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.
Left a comment
@mcr229 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
We statically quantize the image encoder for XNNPACK