Skip to content

NXP backend: Documentation for QAT#18228

Merged
robert-kalmar merged 1 commit intopytorch:mainfrom
nxp-upstream:feature/EIEX-685-create-documentation-for-qat
Mar 18, 2026
Merged

NXP backend: Documentation for QAT#18228
robert-kalmar merged 1 commit intopytorch:mainfrom
nxp-upstream:feature/EIEX-685-create-documentation-for-qat

Conversation

@StrycekSimon
Copy link
Collaborator

@StrycekSimon StrycekSimon commented Mar 17, 2026

Summary

Adds documentation NeutronQuantizer support for QAT.
Adds train support for QAT mode in calibrate_and_quantize function.

Test plan

Mostly documentation related changes - no tests added.
The quantization related function is partially covered by already existing tests.

cc @robert-kalmar @JakeStevens @digantdesai

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 17, 2026

🔗 Helpful Links

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

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

❌ 2 New Failures, 1 Pending, 2 Unrelated Failures

As of commit a04917e with merge base faa5903 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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 Mar 17, 2026
@StrycekSimon StrycekSimon force-pushed the feature/EIEX-685-create-documentation-for-qat branch from a7772d0 to 22d2206 Compare March 17, 2026 14:00
@StrycekSimon
Copy link
Collaborator Author

Since we mention the calibrate_and_quantize helper function as our public API in our documentation page, I added training support in this function to correspond with our new QAT feature. Can it be part of this PR?

@StrycekSimon StrycekSimon force-pushed the feature/EIEX-685-create-documentation-for-qat branch from 22d2206 to 313bee6 Compare March 17, 2026 14:04
@StrycekSimon StrycekSimon marked this pull request as ready for review March 17, 2026 14:10
@StrycekSimon
Copy link
Collaborator Author

@robert-kalmar @MartinPavella @roman-janik-nxp can some of you please take a look at this PR?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds NXP (NeutronQuantizer) Quantization Aware Training (QAT) documentation and updates the NXP quantization helper to optionally run a training callback when is_qat=True.

Changes:

  • Link NXP quantization docs from the quantization overview page.
  • Add a new “Quantization Aware Training” section to NXP quantization documentation (workflow + limitations).
  • Extend calibrate_and_quantize to support an optional QAT training callback and optional calibration_inputs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
docs/source/quantization-overview.md Adds QAT/PTQ mention and links to NXP quantization docs.
docs/source/backends/nxp/nxp-quantization.md Adds QAT documentation, examples, and known limitation/workaround notes.
backends/nxp/quantizer/utils.py Adds optional QAT training via train_callback and makes calibration_inputs optional.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@robert-kalmar robert-kalmar 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 Mar 17, 2026
@robert-kalmar
Copy link
Collaborator

Since we mention the calibrate_and_quantize helper function as our public API in our documentation page, I added training support in this function to correspond with our new QAT feature. Can it be part of this PR?

I don't prefer that, as it introduce a new feature in the pipeline and the objective is, this PR to get cherry-picked to the release branch where new features are not strongly not preferred - #17016 (comment).

Move the "training support" in separate PR to land only on main branch.

The documentation is valid even without that change, if you remove the "Alternatively" part - https://github.com/pytorch/executorch/pull/18228/changes#diff-a510398a70db14eec60cc59d9f317799bc7aede898e9042c6e3ba00f4cac10cdR198

@StrycekSimon
Copy link
Collaborator Author

Okay, I will remove it. That's why I asked.

@StrycekSimon StrycekSimon force-pushed the feature/EIEX-685-create-documentation-for-qat branch from 313bee6 to a04917e Compare March 17, 2026 16:45
@robert-kalmar
Copy link
Collaborator

LGTM.

@robert-kalmar robert-kalmar merged commit b1373e8 into pytorch:main Mar 18, 2026
157 of 161 checks passed
@robert-kalmar
Copy link
Collaborator

@pytorchbot cherry-pick --onto release/1.2 -c docs

pytorchbot pushed a commit that referenced this pull request Mar 18, 2026
### Summary
Adds documentation NeutronQuantizer support for QAT.

(cherry picked from commit b1373e8)
@pytorchbot
Copy link
Collaborator

Cherry picking #18228

The cherry pick PR is at #18282 The following tracker issues are updated:

Details for Dev Infra team Raised by workflow job

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.

4 participants