Skip to content

Add a16w8 per-op test for mean_dim (#19594)#19594

Open
christine-long-meta wants to merge 3 commits into
pytorch:mainfrom
christine-long-meta:export-D104532361
Open

Add a16w8 per-op test for mean_dim (#19594)#19594
christine-long-meta wants to merge 3 commits into
pytorch:mainfrom
christine-long-meta:export-D104532361

Conversation

@christine-long-meta
Copy link
Copy Markdown

@christine-long-meta christine-long-meta commented May 14, 2026

Summary:

Add int16 activation / int8 weight (a16w8) quantization tests for aten.mean.dim on Ethos-U55 and Ethos-U85.

Changes

  • Add a16w8_mean_test_parameters dict with 11 test configurations covering keepdim/no-keepdim, positive/negative dims, dim=None, and ranks 1-4
  • Add test_mean_dim_a16w8_u55_INT using EthosU55PipelineINT with a16w8_quantization=True, symmetric_io_quantization=True, qtol=128, epsilon=2**-16
  • Add test_mean_dim_a16w8_u85_INT using EthosU85PipelineINT with same kwargs
  • Register ops/test_mean_dim.py in fbcode/ and xplat/ targets.bzl

bypass-pytorch-oss-checks

Differential Revision: D104532361

Summary:
Add int16 activation / int8 weight (a16w8) quantization tests for `aten.exp` on Ethos-U55 and Ethos-U85.

## Context
The `exp` op is part of the softmax decomposition (`softmax(x) = exp(x) / sum(exp(x))`), which is used in the attention mechanism of EMG2Pose Conformer models. This op was identified as the root cause of the U85 SNR regression investigated in SEV T267939669 — without dedicated a16w8 per-op coverage, the numerics issue was only visible at the full-model level. Adding per-op tests allows us to catch int16 precision regressions at the operator granularity before they propagate to end-to-end model accuracy.

## Changes
- Add `a16w8_exp_test_parameters` dict with 3 test configurations covering rank-1, rank-2, and rank-3 tensors
- Add `test_exp_a16w8_u55_INT` using `EthosU55PipelineINT` with `a16w8_quantization=True, symmetric_io_quantization=True, qtol=128, epsilon=2**-16`
- Add `test_exp_a16w8_u85_INT` using `EthosU85PipelineINT` with same kwargs
- Register `ops/test_exp.py` in `fbcode/` and `xplat/` `targets.bzl`

bypass-pytorch-oss-checks

Differential Revision: D104532358
Summary:
Add int16 activation / int8 weight (a16w8) quantization tests for `aten.reciprocal` on Ethos-U55 and Ethos-U85.

## Context
The `reciprocal` op is the second half of the softmax decomposition (`softmax(x) = exp(x) * reciprocal(sum(exp(x)))`), paired with `exp`. Together they form the attention mechanism in EMG2Pose Conformer models. Like `exp`, this op was implicated in the U85 SNR regression (SEV T267939669) — the division-by-reciprocal path can amplify quantization error when the denominator is itself quantized at int16. Adding dedicated a16w8 coverage isolates reciprocal numerics from the rest of the softmax pipeline.

## Changes
- Add `a16w8_reciprocal_test_parameters` dict with 3 test configurations covering rank-1, rank-2, and rank-3 tensors (all shifted by +0.1 to avoid division near zero)
- Add `test_reciprocal_a16w8_u55_INT` using `EthosU55PipelineINT` with `a16w8_quantization=True, symmetric_io_quantization=True, qtol=128, epsilon=2**-16`
- Add `test_reciprocal_a16w8_u85_INT` using `EthosU85PipelineINT` with same kwargs
- Register `ops/test_reciprocal.py` in `fbcode/` and `xplat/` `targets.bzl`

bypass-pytorch-oss-checks

Differential Revision: D104532357
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 14, 2026

🔗 Helpful Links

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

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:

❌ 1 New Failure, 40 Pending

As of commit cccb394 with merge base 58b4f26 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels May 14, 2026
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 14, 2026

Workflows were awaiting approval. CI has now been triggered for the ciflow labels on this PR.

@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 May 14, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 14, 2026

@christine-long-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104532361.

@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.

@meta-codesync meta-codesync Bot changed the title Add a16w8 per-op test for mean_dim Add a16w8 per-op test for mean_dim (#19594) May 14, 2026
@christine-long-meta christine-long-meta force-pushed the export-D104532361 branch 2 times, most recently from 744487a to b79321f Compare May 14, 2026 16:47
christine-long-meta added a commit to christine-long-meta/executorch that referenced this pull request May 14, 2026
Summary:

Add int16 activation / int8 weight (a16w8) quantization tests for `aten.mean.dim` on Ethos-U55 and Ethos-U85.

## Changes
- Add `a16w8_mean_test_parameters` dict with 11 test configurations covering keepdim/no-keepdim, positive/negative dims, dim=None, and ranks 1-4
- Add `test_mean_dim_a16w8_u55_INT` using `EthosU55PipelineINT` with `a16w8_quantization=True, symmetric_io_quantization=True, qtol=128, epsilon=2**-16`
- Add `test_mean_dim_a16w8_u85_INT` using `EthosU85PipelineINT` with same kwargs
- Register `ops/test_mean_dim.py` in `fbcode/` and `xplat/` `targets.bzl`

bypass-pytorch-oss-checks

Differential Revision: D104532361
@christine-long-meta christine-long-meta force-pushed the export-D104532361 branch 3 times, most recently from e7d90e2 to 37c98c1 Compare May 14, 2026 16:48
christine-long-meta added a commit to christine-long-meta/executorch that referenced this pull request May 14, 2026
Summary:

Add int16 activation / int8 weight (a16w8) quantization tests for `aten.mean.dim` on Ethos-U55 and Ethos-U85.

## Changes
- Add `a16w8_mean_test_parameters` dict with 11 test configurations covering keepdim/no-keepdim, positive/negative dims, dim=None, and ranks 1-4
- Add `test_mean_dim_a16w8_u55_INT` using `EthosU55PipelineINT` with `a16w8_quantization=True, symmetric_io_quantization=True, qtol=128, epsilon=2**-16`
- Add `test_mean_dim_a16w8_u85_INT` using `EthosU85PipelineINT` with same kwargs
- Register `ops/test_mean_dim.py` in `fbcode/` and `xplat/` `targets.bzl`

bypass-pytorch-oss-checks

Differential Revision: D104532361
@christine-long-meta christine-long-meta force-pushed the export-D104532361 branch 2 times, most recently from b79321f to 3350584 Compare May 14, 2026 16:49
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 14, 2026

@christine-long-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104532361.

christine-long-meta added a commit to christine-long-meta/executorch that referenced this pull request May 14, 2026
Summary:
Pull Request resolved: pytorch#19594

Add int16 activation / int8 weight (a16w8) quantization tests for `aten.mean.dim` on Ethos-U55 and Ethos-U85.

## Changes
- Add `a16w8_mean_test_parameters` dict with 11 test configurations covering keepdim/no-keepdim, positive/negative dims, dim=None, and ranks 1-4
- Add `test_mean_dim_a16w8_u55_INT` using `EthosU55PipelineINT` with `a16w8_quantization=True, symmetric_io_quantization=True, qtol=128, epsilon=2**-16`
- Add `test_mean_dim_a16w8_u85_INT` using `EthosU85PipelineINT` with same kwargs
- Register `ops/test_mean_dim.py` in `fbcode/` and `xplat/` `targets.bzl`

bypass-pytorch-oss-checks

Differential Revision: D104532361
@christine-long-meta christine-long-meta force-pushed the export-D104532361 branch 4 times, most recently from 7bb5c56 to d8dea29 Compare May 14, 2026 16:53
@meta-codesync meta-codesync Bot changed the title Add a16w8 per-op test for mean_dim (#19594) Add a16w8 per-op test for mean_dim May 14, 2026
christine-long-meta added a commit to christine-long-meta/executorch that referenced this pull request May 14, 2026
Summary:

Add int16 activation / int8 weight (a16w8) quantization tests for `aten.mean.dim` on Ethos-U55 and Ethos-U85.

## Changes
- Add `a16w8_mean_test_parameters` dict with 11 test configurations covering keepdim/no-keepdim, positive/negative dims, dim=None, and ranks 1-4
- Add `test_mean_dim_a16w8_u55_INT` using `EthosU55PipelineINT` with `a16w8_quantization=True, symmetric_io_quantization=True, qtol=128, epsilon=2**-16`
- Add `test_mean_dim_a16w8_u85_INT` using `EthosU85PipelineINT` with same kwargs
- Register `ops/test_mean_dim.py` in `fbcode/` and `xplat/` `targets.bzl`

bypass-pytorch-oss-checks

Differential Revision: D104532361
Summary:
Pull Request resolved: pytorch#19594

Add int16 activation / int8 weight (a16w8) quantization tests for `aten.mean.dim` on Ethos-U55 and Ethos-U85.

## Changes
- Add `a16w8_mean_test_parameters` dict with 11 test configurations covering keepdim/no-keepdim, positive/negative dims, dim=None, and ranks 1-4
- Add `test_mean_dim_a16w8_u55_INT` using `EthosU55PipelineINT` with `a16w8_quantization=True, symmetric_io_quantization=True, qtol=128, epsilon=2**-16`
- Add `test_mean_dim_a16w8_u85_INT` using `EthosU85PipelineINT` with same kwargs
- Register `ops/test_mean_dim.py` in `fbcode/` and `xplat/` `targets.bzl`

bypass-pytorch-oss-checks

Differential Revision: D104532361
@meta-codesync meta-codesync Bot changed the title Add a16w8 per-op test for mean_dim Add a16w8 per-op test for mean_dim (#19594) May 14, 2026
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. fb-exported meta-exported module: arm Issues related to arm backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant