NXP backend: Add post-quantization data utilization to aot_neutron_compile.py.#17479
Open
MartinPavella wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17479
Note: Links to docs will display an error until the docs builds have been completed. ❌ 9 New FailuresAs of commit ad6d973 with merge base 7f91ed4 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support in the NXP AOT compile example for using post-quantization model data (state dict) during partitioning/lowering, and introduces a regression test intended to validate end-to-end delegation for MobileNetV2.
Changes:
- Pass
post_quantization_state_dict=module.state_dict()intoNeutronPartitionerinaot_neutron_compile.pywhen delegation is enabled. - Add a new pytest that runs the AOT example script for MobileNetV2 and inspects the produced
.ptefor delegation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| examples/nxp/aot_neutron_compile.py | Provides post-quantization state dict to the partitioner so static tensors can be recovered during partitioning with fake tensors. |
| backends/nxp/tests/test_aot_example.py | Adds an end-to-end test that runs the example script and validates the serialized program contains Neutron delegation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c371a70 to
23adc42
Compare
…ompile.py`. This data is used to correctly assess Neutron operator support during partitioning.
23adc42 to
ad6d973
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A recent PR added the option to use the post-quantization state dict to access static data during quantization. This PR adds this feature to the
aot_neutron_compile.py.Test plan
Unit-test with the example MobileNetV2 is provided.
cc @robert-kalmar @JakeStevens @digantdesai