Closed badisa closed 3 months ago
Nice improvements!
Observation: In the posted timings,
k_log_flat_bottom_bond
is more expensive thank_flat_bottom_bond
. Don't know if that's mostly becausek_log_flat_bottom_bond
is being invoked on a larger number of pairs (n_pairs = n_atoms - n_local_atoms - 1
vs.n_pairs = n_local_atoms - 1
), or if the arithmetic cost per pair is higher, or if the cost of the competing atomic adds is higher (in each case, I believe each coord of the central atom needs to receiven_pairs
atomicAdds?)... In a later pass, it may be good to re-profile at a range ofn_atoms
,n_local_atoms
...
Taking a look at the log flat bottom, I noticed there were two exp calls when there could be one (about 200-500ns faster). Fixed in https://github.com/proteneer/timemachine/pull/1297/commits/13b751c0a4626730d13947ad16d66d3f486e8257 and also avoided 3 divisions in favor of 1 diversions and 3 multiplies. The second didn't really make a difference, but to be consistent with the flat bottom version
pow
calls in the flat bottom kernel. Makes for a 2x speed up of the kernel, though doesn't appear to matter much for the benchmarks.Kernel Timings
Kernels are 2x faster with the removal of the
pow
calls, both in float/double.Ran
pytest -k flat_bottom_bond
to generate the timingsMaster
PR
Benchmarks
Only showing the local MD benchmarks as these changes only impacts local MD performance. Seems to be pretty much a wash when run in local MD, which appears to be due to the fact that this was never a bottleneck for local MD.
It appears that the local MD benchmarks are not converged. Looking at the output of
nsys
shows that the total run time of the flat bottom restraint went from 2.9% to 1.4% of the total runtime. Think that the other kernels (and perhaps set up time) is where the overhead is.Run on A10, Cuda Arch 8.6
Master
PR