Skip to content

Arm backend: Add missing BasePipeline.set_quantization_calibration - #23265

Merged
psiddh merged 1 commit into
pytorch:mainfrom
psiddh:sidart/arm-fix-set-quantization-calibration
Sep 29, 2026
Merged

psiddh merged 1 commit into
pytorch:mainfrom
psiddh:sidart/arm-fix-set-quantization-calibration

Conversation

@psiddh

@psiddh psiddh commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

#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

pytorch#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 pytorch#23182.

Authored with Claude Code.
@psiddh
psiddh requested a review from digantdesai as a code owner September 29, 2026 20:30
Copilot AI balanced review requested due to automatic review settings September 29, 2026 20:30
@pytorch-bot

pytorch-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Pending, 3 Unrelated Failures

As of commit fcf732c with merge base 96c621d (image):

NEW FAILURE - The following job has failed:

  • Cadence Build & Test / Resolve CI docker image / resolve (gh)
    ##[error]Refusing to check out fork pull request code from a 'pull_request_target' workflow. This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch cache scope, and runner access. Fetching and executing a fork's code in that trusted context commonly leads to "pwn request" vulnerabilities. To opt in, review the risks at https://gh.io/securely-using-pull_request_target and set 'allow-unsafe-pr-checkout: true' on the actions/checkout step.

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 29, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Sep 29, 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused helper correctly restores the calibration behavior expected by the NSS and NFRU tests.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes the calibration API regression introduced by #23182.

Changes:

  • Adds BasePipeline.set_quantization_calibration().
  • Supports custom calibration samples and dynamic shapes.
File Description
backends/​arm/​test/​tester/​test_pipeline.py Adds the missing quantization calibration helper.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@psiddh

psiddh commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

Check if test-arm-backend-vkml / test-arm-backend-no-driver pass on this PR

@zingo

zingo commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Seem to be a gigger problme (or you moved it?) I also spoted this #23256 that seem to point in the same direction but also still fails that tests :(

@zingo

zingo commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

It seem you improved stuff with this, one of the error types seems fixed, left is this:

FAILED backends/arm/test/models/test_nfru.py::test_nfru_prequantized_tosa_INT[real_data] - OSError: [Errno 30] Read-only file system: '/mnt/hf_cache/hub/models--Arm--neural-frame-rate-upscaling'
FAILED backends/arm/test/models/test_nss.py::test_nss_prequantized_tosa_INT[random_data] - OSError: [Errno 30] Read-only file system: '/mnt/hf_cache/hub/tmpbtjysh76'
FAILED backends/arm/test/models/test_nfru.py::test_nfru_prequantized_tosa_INT[random_data] - OSError: [Errno 30] Read-only file system: '/mnt/hf_cache/hub/models--Arm--neural-frame-rate-upscaling'
FAILED backends/arm/test/models/test_nss.py::test_nss_prequantized_tosa_INT[real_data] - OSError: [Errno 30] Read-only file system: '/mnt/hf_cache/hub/tmp6x_urx0m'
= 4 failed, 219 passed, 18 skipped, 3 xfailed, 117 warnings, 8 rerun in 778.21s (0:12:58) =

@psiddh

psiddh commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@zingo Thanks for looking into it..

Yes, this fixes the original set_quantization_calibration AttributeError from #23182 (all 5 now pass). The 4 remaining failures are a separate issue: the new *_prequantized tests from #23236/#23237 download from HF at test time, and /mnt/hf_cache is read-only on the runner. They fail on #23256 too, so they're coming from main.

Let's land this one and fix the HF cache issue in a separate PR, unless I am missing something.. Wdyt ?

@zingo

zingo commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Im happy to just getting it green and sort of the details later :) Ill approve this if you think it ok to forwardfix and ok that we look at the rest in 8:ish hours :) (if still there) Im also happy to revert it and we can retry tomorrow if this unblocks you in a better/faster way.

@psiddh

psiddh commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

other PR fix is here : #23268

@zingo zingo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK to merge, this fix a few erros, the left ones where there before.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants