Exploring single precision on GPUs #2
apalha
started this conversation in
Development
Replies: 1 comment 1 reply
-
I have made a git account edgacoustics for the GPU desktop and an email (details go over email). The code is now available on the desktop. I ran the code and for the coarse grid I got about 2x speedup and for the fine about 3x to 4x speedup (on the overall time per time step). We need now to profile the code and see what is speeding up and what is not and see what can be done. But first, it is important that you check that the code is performing properly with single precision. If not, then we need to address that first before we start optimizing the code. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@hqwang815, @ipelupessy,
Following up on our last meeting, I have done the following:
Setup the code so that we can now easily switch between single/dual precision and gpu/cpu
You can do that by changing the values of the flags useGPU and useSingle in lines 25 and 26, e.g., if you set both to true you get a gpu computation with single precision.
Constructed a simple benchmark script to check the speed up of matrix – matrix multiplication and elementwise multiplication with single precision
I can see a speedup of about 20x for this block of operations, we still need to test the full code, but the result is promising.
Tested the CPU version of the code with single precision and compared to double precision.
The single precision results differ from the double precision by an error smaller than three orders of magnitude less. Could you test this more thoroughly? I just ran the simulation for 4 seconds and compared the solutions. I also separately compared some of the matrices that appear in the computations and the differences where 10^-7 (as expected). If you could for example check the locations where more issues may appear (smaller elements, or other physical factors).
I have not run the code in the Desktop with the GPU because I did not want to install anything on the computer without discussing with you. Is it ok to install the github desktop app so that we can manage the repository there (the repository is private)? I need to figure out the best way to share that app with only one windows account to avoid us both sharing our credentials. @Inti Pelupessy do you know of an easy solution to this?
Once we download the latest version of the code, I will benchmark it with single precision on the GPU and see the speedup.
Tomorrow I will work on the Firedrake implementation of the wave equation with DG so that we can check if it is a viable way to go.
Beta Was this translation helpful? Give feedback.
All reactions