-
Notifications
You must be signed in to change notification settings - Fork 6k
[Cpp API Compatibility] Align some compat APIs #78484
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
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
612af5b
[Cpp API Compatibility] remove CUDAStream::raw_stream()
youge325 79d3206
remove some other APIs
youge325 7b0aa86
remove useless annotation
youge325 aca2ddb
using alias for c10::Stream
youge325 fad90f1
fix compiling error
youge325 49bbefb
revert useless ScalarType first
youge325 037324e
resolve some mismatch, and fix compling error in FlashMLA
youge325 e84978c
fix
youge325 b86d507
align some APIs
youge325 1ebfd50
add align tests
youge325 42d09e9
align some APIs
youge325 440f7ca
align Allocator
youge325 ac5f9d6
Align Device
youge325 6bc0e10
Align TORCH_CHECK_OP and fix Device macro
youge325 ddeb051
add version.h, fix some cuda functions and storage test
youge325 cbfdfdc
try to fix Windows build
youge325 c559e67
align arange without dtype provided
youge325 a3358b0
Merge branch 'develop' into cAlign
youge325 67d25ff
refine arange
youge325 42da6dd
fix resize_
youge325 f7dc667
fix resize_ again
youge325 47f4809
Merge branch 'PaddlePaddle:develop' into cAlign
youge325 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,6 +70,7 @@ third_party/ | |
| *~ | ||
| bazel-* | ||
| .humanize | ||
| .codex | ||
|
|
||
| build_* | ||
| # clion workspace. | ||
|
|
||
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,22 +49,4 @@ inline void Tensor::record_stream(at::Stream s) const { | |
| #endif | ||
| } | ||
|
|
||
| #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) | ||
| inline void Tensor::record_stream(at::cuda::CUDAStream s) const { | ||
| record_stream(static_cast<at::Stream>(s)); | ||
| } | ||
|
|
||
| // TODO(youge325): Remove after DeepEP paddle branch is updated to use | ||
| // at::Stream | ||
| inline void Tensor::record_stream(cudaStream_t s) const { | ||
| auto dense_tensor = | ||
| std::dynamic_pointer_cast<phi::DenseTensor>(tensor_.impl()); | ||
| PD_CHECK(dense_tensor != nullptr, | ||
| "record_stream only supports DenseTensor, but got a non-dense " | ||
| "tensor implementation."); | ||
| PD_CHECK(dense_tensor->place().GetType() != phi::AllocationType::CPU, | ||
| "record_stream is not supported for CPU tensors."); | ||
| paddle::memory::RecordStream(dense_tensor->Holder(), s); | ||
| } | ||
| #endif | ||
| } // namespace at | ||
|
Comment on lines
49
to
52
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
After removing the
record_stream(at::cuda::CUDAStream)/record_stream(cudaStream_t)overloads, the earlier forward-declaration block forc10::cuda::CUDAStreamin this header (and its accompanying comment about the overload) is now unused/misleading. Please remove or update that forward-declaration/comment block to reflect the new API surface.