-
Notifications
You must be signed in to change notification settings - Fork 689
NXP backend: Unify quantization function inplementations #15044
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?
NXP backend: Unify quantization function inplementations #15044
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15044
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
a60e002
to
fd1a7df
Compare
@pytorchbot label "module: nxp" |
Let's wait for a review from one of my colleagues from NXP this time. 😀 In a meantime, I will check the red signals... |
Those failing tests are unrelated to this PR. Also, I noticed the same error messages in other PRs. |
model = model.module() | ||
|
||
if not quantizer: | ||
from executorch.backends.nxp.quantizer.neutron_quantizer import NeutronQuantizer |
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.
Is it necessary to conditionally import? It could be in default param.
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.
There is a circular import btw utils.py
and neutron_quantizer.py
. It would be possible but this was the easier (and cleaner) way of dealing with it.
backends/nxp/quantizer/utils.py
Outdated
|
||
def post_training_quantize( | ||
model: [ExportedProgram | fx.GraphModule], | ||
calibration_inputs: list[tuple[torch.Tensor, ...]], |
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.
Will call from aot_neutron_compile
work? The type hint changed.
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.
Yeah, you are right. Both my syntax highlighter and linter didn't mark it as an issue. I will change it to Iterable
to include both options.
fd1a7df
to
28f3200
Compare
Summary
Unifies implementation of model quantization between
executorch_pipeline.py
and exampleaot_neutron_compile.py
and introduces documented single function interface.Test plan
Should be covered by already existing unit tests.
cc @robert-kalmar @JakeStevens @digantdesai