-
Notifications
You must be signed in to change notification settings - Fork 11
Add ChunkBatch
interface to aggregate small messages before sending
#231
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
Open
nirandaperera
wants to merge
31
commits into
rapidsai:branch-25.06
Choose a base branch
from
nirandaperera:batch-input-partitions
base: branch-25.06
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
8b655ac
wip
nirandaperera 73a76ad
Merge branch 'branch-25.06' of github.com:rapidsai/rapids-multi-gpu i…
nirandaperera bd2093d
wip
nirandaperera 25f6117
wip
nirandaperera 5e5fbbf
Merge branch 'branch-25.06' of github.com:rapidsai/rapids-multi-gpu i…
nirandaperera a8ee7ba
chunk batch definition
nirandaperera a05df4e
running precommit
nirandaperera 960bf2e
adding chunk visitor
nirandaperera 3080936
more comments
nirandaperera 0f0468a
addressign comments
nirandaperera 3c7695e
Merge branch 'branch-25.06' of github.com:rapidsai/rapids-multi-gpu i…
nirandaperera 7f11cb2
fix build
nirandaperera 62062ed
adding test
nirandaperera 1dfeda1
adding more comments
nirandaperera a90bf30
Merge branch 'branch-25.06' of github.com:rapidsai/rapids-multi-gpu i…
nirandaperera e0e6449
more tests
nirandaperera 4a871c3
using thrust equal
nirandaperera 0507d05
Merge branch 'branch-25.06' of github.com:rapidsai/rapids-multi-gpu i…
nirandaperera 708c67c
precommit
nirandaperera 9efc2e8
adding fwd iterator
nirandaperera 95f84ad
Merge branch 'branch-25.06' of github.com:rapidsai/rapids-multi-gpu i…
nirandaperera 057917d
merge conflicts
nirandaperera 1324063
running precommit
nirandaperera 32f1199
special case for batches with 1 payload
nirandaperera 9f236af
addressing comments
nirandaperera 29deb42
Merge branch 'branch-25.06' into batch-input-partitions
nirandaperera bfb5578
Merge branch 'branch-25.06' of github.com:rapidsai/rapidsmpf into bat…
nirandaperera f868416
running precommit
nirandaperera b17cee4
addressing comments
nirandaperera bc2895a
Merge branch 'branch-25.06' of github.com:rapidsai/rapidsmpf into bat…
nirandaperera f9906cd
precommit
nirandaperera 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
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 |
---|---|---|
|
@@ -65,7 +65,10 @@ class Chunk { | |
); | ||
|
||
/** | ||
* @brief Construct a new chunk of a partition. | ||
* @brief Construct a new chunk with no data. | ||
* | ||
* This is used to indicate the number of chunks that were sent for a particular | ||
* partition. | ||
* | ||
* @param pid The ID of the partition this chunk is part of. | ||
* @param cid The ID of the chunk. | ||
|
@@ -83,6 +86,8 @@ class Chunk { | |
/// If not zero, the number of chunks of the partition expected to get from the | ||
/// sending rank. Ignored when it is zero. | ||
std::size_t expected_num_chunks; | ||
/// If known, the size of the metadata buffer (in bytes). | ||
std::size_t metadata_size; | ||
/// If known, the size of the gpu data buffer (in bytes). | ||
std::size_t gpu_data_size; | ||
}; | ||
|
@@ -94,6 +99,17 @@ class Chunk { | |
*/ | ||
[[nodiscard]] std::unique_ptr<std::vector<uint8_t>> to_metadata_message() const; | ||
|
||
/** | ||
* @brief Serializes this chunk into a given metadata message buffer. | ||
* | ||
* @param msg The metadata message as a serialized byte vector. | ||
* @param offset The offset in the message buffer to start writing. | ||
* @returns The number of bytes written to the message buffer. | ||
*/ | ||
[[nodiscard]] std::ptrdiff_t to_metadata_message( | ||
std::vector<uint8_t>& msg, std::ptrdiff_t offset | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here if we accepted a |
||
) const; | ||
|
||
/** | ||
* @brief Construct a new chunk from a metadata message. | ||
* | ||
|
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.
Are these slice-based interfaces the best approach, or should we accept
span
-like things. That is, we could have aslice
method that returns aSpan
over aBuffer
and thencopy_to
could accept aSpan &dest
, this would push validation of offsets to theSpan
construction. etc...