Commit c4209bb
[ET-VK][ez] Fix FuseClampPass incorrectly fusing conv+activation when 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/)1 parent 7f1eb4d commit c4209bb
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
0 commit comments