Repository navigation
perf(lcao): batch full RI radial tables on CPU - #8279
Merged
mohanchen merged 1 commit intoNov 5, 2026
Merged
Conversation
Route full two- and three-center radial table construction through the existing batched builders. The use_gpu argument selects CPU BLAS or CUDA, and three-center tables share product-orbital preparation.
Stardust0831
marked this pull request as ready for review
November 3, 2026 14:54
ABACUS-PR-BOT
left a comment
Collaborator
There was a problem hiding this comment.
Static review found one non-blocking input-domain limitation below. No builds or runtime checks were run.
AsTonyshment
approved these changes
Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #8257. That PR enabled batched radial-table construction on GPU; CPU execution still initializes full tables one orbital pair at a time. This change routes the CPU callers through the existing batched builder, enabling BLAS-based quadrature and shared product-orbital preparation.
What's changed?
Matrix_Orbs11::init_radial_tableandMatrix_Orbs21::init_radial_tablecollect their orbitals and pass the existinguse_gpuargument to the batch overload. CPU execution uses the existing double-precision BLAS implementation; GPU execution keeps the existing CUDA path. The quadrature rule and accuracy settings are unchanged.The diff contains two source files: 4 insertions and 24 deletions.
Performance
Measurements on SAI used an AMD Ryzen Threadripper PRO 5995WX, one MPI rank bound to four physical CPU cores, four OpenMP threads, and one V100 for GPU runs. Current comparisons used exclusive nodes and two runs in reversed order. OpenBLAS 0.3.32 uses OpenMP and reports four configured threads;
OPENBLAS_NUM_THREADS=1does not select serial BLAS for this build.OMP_THREAD_LIMIT=4and CPU affinity bounded execution to four cores.The displaced Si32 (32 atoms) and CsPbI3 (5 atoms) cases are the same as those used for the earlier GPU radial-table benchmarks: STRU, KPT, pseudopotential and orbital hashes match. GPU INPUT files differ only in data-directory paths. CPU runs select
device cpuandks_solver scalapack_gvx; GPU runs selectdevice gpuandks_solver cusolver. LibRI contractions run on CPU, without DDLA.All times are seconds. Initialization is
Exx_LRI.init; full-run time includes process launch, HSE SCF, forces and stress. Values are means of two runs unless marked otherwise.d20090cc137f), GPU mode with CPU radial tablesf5315651166e), GPU modef5315651166e), CPU modeb28ed06649cc), CPU modeThe controlled CPU comparison gives 3.49x / 12.26x faster initialization and 1.019x / 4.219x full-run speedups for Si32 / CsPbI3. GPU full-run control timings differ by less than 1%. Sampled peak host RSS decreases from 4.605 to 4.464 GiB for Si32 and from 14.040 to 6.557 GiB for CsPbI3 (maximum of two runs, sampled approximately every 0.5 seconds).
The historical rows ran on shared nodes. Current develop also includes the Libxc scheduling change and integral reuse, so comparisons across historical and current rows include other code and allocation differences. These two cases do not establish system-size or multi-node scaling. Historical inputs and results are available in the benchmark record.
Unit Tests and/or Case Tests for my changes
CPU-only and CUDA Release builds passed with LibRI and Libxc enabled. Build-directory paths below are abbreviated. Each CTest command passed with both
OMP_NUM_THREADS=1andOMP_NUM_THREADS=4, without skips.Existing tests cover scalar/batched overlap and gradients, tiling, selective initialization, shared ownership lifetime and finite-difference gradients. They are reused because this change connects the already-tested batch implementation at its callers.
All 20 final HSE calculations converged, with matching SCF/EXX iteration counts. Controls include CPU execution in a CUDA build and two MPI ranks with a regular 2x1x1 k-point mesh and complex tensors. Maximum candidate-versus-baseline differences were 7.640e-12 eV/atom in energy, 2.100e-9 eV/Angstrom in force components, and 1.020e-8 kbar in stress components. Source and executable hashes were audited against the tested revisions. Both versions used identical timer JSON instrumentation in benchmark builds.
git diff f5315651166ea265ba673996e3c9efeb5e4cd9b0...HEAD --checkpassed. The full repository test suite was not run; validation focused on RI initialization and complete HSE calculations.Linked Issue
Follow-up to GPU radial-table batching. No separate issue is needed for enabling the existing CPU implementation at the same callers.
Governance Notes
source_lcao/module_ri; the existinguse_gpuargument selects the backend.Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.