Skip to content

Conversation

@jikechao
Copy link
Member

This PR fixes an issue where pooling window size calculations incorrectly used the input dtype, which could lead to:

  • Division truncation artifacts with small integer types (e.g., int8)
  • Potential divide-by-zero errors in certain cases

The fix ensures proper window size calculation independent of input type and fixed #17938. In addition, I also added a CI test.

@jikechao jikechao changed the title Fix integer averaging for pooling window calculation Fix division truncation in window size calculation for small dtypes in average_pool May 26, 2025
@jikechao
Copy link
Member Author

cc @Hzfengsy @tqchen @vinx13 @mshr-h

@mshr-h mshr-h merged commit fbd9fe4 into apache:main May 26, 2025
10 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
…n average_pool (apache#18014)

* Update pooling.h

* Update test_te_create_primfunc.py

* fix lint error
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.

[Bug] InternalError: Check failed: pb->value != 0 (0 vs. 0) : Divide by zero

2 participants