solve slice inplace illegal memory address bug #34265
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
OPs
Describe
问题
decoupledsegnet、hardnet单卡,batch_size=1训练报错,问题定位于PR32266。
原因
经
cuda-memcheck
排查发现在ElemwiseGradBroadcast2CUDAKernel
处出现了非法内存访问导致出core。经分析原因在于Tensor实际分配大小与需求不一致,定位问题点在于SliceGradKernel
的need_pad_num == 0
判断有问题,直接跳过导致没有分配合适的空间,删去该判断逻辑后运行就正常了。