Skip to content

Conversation

@wanghaoshuang
Copy link
Contributor

PR types

Others

PR changes

OPs

Describe

  1. Add cuda kernel
  2. Add align corners options
1. Add cuda kernel 2. Add align corners options test=develop
@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@wanghaoshuang
Copy link
Contributor Author

wanghaoshuang commented Aug 18, 2020

问题一、能否将对3D的支持推迟一下?

  1. 时间紧迫,支持3D引入的未知风险,有可能导致该PR延期合入Paddle2.0
  2. 支持3D的需求相对不是很多,cudnn的实现只支持2D

问题二、还需要为paddle.nn.functional.affine_grid写单测么?

  1. paddle.nn.functional.affine_grid是直接alias自paddle.fluid.layers.affine_grid, 也就是完全一样的实现
@willthefrog
Copy link
Contributor

问题一、能否将对3D的支持推迟一下?

  1. 时间紧迫,支持3D引入的未知风险,有可能导致该PR延期合入Paddle2.0
  2. 支持3D的需求相对不是很多,cudnn的实现只支持2D

问题二、还需要为paddle.nn.functional.affine_grid写单测么?

  1. paddle.nn.functional.affine_grid是直接alias自paddle.fluid.layers.affine_grid, 也就是完全一样的实现
  1. yes, only add 3d support if time permits
  2. a new version should be add in nn.functional, as there are changes to the API.
namespace ops = paddle::operators;
REGISTER_OP_CUDA_KERNEL(
affine_grid,
ops::AffineGridOpKernel<paddle::platform::CUDADeviceContext, float>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the cuda version mostly reused the eigen implementation? some preliminary benchmark would be nice if time permits.

Copy link
Contributor Author

@wanghaoshuang wanghaoshuang Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added CUDA kernel.
I will give some performance benchmark on CUDNN version and CUDA kernel version in the future.
Currently, it will use CUDNN kernel when align_corners is true and use CUDA kernel when align_corners is false.

willthefrog
willthefrog previously approved these changes Aug 24, 2020
Copy link
Contributor

@willthefrog willthefrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need subsequent PR to add support for higher dimensions, otherwise LGTM

saxon-zh
saxon-zh previously approved these changes Aug 24, 2020
Copy link

@saxon-zh saxon-zh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wanghaoshuang wanghaoshuang dismissed stale reviews from saxon-zh and willthefrog via de31410 August 24, 2020 07:03
Copy link
Contributor

@willthefrog willthefrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wanghaoshuang wanghaoshuang merged commit a065a24 into PaddlePaddle:develop Aug 25, 2020
@wanghaoshuang wanghaoshuang deleted the grid_api branch August 25, 2020 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants