-
Notifications
You must be signed in to change notification settings - Fork 26
Reviving Kokkos Kernels backend #306
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
base: main
Are you sure you want to change the base?
Conversation
Some things have changed including various namespaces headers and signatures. With dot seems to compile correctly unfortunately something related to conjugate is failing at compile time. Let's fix that and try to run the dot_kk test. Signed-off-by: Luc Berger-Vergiat <[email protected]>
Not quite sure why overloads are defined for non complex types? Signed-off-by: Luc Berger-Vergiat <[email protected]>
It looks like various changes were made over time and did not necessarily propagate to the Kokkos Kernels implementation which now creates some issues in the namespace hierarchy... Signed-off-by: Luc Berger-Vergiat <[email protected]>
Signed-off-by: Luc Berger-Vergiat <[email protected]>
Signed-off-by: Luc Berger-Vergiat <[email protected]>
Signed-off-by: Luc Berger-Vergiat <[email protected]>
Signed-off-by: Luc Berger-Vergiat <[email protected]>
return extent1 == Kokkos::dynamic_extent || | ||
extent2 == Kokkos::dynamic_extent || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For an include file that might be exposed to users, should we consider using the namespace macro instead of hard-coding it as "Kokkos"?
return extent1 == Kokkos::dynamic_extent || | |
extent2 == Kokkos::dynamic_extent || | |
using MDSPAN_IMPL_STANDARD_NAMESPACE::dynamic_extent; | |
return extent1 == dynamic_extent || | |
extent2 == dynamic_extent || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kokkos promises the mdspan types in the Kokkos namespace. In the future these may be aliases to std:: classes but they are not right now (we don't have a full C++26 compatible std implementation, even the C++23 ones which exist can't support GPUs). Since KokkosKernels depends on core I think it's fine to use the Kokkos namespace here.
...mplementations/include/experimental/__p1673_bits/kokkos-kernels/mdspan_to_view_mapper_kk.hpp
Show resolved
Hide resolved
I wasn't able to comment on the relevant line of code, but one generally can't include
|
{ | ||
const auto size = v.extent(0); | ||
if (size == 0) { | ||
throw std::runtime_error("abs_max() requires non-empty input"); | ||
} | ||
const auto i = std::experimental::linalg::vector_idx_abs_max(v); | ||
const auto i = MDSPAN_IMPL_STANDARD_NAMESPACE::MDSPAN_IMPL_PROPOSED_NAMESPACE::linalg::vector_idx_abs_max(v); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments elsewhere on use of namespace macros vs. hard-coding "Kokkos"; thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this up! : - )
I'm totally fine with merging this after some fixes that I discussed in the comments. In particular, if you could please fix the non-kokkos-kernels test rather than commenting out those lines of code, that would be most excellent; thanks!
For the longer term, we should think about where projects like this should live. The software dependency diagram has an uncomfortable cycle: KokkosCore depends on the C++ Standard Library, kokkos-kernels depends on KokkosCore, std::linalg depends on kokkos-kernels?!?
tpl-implementations/include/experimental/__p1673_bits/kokkos-kernels/blas1_dot_kk.hpp
Outdated
Show resolved
Hide resolved
First this isn't actually a standard library implementation here. If (or maybe optimistically "when") we contribute this stuff I am not sure that we could move the KokkosKernels impl with it. But if we did the answer to the dependency thing is simple. std::linalg -> KokkosKernels -> KokkosCore -> std stuff not including linalg (i.e. mdspan and what not). These internal dependencies in the library are not uncommon. The same would be true for calling cuBLAS or oneMKL inside the standard implementation. Both of those also have a dependency on the standard library. Same is already true for stuff like using TBB inside the parallel algorithms implementation. |
Next commit will tackle the issues associated with namespaces. Signed-off-by: Luc Berger-Vergiat <[email protected]>
Considering that I include |
Signed-off-by: Luc Berger-Vergiat <[email protected]>
@lucbv wrote:
Main thing is to pick one or the other : - ) |
@@ -290,10 +290,6 @@ namespace { | |||
{ | |||
using MDSPAN_IMPL_STANDARD_NAMESPACE :: MDSPAN_IMPL_PROPOSED_NAMESPACE :: linalg::impl::has_conj; | |||
|
|||
static_assert(! has_conj<int>::value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious -- what was wrong with these static_assert
s? Why was this test affected by the kokkos-kernels back-end?
Refreshing some of the implementation of the Kokkos Kernels backend so that we can re-compile and run the tests.
Mostly changing namespaces and a few signatures that changed, especially that of
std::extents
.The mdspan_to_view test compiles and fails at runtime because the checks are not correct.
utest_dot_kokkos_exe
test compiles and passes.Note: something is not working with the complex test and I'm choosing to ignore it for the time being but if you have ideas for it let me know...
Let me know if you want the general approach I took to be changed or if modifying the other tests along the same lines would be reasonable?