Fold constant_pad_nd into convolution input padding#20553
Conversation
Summary: When using padding="same" for a conv with even kernels, `torch.export` creates an explicit pad node, leading to a dq -> pad -> conv chain, which is not recognized, so conv ends up undelegated. The ReLU ends up in its own partition with a quantize. XNNPACK does not support this, resulting in `xnn_status_unsupported_parameter`. This PR fixes this, allowing for full delegation to XNNPACK in this case, by pulling the pad into the same partition as the conv, and then re-folding it back into the conv itself in the XNNPACK input padding metadata, as XNNPACK *does* support this. Differential Revision: D109871964
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20553
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a04093b with merge base b919db7 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@JakeStevens has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109871964. |
This PR needs a
|
Summary:
When using padding="same" for a conv with even kernels,
torch.exportcreates an explicit pad node, leading to a dq -> pad -> conv chain, which is not recognized, so conv ends up undelegated. The ReLU ends up in its own partition with a quantize. XNNPACK does not support this, resulting inxnn_status_unsupported_parameter.This PR fixes this, allowing for full delegation to XNNPACK in this case, by pulling the pad into the same partition as the conv, and then re-folding it back into the conv itself in the XNNPACK input padding metadata, as XNNPACK does support this.
Differential Revision: D109871964