Dual Views managed by Python - #91
Open
jpr-snl wants to merge 14 commits into
Open
Conversation
keepAliveHost to properly handle the situation where the DualView.host_view() is an unmanaged alias of DualView.device_view(), as is the case when executing in Kokkos in SERIAL mode.
…counting of numpy arrays
…lues in examples.
Author
|
I was unable to test these torch examples with the new setup because I don't have torch_mlir installed in my environment: |
Author
|
It's also worth noting that this will be a breaking change for any existing code. We should do a minor version bump. To get access to LAPIS results you now have to call .asnumpy() or .asmemref() on the result object (unless it's a scalar). |
Merge branch 'main' into DualViewMerge
Signed-off-by: Brian Kelley <bmkelle@sandia.gov>
This change still applies since DualView::deallocate still resets impl. Signed-off-by: Brian Kelley <bmkelle@sandia.gov>
Merge in recent main changes into DualViewInPython
Collaborator
|
@jpr-snl I added Patch to update remaining examples: |
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.
Implements DualView class in Python to tie Kokkos View lifespans to python objects. This should eliminate what is effectively a large memory leak, where every LAPIS return value was kept alive until the Python interpreter exits. This change should also allow a significant reduction in Host <-> Device communication by allowing LAPIS results to stay resident within their Kokkos memory space via DualView.
It also fixes some more uninitialized value problems stemming from use of LLVM tensor.empty() in the examples.