Skip to content

Arm backend: Added real calibration for NFRU model - #23182

Merged
Michiel-Olieslagers merged 3 commits into
pytorch:mainfrom
Michiel-Olieslagers:change-1338289
Sep 29, 2026
Merged

Michiel-Olieslagers merged 3 commits into
pytorch:mainfrom
Michiel-Olieslagers:change-1338289

Conversation

@Michiel-Olieslagers

@Michiel-Olieslagers Michiel-Olieslagers commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

This patch contains the following changes:

  • Added real calibration for NFRU model
  • Sped up dataset generation for NSS & NFRU models
  • Reworked NFRU QAT testing to use use real calibration data
  • Parameterised QAT testing

Change-Id: Ifd9d1b41bbba52b200be4eba079363d12c7fb2af

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

This patch contains the following changes:
- Added real calibration for NFRU model
- Sped up dataset generation for NSS & NFRU models
- Reworked NFRU QAT testing to use use real calibration data
- Parameterised QAT testing

Signed-off-by: Michiel Olieslagers <michiel.olieslagers@arm.com>
Change-Id: Ifd9d1b41bbba52b200be4eba079363d12c7fb2af
@Michiel-Olieslagers Michiel-Olieslagers 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 28, 2026
@Michiel-Olieslagers Michiel-Olieslagers added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: arm Changes to the ARM backend delegate labels Sep 28, 2026
@pytorch-bot

pytorch-bot Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 5 New Failures, 8 Pending, 1 Unrelated Failure

As of commit 4e4799c with merge base f3626e6 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job 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.

@github-actions github-actions Bot added the module: arm Issues related to arm backend label Sep 28, 2026
@Michiel-Olieslagers
Michiel-Olieslagers merged commit 22b43b2 into pytorch:main Sep 29, 2026
425 of 431 checks passed
@metascroy

Copy link
Copy Markdown
Contributor

@Michiel-Olieslagers this is breaking CI (e.g., the pull / test-arm-backend-no-driver (test_pytest_models_tosa) / linux-job). Are you working on a forward fix?

An agent says the following:

The failing job ran the PR’s merge commit, 22b43b2, and reports:
AttributeError: 'TosaPipelineINT' object has no attribute 'set_quantization_calibration'
The PR adds _set_nfru_calibration_samples and rewrites _set_nss_calibration_samples to call pipeline.set_quantization_calibration(...). However, that method does not exist on TosaPipelineINT or its base classes at the merge commit. The PR contains no pipeline implementation change.
Previously, NSS configured the quantization stage directly, assigning dynamic_shapes and calibration_samples. The refactor replaced that working code with the missing helper.
This explains all five failures: NFRU real-data PTQ, QAT, and a16w8, plus NSS real-data PTQ and QAT. Random-data variants bypass the helper and pass. These failures happen before pipeline.run(), so they are not numerical accuracy or infrastructure failures.
The fix is to implement the shared set_quantization_calibration method on BasePipeline, or restore direct quantization-stage configuration in both helpers. No changes made.

@psiddh

psiddh commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@Michiel-Olieslagers this is breaking CI (e.g., the pull / test-arm-backend-no-driver (test_pytest_models_tosa) / linux-job). Are you working on a forward fix?

An agent says the following:

The failing job ran the PR’s merge commit, 22b43b2, and reports: AttributeError: 'TosaPipelineINT' object has no attribute 'set_quantization_calibration' The PR adds _set_nfru_calibration_samples and rewrites _set_nss_calibration_samples to call pipeline.set_quantization_calibration(...). However, that method does not exist on TosaPipelineINT or its base classes at the merge commit. The PR contains no pipeline implementation change. Previously, NSS configured the quantization stage directly, assigning dynamic_shapes and calibration_samples. The refactor replaced that working code with the missing helper. This explains all five failures: NFRU real-data PTQ, QAT, and a16w8, plus NSS real-data PTQ and QAT. Random-data variants bypass the helper and pass. These failures happen before pipeline.run(), so they are not numerical accuracy or infrastructure failures. The fix is to implement the shared set_quantization_calibration method on BasePipeline, or restore direct quantization-stage configuration in both helpers. No changes made.

#23265 , potential fwd fix ?

@zingo

zingo commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

@metascroy and @psiddh I don't think anyone is working until tomorrow, I'm back from vacation tomorrow also (CET timeframe) and will see if there is anything I can do and/or check progress of the mentioend fix in one of the other PRs that @Michiel-Olieslagers mentioned.
Feel free to emergency revert the 4 NSS/NFRU PR that got merged if needed. We can reland it again with the fix.
We are sorry for the problems caused.

psiddh added a commit that referenced this pull request Sep 29, 2026
…23265)

#23182 made the NSS and NFRU model tests call
pipeline.set_quantization_calibration(), but never added the method, so
the real-data TOSA INT tests fail with AttributeError. Add it to
BasePipeline, configuring the quantize stage the same way the NSS test
did directly before #23182.

Authored with Claude Code.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils
@Sebastian-Larsson @robell @rascani
@zingo

zingo commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Update:

@psiddh tried to fix the problem during the night and manage to fix 2/3 problems
#23265
#23268
Left after this are merged seem to only be a few numerical/high "mean abs error" problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants