-
Notifications
You must be signed in to change notification settings - Fork 79
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
Kernel size is not supported in ttnn.avg_pool2d
#12151
Comments
There is a similarity between AvgPool2D and MaxPool2D (which already supports kernel size), so I think it might be a good idea to generalize MaxPool2D, similar to the generic reduction kernel. Here is the brief proposal:
|
@jerrysky3 The proposal sounds great -- would be good to have the generic reduce op support. In order to support |
Hi @mywoodstock Thanks for the feedback! I planned to work on this issue this and next week. And yes I will touch a little bit of the maxpool kernel, will there be any big conflict with your changes to generalize the input tensor shapes? (Or if you already have a sharable prototype, I can take a look to see where the change conflicts will be) |
@jerrysky3 These updates would be orthogonal to the tensor shape generalization updates, so should be easy to merge. |
### Ticket #12151 ### Problem description In ttnn currently there are `global_avg_pool2d` and `avg_pool2d`. Both of them do global average pooling (compute a single average of each channel). It seems that `avg_pool2d` is not a public API (couldn't be found on https://docs.tenstorrent.com/ttnn/latest/ttnn/ttnn) and most places in tt-metal use `global_avg_pool2d` This change removes the avg_pool2d and replace all its remaining usages with `global_avg_pool2d`. This frees up the name `ttnn.avg_pool2d` for the implementation of the actual average pooling API with kernel size (#12151) ### What's changed - Remove the export of `ttnn.avg_pool2d` (which is actually global average pool2d) - Replace the remaining usages of `avg_pool2d` in tt-metal with `global_avg_pool2d` ### Checklist - [x] Post commit CI passes (https://github.com/tenstorrent/tt-metal/actions/runs/11546482848) - [ ] Blackhole Post commit (if applicable) - [ ] Model regression CI testing passes (if applicable) - [ ] Device performance regression CI testing passes (if applicable) - [x] New/Existing tests provide coverage for changes Co-authored-by: Artem Yerofieiev <169092593+ayerofieiev-tt@users.noreply.github.com>
### Ticket #12151 ### Problem description In ttnn currently there are `global_avg_pool2d` and `avg_pool2d`. Both of them do global average pooling (compute a single average of each channel). It seems that `avg_pool2d` is not a public API (couldn't be found on https://docs.tenstorrent.com/ttnn/latest/ttnn/ttnn) and most places in tt-metal use `global_avg_pool2d` This change removes the avg_pool2d and replace all its remaining usages with `global_avg_pool2d`. This frees up the name `ttnn.avg_pool2d` for the implementation of the actual average pooling API with kernel size (#12151) ### What's changed - Remove the export of `ttnn.avg_pool2d` (which is actually global average pool2d) - Replace the remaining usages of `avg_pool2d` in tt-metal with `global_avg_pool2d` ### Checklist - [x] Post commit CI passes (https://github.com/tenstorrent/tt-metal/actions/runs/11546482848) - [ ] Blackhole Post commit (if applicable) - [ ] Model regression CI testing passes (if applicable) - [ ] Device performance regression CI testing passes (if applicable) - [x] New/Existing tests provide coverage for changes Co-authored-by: Artem Yerofieiev <169092593+ayerofieiev-tt@users.noreply.github.com>
Kernel size is not supported in
ttnn.avg_pool2d
Originally posted by @jdh8 in tenstorrent/pytorch2.0_ttnn#143 (comment)
The text was updated successfully, but these errors were encountered: