Repository navigation
feat(xc): offload Libxc grid potentials to CUDA - #8364
Stardust0831 wants to merge 5 commits into
Conversation
23464e9 to
3332ebf
Compare
| if(USE_CUDA AND ENABLE_LIBXC AND Libxc_ENABLE_CUDA AND | ||
| Libxc_VERSION VERSION_GREATER_EQUAL "7.1.0") |
There was a problem hiding this comment.
Maybe, export an cmake dependent option ENABLE_LIBXC_CUDA, and then
if(ENABLE_LIBXC_CUDA AND Libxc_VERSION VERSION_LESS "7.1.0")
message(
FATAL_ERROR
"Enabling LibXC with CUDA support requires LibXC >= 7.1.0; found version ${Libxc_VERSION}"
)
endif()Then the if condition here in source/CMakeLists.txt can be simply if(ENABLE_LIBXC_CUDA)
|
@susilehtola Sorry to bother you here, but would you like to have a look? |
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
Static source review at 3332ebfd; no build or runtime tests were run.
| } | ||
| for (int j = 0; j < nsigma; ++j) | ||
| { | ||
| sigma[i * nsigma + j] = density * density * (j == 1 ? 0.1 : 0.3); |
There was a problem hiding this comment.
Non-blocking: the ordinary-density samples keep sigma/rho^2 fixed, while the tiny-gradient samples also fall below the density cutoff, so this grid misses the finite-density, small-gradient HSE case described in install.md. Add zero/tiny sigma at ordinary density and record a version-specific expectation for the known Libxc limitation.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
Related to deepmodeling/abacus-develop#3344: Support the GPU version of libxc.
Unit Tests and/or Case Tests for my changes
--check-input.Si32 HSE06, official Libxc 7.1.2. Both Libxc modes used the same executable, one Tesla V100, one MPI rank and four physical CPU cores. cuSOLVER used the GPU and exact exchange used the CPU throughout. Times are medians of three runs per mode.
Download the Si32 case · Per-run timings
What's changed?
ABACUS can evaluate Libxc LDA/GGA potentials on CUDA, including the semilocal part of HSE. It uses Libxc's public host/device API, available in official releases since 7.1.0. CPU evaluation is the default. With CUDA-enabled ABACUS and Libxc, enable GPU evaluation with these INPUT settings. Libxc 7.1.2
Governance Notes
device_xcacceptscpuorgpu. Its registration provides CLI help and the generated parameter reference. The installation guide describes the CUDA build requirements.xc.hfor the Libxc types and flags it uses.