Repository navigation
datadeps: NoAliasing arguments no longer share one slot - #792
Open
AnnaLena77 wants to merge 1 commit into
Open
AnnaLena77 wants to merge 1 commit into
AnnaLena77 wants to merge 1 commit into
Conversation
The slot cache (aliased_object!) is keyed by aliasing identity, and every NoAliasing value is equal, so the second distinct NoAliasing argument of a region was handed the first one's slot: the task that should have received its own value received another one's. A NoAliasing value has no aliasing to preserve, so it now gets its own copy instead of going through the cache. Regression test (test/mpi/noaliasing_args.jl, added to test/mpi/cpu.jl): a type whose aliasing is NoAliasing, one value per task, two partitions per rank, InOut buffers record which value each task saw. On upstream master at 2 ranks x 2 threads (MPICH) both assertions fail; with this change both pass.
This branch has not been deployed
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.
The Datadeps slot cache (
aliased_object!) is keyed by aliasing identity, and everyNoAliasingvalue compares equal, so the second distinctNoAliasingargument of a region was handed the first one's slot: a task received another task's value (no error, wrong data). ANoAliasingvalue has no aliasing to preserve, so it now gets its own copy instead of going through the cache (4 lines insrc/datadeps/aliasing.jl).Regression test
test/mpi/noaliasing_args.jl(included fromtest/mpi/cpu.jl): a type whosealiasingisNoAliasing, one value per task, two partitions per rank,InOutbuffers record which value each task saw. At 2 ranks x 2 threads (MPICH, Julia 1.13) both assertions fail on current master and pass with this change; the whole CPU MPI suite passes with it (1131 / 1134 assertions, both ranks). I could not reproduce it with Distributed workers alone (strings and a custom type with a move method did not trigger it), so the test is an MPI test.AI disclosure: I prepared this change with the help of Claude (Anthropic) and reviewed it myself.
🤖 Generated with Claude Code