Skip to content

Conversation

@ivangarcia44
Copy link
Contributor

@ivangarcia44 ivangarcia44 commented Apr 28, 2025

In this pull request I added various E2E tests to cover edge cases on the average pooling torch to linalg lowering algorithm. These new tests uncovered various numerical issues that were addressed in this same PR.

One of the issues is the IREE test failure found in #4079 which triggered this work.

Background:

In the most common case, the divisor for the average pooling is just the product of kernel dimensions. But with padding, and ceil mode options, some elements need to be discounted from the divisor computation. This change fixes two components of this:

  1. Fix the condition that determines if the divisor is just the product of kernel dimensions or the clamped divisor comptutation.
  2. Reimplement the clamped divisor computation algorithm.

The clamped divisor algorithm had various numerical issues uncovered by the new E2E tests added here. In this new version all E2E pass, the variables have more specific names, and there are comments explaining the formula.

This PR is an improvement and replacement of this PR: #4144.

@vivekkhandelwal1
@JianzheXiao
@AmosLewis
@rsuderman
@nirvedhmeshram)
@sahas3
@Hanumanth04
@dixinzhou
@rafaelubalmw

@ivangarcia44
Copy link
Contributor Author

Will address the merge issue in the original PR.

#4144

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.

1 participant