ND Spline Evaluator#967
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (83.92%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #967 +/- ##
==========================================
- Coverage 95.16% 94.75% -0.41%
==========================================
Files 69 72 +3
Lines 2958 3072 +114
Branches 944 976 +32
==========================================
+ Hits 2815 2911 +96
- Misses 91 104 +13
- Partials 52 57 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tpadioleau
left a comment
There was a problem hiding this comment.
You also need to declare the new header file in the target_sources to make the installation test pass
40adb73 to
fab1202
Compare
0b394b6 to
41df7f3
Compare
41df7f3 to
3d069d2
Compare
|
The compilation passes, but I got some test failures on cuda that I'm still investigating (the first one is unrelated to this PR), I haven't tested on hip yet. 147 - DeviceForEachSerialDevice.OneDimension (Failed)
776 - BatchedNd1dSplineDeviceGrevilleUniformDegree2.2DXB1 (Failed)
777 - BatchedNd1dSplineDeviceGrevilleUniformDegree2.2DB1X (Failed)
800 - BatchedNd1dSplineDeviceGrevilleUniformDegree5.2DXB1 (Failed)
801 - BatchedNd1dSplineDeviceGrevilleUniformDegree5.2DB1X (Failed)
840 - BatchedNd1dSplineDeviceHermiteUniformDegree5.2DXB1 (Failed)
841 - BatchedNd1dSplineDeviceHermiteUniformDegree5.2DB1X (Failed)
923 - BatchedNd3dSplineDeviceGrevilleUniformDegree2.3DXYZ (Failed)
959 - BatchedNd3dSplineDeviceGrevilleUniformDegree5.3DXYZ (Failed)
1019 - BatchedNd3dSplineDeviceHermiteUniformDegree5.3DXYZ (Failed)Full outputI'm also working on the tuple implementation on a separate repo, I cleaned things up a bit and started working on the clang tidy warnings. |
|
The errors don't actually come from my changes it seems, on adastra mi250x in Release, I have failures on both the Nd and 1d/3d tests (kokkos/kokkos kernels 5.0.2, ginkgo 1.11.0, amdclang++ 6.2.1) Full output |
I think we need rocm 6.3.3 to make the splines tests work. I don't know what is happening for |
I still had failures with 6.4.3, I think I'll put this on hold and investigate after I return from hpsf community summit |
It looks like the errors were related to my installation of the dependencies, I retried with everything installed with spack, but I still got some errors on the ND 3d that I'm investigating Full output |
|
If this can help, you can assume C++20 from now on. |
- works for host backends for the moment
- test the 1d ND evaluator - rename the 3d test file
- Make the DerivDims template argument non-variadic - Add tests for one of the deriv_dim_I overloads
- This will need to be cleaned, some headers (ex: apply.hpp) are not used
- update the tuple to c++20 - fix clang-tidy warnings - do not use CTAD (as nvcc fails with single argument ctors)
|
The tests are passing on Jean-Zay h100 |
Thanks, ready to review then ? |
Yes |
tpadioleau
left a comment
There was a problem hiding this comment.
Great job, let me know if some comments are not clear or need discussion
| @@ -0,0 +1,159 @@ | |||
| // NOLINTBEGIN(readability-identifier-naming) | |||
| // SPDX-FileCopyrightText: 2026 CExA-project | |||
There was a problem hiding this comment.
I don't see the copyrights of the initial implementation ?
Also I don't think we need the date, we don't put it in the rest of the repo and it looks confusing to me.
| @@ -0,0 +1,159 @@ | |||
| // NOLINTBEGIN(readability-identifier-naming) | |||
| // SPDX-FileCopyrightText: 2026 CExA-project | |||
| // SPDX-License-Identifier: MIT or Apache-2.0 with LLVM-exception | |||
There was a problem hiding this comment.
Was it originally multi-licensed ?
| template <class> | ||
| constexpr bool is_reference_wrapper_v = false; | ||
| template <class U> | ||
| constexpr bool is_reference_wrapper_v<std::reference_wrapper<U>> = true; |
There was a problem hiding this comment.
| template <class> | |
| constexpr bool is_reference_wrapper_v = false; | |
| template <class U> | |
| constexpr bool is_reference_wrapper_v<std::reference_wrapper<U>> = true; |
Can we really support std::reference_wrapper in a device compatible tuple ?
| #include <array> | ||
| #include <cstddef> | ||
| #include <ranges> | ||
| #include <type_traits> // integral_constant |
There was a problem hiding this comment.
| #include <type_traits> // integral_constant | |
| #include <type_traits> |
|
|
||
| if constexpr (std::is_function_v<Pointed>) { | ||
| if constexpr (is_derived_object) { | ||
| return (std::forward<Object>(object).*member)(std::forward<Args>(args)...); |
There was a problem hiding this comment.
For DDC usage of std::forward is ok on device code but in Kokkos I guess it is not ?
| auto const spline_coef_ND = spline_coef[j]; | ||
| ddc::device_for_each( | ||
| evaluation_domain(spline_eval.domain()), | ||
| [=, *this](evaluation_domain::discrete_element_type const i) { |
There was a problem hiding this comment.
| [=, *this](evaluation_domain::discrete_element_type const i) { | |
| [&](evaluation_domain::discrete_element_type const i) { |
| auto const spline_coef_ND = spline_coef[j]; | ||
| ddc::device_for_each( | ||
| evaluation_domain(spline_eval.domain()), | ||
| [=, *this](evaluation_domain::discrete_element_type const i) { |
There was a problem hiding this comment.
| [=, *this](evaluation_domain::discrete_element_type const i) { | |
| [&](evaluation_domain::discrete_element_type const i) { |
| integrals(j) = 0; | ||
| ddc::device_for_each( | ||
| ddc::DiscreteDomain<BSplines...>(), | ||
| [=](ddc::DiscreteDomain<BSplines...>::discrete_element_type const i) { |
There was a problem hiding this comment.
| [=](ddc::DiscreteDomain<BSplines...>::discrete_element_type const i) { | |
| [&](ddc::DiscreteDomain<BSplines...>::discrete_element_type const i) { |
There was a problem hiding this comment.
I see multiple extended lambdas inside member functions of a class with multiple variadic template parameters, I hope this will work fine for nvcc.
| KOKKOS_LAMBDA(batch_domain_type<BatchedDDom>::discrete_element_type const j) { | ||
| integrals(j) = 0; | ||
| ddc::device_for_each( | ||
| ddc::DiscreteDomain<BSplines...>(), |
There was a problem hiding this comment.
| ddc::DiscreteDomain<BSplines...>(), | |
| ddc::DiscreteDomain<BSplines...>(spline_coef.domain()), |
I think it would even be better to construct this object outside of the parallel_for_each to avoid each thread paying for this ?
|
I think it also deserves a new contribution entry in the AUTHORS |
|
May need to rebase on main to make the CI work |
This PR adds a SplineEvaluatorND class working in any number of dimensions. Currently, the template arguments to the class and to the methods are passed using
TypeSeqs, and the aliasesalias_1, alias_2, etcare replaced by templated equivalentsalias<0>, alias<1>, etc.The tests for this are just the 3D spline test and one of the 1D spline test modified to use the ND evaluator. We might want to factorize some of the test code or use the same test files with some
#ifdefs to enable the ND or regular Evalutor