Project

General

Profile

Task #2500

Feature #2054: PME on GPU

Task #2453: PME OpenCL porting effort

detect and allow linking external clFFT, or no clFFT

Added by Aleksei Iupinov about 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
build system
Target version:
Difficulty:
simple
Close

Description

When https://gerrit.gromacs.org/7837 is getting merged, Gromacs OpenCL builds start always linking to the bundled clFFT.
We should be able and prefer to link to the system clFFT by default though.
That might also later raise questions like what is the minimum version of clFFT required.

Tasks:

Related issues

Related to GROMACS - Bug #2208: cuFFT linkingNew
Related to GROMACS - Task #2515: clFFT RocM compatibility problemClosed
Related to GROMACS - Task #2697: improve FFT library flavor/version reportingNew

Associated revisions

Revision a41344a0 (diff)
Added by Aleksei Iupinov about 1 year ago

Added the bundled clFFT into OpenCL builds

Used an object library, since we have no need of a real library, to
have or to install, whether shared or static. Checked for the
availability of dynamic loading, and made it available portably to
libgromacs.

Clfft initialization class is added and used in mdrunner to
initialize/tear down clFFT library resources in a thread-safe
manner, and only on ranks that require such setup. Noted TODOs
for future work.

Noted a useful style for explicit listing of source files.

Refs #2500
Refs #2515
Refs #2535

Change-Id: I62d7d66f65e147bde17929ccc30abad36e2373c6

Revision 0f193a44 (diff)
Added by Aleksei Iupinov about 1 year ago

Prefer linking to system clFFT rather than bundled one

Wrote a new find_package module that works in more modern
ways. Updated install guide.

Currently there is no support for checking the clFFT version, which is
unlikely to matter until they make the 2.14 release.

Fixes #2500

Change-Id: If43ee95d3066823f2c57a49a23fd6dd027dbcc94

Revision 887b2c2b (diff)
Added by Mark Abraham 12 months ago

Test both internal and external clFFT build in Jenkins

Chose to test external linking of clFFT in pre-submit because that
compiles several minutes faster. Chose to test internal linking in
post-submit because rapid throughput is less important there.

The clfft label is used to understand that external linking of clFFT
is required for this configuration, much like the fftw, fftpack and
mkl labels, however there is no need to explicitly tie the clfft label
to the gpu or opencl ones.

Refs #2500

Change-Id: I455f7f7713310153f2fdbf5197bb32660332649c

Revision 8459e202 (diff)
Added by Mark Abraham 5 months ago

Improve portability of PME on GPU code

Refs #2500

Change-Id: Id1069b0ad60a9af18b4882ec56364b073c871ebe

Revision 89c9d32f (diff)
Added by Mark Abraham 5 months ago

Improve nvcc error reporting

When nvcc fails, tell the user about both standard error and standard
output. The former code was broken if _cuda_test_err would be
undefined, and reported by a user (see the link at Redmine #2500).

Change-Id: Id16d2ff1bd1033cd23e82687b79409ea8d841131

Revision 98165006 (diff)
Added by Mark Abraham 5 months ago

Disabled internal clFFT when using MSVC with OpenCL

We require clFFT for OpenCL support, and MSVC 2017. But clFFT only
supports MSVC 2010, and a user has reported that that clFFT does not
compile. As we have not provided for clFFT support to be disabled at
configure time (nor taught mdrun that it might not be able to run PME
on an OpenCL GPU in this case), it is simplest to withdraw support for
this corner case until clFFT support for modern MSVC is available.

Fixes #2500

Change-Id: I736501234cfd51bc1cee5d8a71cb1fb343ddd100

History

#1 Updated by Aleksei Iupinov about 1 year ago

  • Description updated (diff)

#2 Updated by Aleksei Iupinov about 1 year ago

  • Private changed from Yes to No

#3 Updated by Aleksei Iupinov about 1 year ago

#4 Updated by Szilárd Páll about 1 year ago

This isn't really about dynamic linking, but more about external clFFT (whether linked statically or dynamically), right?

#5 Updated by Szilárd Páll about 1 year ago

  • Subject changed from clFFT dynamic linking to detect and allow linking external clFFT
  • Description updated (diff)

Updated title to better reflect the scope.

#6 Updated by Szilárd Páll about 1 year ago

  • Target version changed from future to 2019
  • Difficulty simple added
  • Difficulty deleted (uncategorized)

Given that no opt-out bundling may be a showstopper for distros, I'll target this for 2019.

We should also evaluate what are the needs on the Intel side when the PME port lands and gets tested.

#7 Updated by Aleksei Iupinov about 1 year ago

  • Description updated (diff)

Yes, that is correct, thanks

#8 Updated by Aleksei Iupinov about 1 year ago

  • Related to Task #2515: clFFT RocM compatibility problem added

#9 Updated by Gerrit Code Review Bot about 1 year ago

Gerrit received a related patchset '9' for Issue #2500.
Uploader: Aleksei Iupinov ()
Change-Id: gromacs~master~I62d7d66f65e147bde17929ccc30abad36e2373c6
Gerrit URL: https://gerrit.gromacs.org/7837

#10 Updated by Mark Abraham about 1 year ago

The current icc-18 opencl config takes 4.5 minutes per verify to compile the bundled clFFT, so being able to use an external library would be a useful improvement in throughput times. I am not sure what the best approach should be to do that.

#11 Updated by Aleksei Iupinov about 1 year ago

Wow, OK.

Once linking to system clFFT as a default is implemented, provide system clFFT in presubmit and none in post-submit? No explicit changes in releng required then, even (explicitness might be better, of course). It's the libclfft-dev package with dependencies in Ubuntu 16.04, likely non-default one.

#13 Updated by Gerrit Code Review Bot about 1 year ago

Gerrit received a related patchset '1' for Issue #2500.
Uploader: Aleksei Iupinov ()
Change-Id: gromacs~master~If43ee95d3066823f2c57a49a23fd6dd027dbcc94
Gerrit URL: https://gerrit.gromacs.org/7939

#14 Updated by Mark Abraham about 1 year ago

clfft from AMD has a hard dependency on dynamic loading, which I have now incorporated into the build of the bundled clfft.

#15 Updated by Gerrit Code Review Bot about 1 year ago

Gerrit received a related patchset '1' for Issue #2500.
Uploader: Mark Abraham ()
Change-Id: gromacs~master~I455f7f7713310153f2fdbf5197bb32660332649c
Gerrit URL: https://gerrit.gromacs.org/7959

#16 Updated by Roland Schulz about 1 year ago

But the dynamic loading dependency is only for timing not for functionality, right?

#17 Updated by Aleksei Iupinov about 1 year ago

Supposedly yes. I failed to find proper documentation on what this statTimer library does.

#18 Updated by Mark Abraham about 1 year ago

This call must succeed: https://github.com/clMathLibraries/clFFT/blob/master/src/library/lifetime.cpp#L51 and its implementation requires that dlopen() can be called.

#19 Updated by Aleksei Iupinov about 1 year ago

  • Status changed from New to Resolved

#20 Updated by Szilárd Páll 11 months ago

  • Status changed from Resolved to Blocked, need info

implement clFFT version reporting in the -version header

AFAICT, the above is not implemented yet. Could move it to a separate task as we likely want a more unified GPU FFT version reporting.

#21 Updated by Szilárd Páll 8 months ago

  • Related to Task #2697: improve FFT library flavor/version reporting added

#22 Updated by Szilárd Páll 8 months ago

  • Status changed from Blocked, need info to Resolved

Szilárd Páll wrote:

implement clFFT version reporting in the -version header

AFAICT, the above is not implemented yet. Could move it to a separate task as we likely want a more unified GPU FFT version reporting.

Created a more general issue related to FFT library version reporting. AFAICT we can close this.

#23 Updated by Mark Abraham 8 months ago

  • Status changed from Resolved to Closed

#24 Updated by Mark Abraham 5 months ago

  • Subject changed from detect and allow linking external clFFT to detect and allow linking external clFFT, or no clFFT
  • Status changed from Closed to Accepted
  • Assignee set to Mark Abraham
  • Target version changed from 2019 to 2019.1

If our internal clfft doesn't build on a platform, and there's none found on the system, then that blocks the OpenCL build. Users should be able to get OpenCL support for NB even if there is no way to build clfft.

This does stop a Windows build supporting OpenCL, but the principle is more important than the fact of such a Windows version not working.

#26 Updated by Gerrit Code Review Bot 5 months ago

Gerrit received a related patchset '1' for Issue #2500.
Uploader: Mark Abraham ()
Change-Id: gromacs~release-2019~Id1069b0ad60a9af18b4882ec56364b073c871ebe
Gerrit URL: https://gerrit.gromacs.org/8948

#27 Updated by Gerrit Code Review Bot 5 months ago

Gerrit received a related patchset '1' for Issue #2500.
Uploader: Mark Abraham ()
Change-Id: gromacs~release-2019~Id16d2ff1bd1033cd23e82687b79409ea8d841131
Gerrit URL: https://gerrit.gromacs.org/8949

#28 Updated by Gerrit Code Review Bot 5 months ago

Gerrit received a related patchset '1' for Issue #2500.
Uploader: Mark Abraham ()
Change-Id: gromacs~release-2019~I736501234cfd51bc1cee5d8a71cb1fb343ddd100
Gerrit URL: https://gerrit.gromacs.org/8952

#29 Updated by Mark Abraham 5 months ago

  • Status changed from Accepted to Fix uploaded

#30 Updated by Mark Abraham 5 months ago

  • Status changed from Fix uploaded to Resolved

#31 Updated by Mark Abraham 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF