Skip to content

Fix quantized max_pool2d output observer for tuple-returning ops (#19259)#19259

Merged
meta-codesync[bot] merged 1 commit intopytorch:mainfrom
abeakkas:export-D103436172
May 2, 2026
Merged

Fix quantized max_pool2d output observer for tuple-returning ops (#19259)#19259
meta-codesync[bot] merged 1 commit intopytorch:mainfrom
abeakkas:export-D103436172

Conversation

@abeakkas
Copy link
Copy Markdown
Contributor

@abeakkas abeakkas commented May 1, 2026

Summary:

prepare_pt2e skips the output observer for max_pool2d_with_indices because its output is a tuple, not a single tensor. This caused the quantized_max_pool2d fusion to silently fail.

Fix: annotate getitem[0] (single tensor) instead of the tuple-returning op. Also bail out if indices are consumed or the graph structure is unexpected.

Reviewed By: mcremon-meta

Differential Revision: D103436172

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 1, 2026

🔗 Helpful Links

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

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

❌ 3 New Failures, 1 Cancelled Job, 3 Unrelated Failures

As of commit 1317bf1 with merge base 8464b47 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was 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 May 1, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 1, 2026

@abeakkas has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103436172.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

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.

@aliafzal aliafzal self-requested a review May 1, 2026 18:46
@meta-codesync meta-codesync Bot changed the title Fix quantized max_pool2d output observer for tuple-returning ops Fix quantized max_pool2d output observer for tuple-returning ops (#19259) May 1, 2026
abeakkas added a commit to abeakkas/executorch that referenced this pull request May 1, 2026
…orch#19259)

Summary:

prepare_pt2e skips the output observer for max_pool2d_with_indices because its output is a tuple, not a single tensor. This caused the quantized_max_pool2d fusion to silently fail.

Fix: annotate getitem[0] (single tensor) instead of the tuple-returning op. Also bail out if indices are consumed or the graph structure is unexpected.

Reviewed By: mcremon-meta

Differential Revision: D103436172
@abeakkas abeakkas force-pushed the export-D103436172 branch from d69567f to d7184cb Compare May 1, 2026 19:02
abeakkas added a commit to abeakkas/executorch that referenced this pull request May 1, 2026
…orch#19259)

Summary:

prepare_pt2e skips the output observer for max_pool2d_with_indices because its output is a tuple, not a single tensor. This caused the quantized_max_pool2d fusion to silently fail.

Fix: annotate getitem[0] (single tensor) instead of the tuple-returning op. Also bail out if indices are consumed or the graph structure is unexpected.

Reviewed By: mcremon-meta

Differential Revision: D103436172
@abeakkas abeakkas force-pushed the export-D103436172 branch from d7184cb to 08c7ef6 Compare May 1, 2026 20:13
abeakkas added a commit to abeakkas/executorch that referenced this pull request May 1, 2026
…orch#19259)

Summary:

prepare_pt2e skips the output observer for max_pool2d_with_indices because its output is a tuple, not a single tensor. This caused the quantized_max_pool2d fusion to silently fail.

Fix: annotate getitem[0] (single tensor) instead of the tuple-returning op. Also bail out if indices are consumed or the graph structure is unexpected.

Reviewed By: mcremon-meta

Differential Revision: D103436172
@abeakkas abeakkas force-pushed the export-D103436172 branch from 08c7ef6 to e4cde86 Compare May 1, 2026 20:40
abeakkas added a commit to abeakkas/executorch that referenced this pull request May 1, 2026
…orch#19259)

Summary:

prepare_pt2e skips the output observer for max_pool2d_with_indices because its output is a tuple, not a single tensor. This caused the quantized_max_pool2d fusion to silently fail.

Fix: annotate getitem[0] (single tensor) instead of the tuple-returning op. Also bail out if indices are consumed or the graph structure is unexpected.

Reviewed By: mcremon-meta

Differential Revision: D103436172
@abeakkas abeakkas force-pushed the export-D103436172 branch from e4cde86 to debb30d Compare May 1, 2026 22:03
…orch#19259)

Summary:

prepare_pt2e skips the output observer for max_pool2d_with_indices because its output is a tuple, not a single tensor. This caused the quantized_max_pool2d fusion to silently fail.

Fix: annotate getitem[0] (single tensor) instead of the tuple-returning op. Also bail out if indices are consumed or the graph structure is unexpected.

Reviewed By: mcremon-meta

Differential Revision: D103436172
@abeakkas abeakkas force-pushed the export-D103436172 branch from debb30d to 1317bf1 Compare May 1, 2026 22:07
@meta-codesync meta-codesync Bot merged commit c89f208 into pytorch:main May 2, 2026
167 of 176 checks passed
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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants