Paddle
Paddle copied to clipboard
Out of bound access on `test_sparse_sum_op`
PR Category
Operator Mechanism
PR Types
Bug fixes
Description
-
sum_kernel.cuThe size ofout_cols_datais onlyx_dim0 * x_dim1. It is illegal to access memory after x_dim0 * x_dim1. To prevent such illegal access, the loop inSumCsr3DGradCudaKernelis splitted into two loops. -
sum_grad_kernel.cuThe length ofx_crows_datais onlyx_dim0 * (x_dim1 + 1). Access tox_crows_data[x_dim0 * (x_dim1 + 1)]is in fact illegal. However,x_crows_data[x_dim0 * (x_dim1 + 1)]would be 0 to the alignment mechanism ofStreamSafeAllocator.
Moreover, dx_values_data would never be filled when index = x_dim0 * (x_dim1 + 1) - 1. Therefore, the last iteration of the loop could be ignored.
你的PR提交成功,感谢你对开源项目的贡献! 请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。 Your PR has been submitted. Thanks for your contribution! Please wait for the result of CI firstly. See Paddle CI Manual for details.
Sorry to inform you that 04f142b's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.
hi, @lawrence910426
- 非常感谢你对飞桨的贡献,我们正在运营一个PFCC组织,会通过定期分享技术知识与发布开发者主导任务的形式持续为飞桨做贡献,详情可见 https://github.com/luotao1 主页说明。
- 如果你对PFCC有兴趣,请发送邮件至 [email protected],我们会邀请你加入~