Repository navigation
Hotfix (CUDA CI failures): Make plane-wave wavefunction checks phase invariant and align complex cuBLAS scalars - #8372
Conversation
ABACUS-PR-BOT
left a comment
There was a problem hiding this comment.
The phase-invariant construction and paired G/coefficient sorting are consistent with the intended check. Focused collector regressions and reference-generation evidence would strengthen the validation.
Static source review at bc707a5; no build, collector test or CPU/GPU calculation was run, and the regenerated references and GPU band separation were not independently verified.
|
|
The cuBLAS upgrade in the new Docker image exposed a bug in how ABACUS passes complex scalars to I found that previously we ran into the same issue with |
Include the upstream phase-invariant PW wavefunction regression from deepmodeling#8372.
Linked Issue
Fixes #8153.
What's Changed?
1.
scf_out_wffailureAfter #8357 switched the CI Docker image to Ubuntu 24.04,
scf_out_wfstarted failing on GPU. The test compared the largest absolute value among the real and imaginary components of each band's wavefunction. A change in the band's overall phase can change that value even for the same physical state.We now sort the plane-wave coefficients by G vector, check each band's norm, and use the same fingerprint as the cube tests, where the phase cancels in products of projections. We also shift one Si atom slightly so the six bands at Gamma are distinct and can be compared individually.
2.
scf_deltaspin2failureWith the newer cuBLAS in the same image,
scf_deltaspin2crashed incublasZgemmduring the on-site projection. The GEMM wrapper treated a hoststd::complex<double>as acuDoubleComplex, whose 16-byte alignment requirement exceeds the 8-byte alignment of the C++ scalar on x86-64.The cuBLAS (and cuBLASMp) wrappers now construct native CUDA scalars, and complex dot products use an aligned temporary when the device output address needs one. We also fix the single-precision complex matrix transpose, correct transpose and triangle flags in the CUDA wrappers, and preserve 64-bit strides in batched GEMV. Scalar
einsumcontractions now honor conjugation and apply bothalphaandbetawhen updating an existing result.