Fix AlltoallvOptions retaining stale split metadata - #528
Closed
taking-lying-flat wants to merge 1 commit into
Closed
taking-lying-flat wants to merge 1 commit into
taking-lying-flat wants to merge 1 commit into
Conversation
Author
|
Consolidated into #527 to keep these small Gloo correctness fixes in one review. The same Alltoallv split-metadata fix is included there as a separate commit; the combined version passed 706 existing tests and the additional reproduction checks. Closing this duplicate PR. |
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.
Reusing
AlltoallvOptionswith a differentelementsPerRankupdates the buffers but appends the new offsets and lengths to the existing vectors.alltoallv()still indexes their firstcontext->sizeentries, so the next collective uses the first configuration's splits. When the old lengths still match between peers and fit the new buffers, the operation returns normally with incorrectly distributed data.Clear
offsetsandlengthsbefore rebuilding them insplitOffsetsAndLengths(). The shared helper covers all four input/output setter implementations, including both raw pointers and ownedUnboundBuffers. The change is two lines and retains the vectors' allocated capacity.Reproduction with two connected ranks, after the first collective has completed:
Both calls return successfully, but the second call produces:
[10,20,21,22][10,11,12,20][11,12,13,23][13,21,22,23]Validation:
gloo_test --gtest_filter='*AlltoallvTest*': 32 existing tests passed, covering TCP/TCP_LAZY, one/two/four/seven ranks and multiple message sizes.context->sizeentries.clang-format 18.1.8 --dry-run --Werror gloo/alltoallv.ccandgit diff --checkpassed.Only the two production lines are included; no test files are changed. The communication checks ran on a single host using CPU TCP transport; other transports and the full repository suite were not run.