Skip to content

NXP backend: Use zero point for quantized padding. #13576

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

Conversation

MartinPavella
Copy link
Contributor

@MartinPavella MartinPavella commented Aug 21, 2025

Summary

This PR fixes cases where padding with the value 0 was used for quantized operators. Now, zero point is used instead.

Test plan

Unit tests provided.

cc @digantdesai @JakeStevens @robert-kalmar

Copy link

pytorch-bot bot commented Aug 21, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/13576

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

✅ No Failures

As of commit 0f68cd2 with merge base 3dac421 (image):
💚 Looks good so far! There are no failures yet. 💚

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 21, 2025
@MartinPavella
Copy link
Contributor Author

@pytorchbot label "module: nxp" "release notes: nxp"

@pytorch-bot pytorch-bot bot added module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate labels Aug 21, 2025
# be included in the computation!
input_quantization = t_op.tmp_inputs[0].quantization
pad_value = (
None
Copy link
Contributor

Choose a reason for hiding this comment

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

Why None instead of 0 in non quantized?

Copy link
Contributor Author

@MartinPavella MartinPavella Aug 21, 2025

Choose a reason for hiding this comment

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

None is the default value of the builder.create_pad_operator_before() method's constant_value parameter. This way, the actual default padding value (0) is only defined in 1 place.

But it's hard to image that the default padding value would ever be changed, and using 0 here would make the code more understandable. I have no problem using 0 instead of None if you prefer.

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. module: nxp Issues related to NXP Neutron NPU delegation and code under backends/nxp/ release notes: nxp Changes to the NXP Neutron backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants