-
Notifications
You must be signed in to change notification settings - Fork 407
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
Kokkos::StaticCrsGraph does not propagate memory traits (e.g., Unmanaged) #1581
Comments
Uhm, why do you need Unmanaged at compile time for this? The StaticCrsGraph could just have runtime unmanaged views couldn't it? From the top of my head I can't think of a reason why this should have any effect like crashing. |
@mhoemmen An extra defaulted template parameter like |
@crtrott wrote:
I think what's happening is that @rppawlo is doing something like this:
This invokes the |
Roger could still work around by creating unowned Views manually, but the above behavior is surprising. |
It also seems like quite a bit of extra work to do this. Mark's example is exactly what I am doing. Maybe I am wrong, but doesn't rebuilding the runtime unmanaged CrsMatrix require rebuilding all the views used in the graph, then rebuild the graph, then rebuild all views in the CrsMatrix to make sure everything is unmanaged? The code above jumps from a few lines to quite a lot. |
@rppawlo That's correct, the above example would expand quite a bit. The sensible thing to do for now would be to write a "getUnmanagedLocalMatrix" function that encapsulates all that code. |
Just to follow up, here's the difference in the code. If the unmanaged template parameter worked through all objects, the inner loop looks like this:
Instead, with the runtime interface the inner loop looks like:
|
I see. Nathan if you want to take this, give it a shot. It shouldn't be all that hard (I hope ;-) ). |
I'll work on it, the KokkosKernels changes will need to be synced/follow the Kokkos changes though. It looks like the the |
The use case above didn't work on cuda. Had to go through and mark a bunch of functions in the CrsMatrix and CrsGraph and sub-structs with KOKKOS_INLINE_FUNCTION. PRs for kokkos: PR for kokkos-kernels: The kokkos-kernels PR will probably require the kokkos PR to be accepted first. If these are both accepted in the kokkos repos, can I push the corresponding changes to the current Trilinos snapshot? |
Changes required to build a view of CrsMatrices #1581
@ndellingwood I reviewed #1595. Short answer: this will break backwards compatibility; I'm OK with that, but if it's a problem, we could use a variadic type alias (see review for details). |
This requires kokkos changes discussed in kokkos/kokkos#1581.
@rppawlo Kokkos PR #1595 to address this issue was merged, I'm adding this comment to point out that the order of the memory traits template parameter |
Thanks @ndellingwood ! I will change over on the next snapshot into Trilinos. |
@rppawlo has been working on a "View of StaticCrsGraph" pattern. It's been crashing unexpectedly. I investigated and noticed that
Kokkos::StaticCrsGraph
does not propagate memory traits (e.g., Unmanaged, which is what matters here) to its Views. Therow_map_type
,entries_type
, androw_block_type
typedefs only use the layout and device type.We could fix this by using the
traits
typedef in StaticCrsGraph. Thetraits
typedef takes into account theArg1Type
andArg2Type
template parameters of StaticCrsGraph.The text was updated successfully, but these errors were encountered: