6 ms·
For sure another case for the "you doing it wrong" team at Nvidia. But the decision to add Julia/CUDA.jl here was not the best idea on a comparison with really
by qrios 3y ago
For sure another case for the "you doing it wrong" team at Nvidia.
But the decision to add Julia/CUDA.jl here was not the best idea on a comparison with really interesting insights about Fortran vs. Julia. The CUDA part of the code is nearly a one-to-one copy of the MPI code. Especially one sentence[1] (there are some similar, comparable blocks) explains why the code not performs very well.
[1] https://github.com/robertstrauss/MPAS_Ocean_Julia/blob/main/mode_forward/calculate_tendencies_cuda.jl#L49 https://github.com/robertstrauss/MPAS_Ocean_Julia/blob/main/...
- Bromeo 3y agoProbably they could get a nice speed up by changing the if condition from your link into a multiplication with (eoe != 0) two lines down instead.
- qrios 3y agoGood point! For me the beginner's mistake is: on a CPU any 'if' will cost you a clock cycle (branch prediction not considered), on a GPU it costs you the sync. In best case the syncs will come back over many loops, more often some cores will go out of sync more and more, eventually all other cores will have to wait for the last. Otherwise memory accesses will come blocking and that would cost all cores thousands of cycles.