-
Couldn't load subscription status.
- Fork 5.9k
Fix paddle.vision.ops.deform_conv2d API big Tensor #74058
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
Fix paddle.vision.ops.deform_conv2d API big Tensor #74058
Conversation
| 你的PR提交成功,感谢你对开源项目的贡献! |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (26.15%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@ ## develop #74058 +/- ## ========================================== Coverage ? 26.15% ========================================== Files ? 3 Lines ? 65 Branches ? 0 ========================================== Hits ? 17 Misses ? 48 Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…dle#74058)" This reverts commit 3067726.
…dle#74058)" This reverts commit 3067726.
…dle#74058)" This reverts commit 3067726.
PR Category
Operator Mechanism
PR Types
Bug fixes
Description
offset的反向传播公式为:
$$\frac{\partial L}{\partial \Delta p_n} = \sum_{p_0} \frac{\partial L}{\partial y(p_0)} \cdot w(p_n) \cdot \frac{\partial x (p_0 + p_n + \Delta p_n)}{\partial \Delta p_n}$$
其中:
paddle和torch在计算双线性插值反向时有diff。当点$p_0 + p_n + \Delta p_n$越界时,例如,$p_0 + p_n + \Delta p_n=(-1,0)$, paddle前向直接返回0,反向直接返回0。torch前向直接返回0,但是会给周围没有越界的点回传梯度。对齐torch实现后,精度可以对齐。这里保持了paddle的实现。paddle代码实现位置:https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/impl/deformable_conv_grad_kernel_impl.h#L62
;torch代码实现位置:https://github.com/pytorch/vision/blob/main/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu#L494。
怀疑是Matmul导致,Matmul修复后进行验证。
Pcard-73263