feat: design a generic memory space staging API#205
Draft
dssgabriel wants to merge 5 commits intokokkos:developfrom
Draft
feat: design a generic memory space staging API#205dssgabriel wants to merge 5 commits intokokkos:developfrom
dssgabriel wants to merge 5 commits intokokkos:developfrom
Conversation
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
46c64da to
e0a6a0b
Compare
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
e0a6a0b to
29eb2f2
Compare
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Signed-off-by: Gabriel Dos Santos <gabriel.dossantos@cea.fr>
Member
cedricchevalier19
left a comment
There was a problem hiding this comment.
I think it is not easy to review this PR without the use case.
Do you mind doing another PR with the usage of the API?
16 tasks
Collaborator
Author
@cedricchevalier19 I have opened #208, which implements host staging for P2P interfaces in the MPI backend. I will do collectives next, but you can start to have a look already. |
Collaborator
Author
|
I am turning this into a draft. My plan is to rework this PR to let users stage a View in any memory space. |
Member
|
That makes sense, thank you. |
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.
This PR introduces a minimal API that allows us to perform host staging whenever the underlying communication backend does not support GPU-aware operations (currently, this can only occur with MPI):
stage_for: creates a mirror view if the passed view type isn't host-accessible, otherwise returns the same viewcopy_back: deep copies the host mirror view back to the device view when it is not host accessible (required for receive operations), otherwise does nothingI am restricting this API to internal use for now, hence it is behind the
Impl::namespace.This is a critical feature that is needed to properly fall back to pure CPU-based communications in order to support MPI routines that are not yet GPU-aware (e.g. non-blocking collectives in Open MPI).
Usage would look something like so (here in
mpi::iallreduce):I added some unit tests to verify that it somewhat works as is, but I am not yet fully satisfied with the design.
Some open questions: