Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Pad/AveragePool fusion #23190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mayeut
Copy link
Contributor

@mayeut mayeut commented Dec 24, 2024

Description

Fusing Pad & AveragePool requires AveragePool to use count_include_pad=1. If the AveragePool already set some padding and count_include_pad=0, fusion can't happen.

This PR adds a condition to perform fusion depending on those attributes. If fusion occurs, count_include_pad is always set to 1.

Motivation and Context

Fix #22177 (mislabelled as a performance issue but there's an actual bug in the implementation)

Fusing Pad & AveragePool requires AveragePool to use `count_include_pad=1`.
If the AveragePool already set some padding and `count_include_pad=0`, fusion can't happen.

This PR adds a condition to perform fusion depending on those attributes. If fusion occurs,  `count_include_pad` is always set to `1`.

Fix microsoft#22177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Performance] Inconsistent Tensor Output with Optimizations Enabled/Disabled (Pad Fusion Issue)
1 participant