Skip to content

[ET-VK] Fix FuseClampPass incorrectly fusing conv+activation when conv has multiple users#17430

Merged
meta-codesync[bot] merged 5 commits intogh/SS-JIA/428/basefrom
gh/SS-JIA/428/head
Feb 13, 2026
Merged

[ET-VK] Fix FuseClampPass incorrectly fusing conv+activation when conv has multiple users#17430
meta-codesync[bot] merged 5 commits intogh/SS-JIA/428/basefrom
gh/SS-JIA/428/head

Conversation

@SS-JIA
Copy link
Copy Markdown
Contributor

@SS-JIA SS-JIA commented Feb 12, 2026

Stack from ghstack (oldest at bottom):

The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values.

This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion.

Differential Revision: D93145845

…v has multiple users

The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values.

This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion.

Differential Revision: [D93145845](https://our.internmc.facebook.com/intern/diff/D93145845/)

[ghstack-poisoned]
@SS-JIA SS-JIA requested a review from kimishpatel as a code owner February 12, 2026 21:36
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 12, 2026

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Cancelled Job

As of commit 5f44c12 with merge base dcfd12d (image):

NEW FAILURE - The following job has failed:

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

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

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

…on when conv has multiple users"

The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values.

This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion.

Differential Revision: [D93145845](https://our.internmc.facebook.com/intern/diff/D93145845/)

[ghstack-poisoned]
ssjia added 3 commits February 12, 2026 15:34
…on when conv has multiple users"

The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values.

This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion.

Differential Revision: [D93145845](https://our.internmc.facebook.com/intern/diff/D93145845/)

[ghstack-poisoned]
…on when conv has multiple users"

The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values.

This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion.

Differential Revision: [D93145845](https://our.internmc.facebook.com/intern/diff/D93145845/)

[ghstack-poisoned]
…on when conv has multiple users"

The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values.

This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion.

Differential Revision: [D93145845](https://our.internmc.facebook.com/intern/diff/D93145845/)

[ghstack-poisoned]
@meta-codesync meta-codesync Bot merged commit 779aec8 into gh/SS-JIA/428/base Feb 13, 2026
193 of 197 checks passed
@meta-codesync meta-codesync Bot deleted the gh/SS-JIA/428/head branch February 13, 2026 16:13
SS-JIA pushed a commit that referenced this pull request Feb 13, 2026
… conv has multiple users

Pull Request resolved: #17430

The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values.

This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion.
ghstack-source-id: 340983071
@exported-using-ghexport

Differential Revision: [D93145845](https://our.internmc.facebook.com/intern/diff/D93145845/)
chizkiyahu pushed a commit to chizkiyahu/executorch that referenced this pull request Feb 23, 2026
… conv has multiple users

Pull Request resolved: pytorch#17430

The FuseClampPass fuses patterns like conv -> relu into a single conv_with_clamp op. However, it did not check whether the convolution node's output has multiple consumers before fusing. When a conv output feeds both a relu and another op (e.g. a skip connection), fusing the relu into the conv incorrectly applies the activation to all consumers, corrupting the skip connection values.

This was causing incorrect output in the MetaNet GreenScreen model, where decoder projection convolutions feed both into ResidualConvUnit (through relu) and into skip connections (without relu). The fix adds a check that the preceding conv has exactly one user before allowing fusion.
ghstack-source-id: 340983071
@exported-using-ghexport

Differential Revision: [D93145845](https://our.internmc.facebook.com/intern/diff/D93145845/)
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