-
Notifications
You must be signed in to change notification settings - Fork 30
Fix interpolation on GPU #438
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
Conversation
|
@JoMee there is a unit test failing in the CI, which is AssembleRHS on CPU. However, this test passes on Alps. I assume it's due to different tolerances on different systems. I have not changed any types in the FEMInterpolate though, so I do not understand why it wouldn't work if it was working before. I checked the output and the numbers are pretty close (see CI Allure report for PR #438). Do you have any idea? |
|
Adding a KOKKOS_INLINE_FUNCTION constructor did not help. Should I try to go the helper class way or are we fine with this as it is? |
If it is relatively easy and not make take much time it can be done. Otherwise I would suggest to defer it to prioritize other efforts for the paper. |
|
Then I would say let's merge this as I have found another GPU issue in the FEM+Landau, so I will concentrate on that for now, then will come back to this once we have it working. I can open an issue for it. |
FEMInterpolate.hpp does not work on GPU. Error: CUDA ILLEGAL INSTRUCTION.
It seems that this is happening due accessing functions of the FEM space inside the Kokkos loop, which cannot be done as the FEM space contains host functions too, so trying to access its functions on device results in errors, as the FEMInterpolate is not within the FEM space class so cannot put the loop inside the class and use KOKKOS_CLASS_LAMBDA.
To fix this, there is now a possibility to create a lightweight device copy of a FEM space through the function space.getDeviceMirror(), which returns a struct containing all the relevant members and functions of the LagrangeSpace class which are needed in FEMInterpolate, and which contains stuff which can be fully on device (only KOKKOS_FUNCTIONS). The signature of the FEMInterpolate functions have not changed, but inside the FEMInterpolate functions we get a device mirror of the space (so a DeviceStruct) before going into the Kokkos loop, and then access the functions of this one.
Minor changes: changed the
locate_element_nd_and_xifunction to not take the mesh but only the quantities it needs (mesh spacing and origin).