GPU with single/double precision

Dear LAMMPS developers and users,

Greetings. I am using the GPU package and encountering some problems.

I am using one HP blade with two GPU cards installed.

HP SL390 G7
CPU: Intel® Xeon® CPU X5675 @ 3.07GHz
Two CPU’s, each has 6 cores
cache size: 12,288 KB
Memory: 48 GB

Nvidia Tesla M2090
GPU: 512 cores
Total global memory: 6GB

I did several tests. Initially I use single-double precision on GPU, with a test case of simple LJ fluid test (no Coulomb force). I got about 13 speedup.

But then I switch to double-double on GPU, then the speedup was down to 6.

Then I tried to restart my SPC/E water case (originally run without GPU). I am not sure of the root cause, but LAMMPS only accepts GPU+CPU both to be in double precision. Then I got speedup as 2.

So, my questions are:

  1. Is it ok to use single precision in classical MD, since I can gain much more speedup with GPU?

  2. Would it be helpful to compile the main LAMMPS in single precision, in order to speed up the calculation? If yes, which parameter to be chosen?

Thank you for the help! :slight_smile:

LC Liu

Whether single precision is acceptable or not depends on many factors. It is usually preferable to at least use mixed precision kernels as the speedup is almost the same but the error in accumulation much lower.

You cannot compile lammps in single precision. Gpu speedup is dependent on many factors and thus your tests are insufficient.

Please see the many discussions on this touc in the mailing list archives and the relevant publications for more details.

Axel.

Hi, Axel,

Thank you for the information. I will dig into this topic.

LC Liu

2013/8/23 下午9:17 於 “Axel Kohlmeyer” <[email protected]> 寫道: