Skip to content

NXP backend: remove #22179 workaround for QAT channels-last segfault - #22746

Open
JakeStevens wants to merge 1 commit into
pytorch:mainfrom
JakeStevens:fix/22179-portable-segfault
Open

NXP backend: remove #22179 workaround for QAT channels-last segfault#22746
JakeStevens wants to merge 1 commit into
pytorch:mainfrom
JakeStevens:fix/22179-portable-segfault

Conversation

@JakeStevens

Copy link
Copy Markdown
Contributor

What: test_mlperf_tiny_classification_mse_cpu_vs_npu used the Python edge reference instead of the portable-kernel C++ reference for the QAT plus channels-last variant, because that configuration segfaulted in the portable kernels.

Why: the crash is fixed on current main (issue #22179). The reporter's stack predates two out-of-bounds fixes in the portable dequantize path that this model exercises at runtime (16 per-channel dequantize ops): #21517 fixed an out-of-bounds traversal for non-contiguous (channels-last) inputs, and #21773 fixed misreading int32 zero points as int64. The int32 zero points are QAT-only: QAT emits int32 bias zero points while PTQ emits int64, matching the issue's QAT-only signature.

Verification: exported the exact failing configuration (QAT, channels-last, 15-epoch training, dataset calibration, NXP edge passes) and ran it with the portable-kernel executor_runner. It runs cleanly and its outputs bit-match the eager quantized reference. The quantized_kernels_test suite passes 74/74, including the regression tests from both fixes. lintrunner reports no issues on the touched file. The NXP SDK-gated test itself was not run here (no SDK); NXP CI will exercise it.

Fixes #22179

Authored with AI assistance (Muse Code).

…gfault

What: test_mlperf_tiny_classification_mse_cpu_vs_npu used the Python
edge reference instead of the portable-kernel C++ reference for the QAT
plus channels-last variant, because that configuration segfaulted in
the portable kernels.

Why: the crash is fixed on current main. The reporter's stack predates
two out-of-bounds fixes in the portable dequantize path that this model
exercises at runtime (16 per-channel dequantize ops): pytorch#21517 fixed an
out-of-bounds traversal for non-contiguous (channels-last) inputs, and
pytorch#21773 fixed misreading int32 zero points as int64. The int32 zero
points are QAT-only: QAT emits int32 bias zero points while PTQ emits
int64, matching the issue's QAT-only signature.

Verification: exported the exact failing configuration (QAT,
channels-last, 15-epoch training, dataset calibration, NXP edge
passes) and ran it with the portable-kernel executor_runner. It runs
cleanly and its outputs bit-match the eager quantized reference. The
quantized_kernels_test suite passes 74/74, including the regression
tests from both fixes. lintrunner reports no issues on the touched
file. The NXP SDK-gated test itself was not run here (no SDK); NXP CI
will exercise it.

Fixes pytorch#22179

Authored with AI assistance (Muse Code).
@pytorch-bot

pytorch-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 82c3a82 with merge base a3ae329 (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 Sep 11, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@JakeStevens
JakeStevens marked this pull request as draft September 11, 2026 16:03
@JakeStevens
JakeStevens requested review from novak-vaclav and removed request for robert-kalmar September 11, 2026 16:03
@JakeStevens
JakeStevens marked this pull request as ready for review September 11, 2026 16:10
@JakeStevens

Copy link
Copy Markdown
Contributor Author

@novak-vaclav seems this was already fixed, please take a look and confirm!

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.

Segmentation fault while running model with Portable kernels

1 participant