Skip to content

Enable LibRI GPU exact exchange in LR-TDDFT workspaces - #8526

Open
maki49 wants to merge 1 commit into
deepmodeling:developfrom
maki49:lr-exx-gpu-workspace
Open

maki49 wants to merge 1 commit into
deepmodeling:developfrom
maki49:lr-exx-gpu-workspace

Conversation

@maki49

@maki49 maki49 commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

What's changed?

Apply the existing device_exx setting to the LibRI exchange workspace for both ks-lr and standalone lr. The workspace selects its backend before sharing the Kohn-Sham geometry tensors or building its own geometry tensors. This covers Casida exchange and the exact-exchange contractions in excited-state gradients.

Reuse the default CUDA memory pool policy from #8519. Standalone LR can enable retention before its first exchange contraction. At solver exit, the LR workspace restores the release threshold and requests a trim when it owns the policy.

Linked PRs

Extends the GPU EXX integration from #8169 and uses the CUDA pool lifecycle from #8519.

Core module impact

ESolver passes the existing INPUT setting to the LR workspace. The LibRI workspace owns backend selection and retains independent electronic buffers. Updated the device_exx help and installation guide for LR support. The GPU build uses the released LibRI v0.3.0.0 and CUDA DDLA v0.0.7 interfaces.

Unit Tests and/or Case Tests for my changes

  • Built abacus_std_gpu with cmake --build build --target abacus_std_gpu --parallel 24. The LibRI GPU API compile/link probe passed with LibRI v0.3.0.0 and CUDA DDLA v0.0.7. abacus_std_gpu --version reported v3.11.0-beta14 for the build of f0ecbd65f.
  • On Fisherd-Server, ran a Gamma-only H₂/HSE single point on one RTX 3090 with CUDA 12.4, one MPI rank, OMP_NUM_THREADS=1, and num_stream 1. The input passed abacus_std_gpu --check-input. Both ks-lr and standalone lr completed the excitation solve and printed the excited-state force with device gpu, device_exx gpu, and cal_force 1.
  • Reused the same saved KS orbitals and charge density for standalone GPU and CPU EXX runs. The excitation energy was 1.7571530682165615 Ry in both runs, and all six signed force components matched at the output precision. A temporary runtime probe recorded successful GPU DDLA initialization, release-threshold changes from 0 to UINT64_MAX and back, and a successful pool trim in standalone LR.
  • ctest --test-dir build -R '^MODULE_RI_exx_workspace$' --output-on-failure passed, using the system C++ runtime with the site GTest installation. git diff --check origin/develop...HEAD and python3 tools/03_code_analysis/agent_governance_check.py --base origin/develop --head HEAD --format text passed.

Select the LibRI backend from device_exx for both shared and owned LR
workspaces using the LibRI v0.3.0.0 API. An LR workspace can start the
CUDA pool policy from deepmodeling#8519 on its own and release it at solver exit.

(cherry picked from commit 122d145f5aec50b479df08396ee28381c09220fb)
Copilot AI balanced review requested due to automatic review settings December 5, 2026 11:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@mohanchen mohanchen added EXX/lr-TDDFT/RPA/BSE/GW Related to beyond DFT methods GPU & DCU & HPC GPU and DCU and HPC related any issues labels Dec 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EXX/lr-TDDFT/RPA/BSE/GW Related to beyond DFT methods GPU & DCU & HPC GPU and DCU and HPC related any issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants