Prevent Early Release of AllocationPtr in test_from_blob#65023
Merged
zyfncg merged 1 commit intoPaddlePaddle:developfrom Jun 23, 2024
Merged
Prevent Early Release of AllocationPtr in test_from_blob#65023zyfncg merged 1 commit intoPaddlePaddle:developfrom
test_from_blob#65023zyfncg merged 1 commit intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Collaborator
|
CI failed but it was NOT related to this PR /paddle/paddle/phi/core/storage_properties.h:20:10: fatal error: 'paddle/phi/core/utils/type_registry.h' file not found
#include "paddle/phi/core/utils/type_registry.h" |
|
Sorry to inform you that 42e0daf's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
zyfncg
approved these changes
Jun 23, 2024
co63oc
pushed a commit
to co63oc/Paddle
that referenced
this pull request
Jun 25, 2024
Co-authored-by: lawrence910426 <lawu@nvidia.com>
co63oc
pushed a commit
to co63oc/Paddle
that referenced
this pull request
Jun 25, 2024
Co-authored-by: lawrence910426 <lawu@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 Category
Others
PR Types
Bug fixes
Description
The
Allocate()function returns aunique_ptr. When we chain the functions and callptr(), the originalunique_ptris released, making the accessed memory invalid.To address this issue, we must retain the
unique_ptruntil the memory is no longer in use.With a stream-safe allocator, this bug is not immediately apparent because the allocator does not trigger cudaFree immediately. However, with an async allocator, the bug is detected due to stricter memory management.