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

Add nn.AdaptiveAvgPool1d and nn.AdaptiveAvgPool3d #5445

Merged
merged 42 commits into from
Jul 22, 2021

Conversation

terryzhao127
Copy link
Contributor

@terryzhao127 terryzhao127 commented Jul 9, 2021

  • Add nn.AdaptiveAvgPool1d and nn.AdaptiveAvgPool3d ops
  • Generalize kernel functions for different ops (1d, 2d, 3d)
  • Implement CPU version
  • Implement GPU version
  • Support data with larger size (according to torch.nn.AdaptiveAvgPoolxd)
  • Add test case
  • Add functional API
  • Add docs
  • Support different data_format: channels_first and channels_last

Docs:
image
image
image
image

@terryzhao127 terryzhao127 marked this pull request as ready for review July 16, 2021 14:03
@terryzhao127
Copy link
Contributor Author

terryzhao127 commented Jul 16, 2021

  • Support different data_format: channels_first and channels_last

@BBuf 除了最后一条,均已实现,暂时不支持channels_last格式的输入

@terryzhao127
Copy link
Contributor Author

terryzhao127 commented Jul 18, 2021

上述问题均已解决 @BBuf

@terryzhao127 terryzhao127 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 21, 2021 08:38
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 21, 2021 08:39
@github-actions
Copy link
Contributor

CI failed, removing label automerge

@oneflow-ci-bot oneflow-ci-bot removed their request for review July 21, 2021 09:41
@oneflow-ci-bot oneflow-ci-bot self-requested a review July 21, 2021 12:49
@github-actions
Copy link
Contributor

CI failed, removing label automerge

@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 21, 2021 23:23
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

PyTorch resnet50 time: 139.6ms (= 4189.4ms / 30, input_shape=[16, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 125.8ms (= 3774.8ms / 30, input_shape=[16, 3, 224, 224], backward is enabled)
Relative speed: 1.11 (= 139.6ms / 125.8ms)

PyTorch resnet50 time: 83.2ms (= 2495.9ms / 30, input_shape=[8, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 73.4ms (= 2201.9ms / 30, input_shape=[8, 3, 224, 224], backward is enabled)
Relative speed: 1.13 (= 83.2ms / 73.4ms)

PyTorch resnet50 time: 56.3ms (= 1687.8ms / 30, input_shape=[4, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 48.9ms (= 1468.2ms / 30, input_shape=[4, 3, 224, 224], backward is enabled)
Relative speed: 1.15 (= 56.3ms / 48.9ms)

PyTorch resnet50 time: 49.8ms (= 1494.7ms / 30, input_shape=[2, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 46.5ms (= 1394.7ms / 30, input_shape=[2, 3, 224, 224], backward is enabled)
Relative speed: 1.07 (= 49.8ms / 46.5ms)

PyTorch resnet50 time: 39.8ms (= 1194.0ms / 30, input_shape=[1, 3, 224, 224], backward is enabled)
OneFlow resnet50 time: 49.2ms (= 1477.2ms / 30, input_shape=[1, 3, 224, 224], backward is enabled)
Relative speed: 0.81 (= 39.8ms / 49.2ms)

@oneflow-ci-bot oneflow-ci-bot removed their request for review July 22, 2021 00:35
@oneflow-ci-bot oneflow-ci-bot merged commit 7b786b2 into master Jul 22, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the add_adaptive_avg_pool_xd branch July 22, 2021 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants