Fix(PW): avoid GPU crash in Wannier90 output - #7801
Closed
CleverPhysician wants to merge 1 commit into
Closed
Conversation
Collaborator
|
It seems to make things more complicated, we provide FFT interfaces for both CPU and GPU, you don't need to define new ones. Please submit new PRs if you have better solutions. |
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.
Summary
100_PW_W90in the existing 01_PW GPU regression list.Root cause
toWannier90_PW::unkdotkb()operated on valid host-side wave functions, but called the CPU-stylePW_Basis_K::recip2real()interface. In a CUDA build, the basis owns anFFT_CUDAbackend, which implements the device-aware 3D FFT interface but not the CPU auxiliary-buffer interface. The first CPU-style auxiliary-buffer dispatch therefore reached an unresolved weak virtual slot and jumped to address0x0. This occurs only after the NSCF calculation has completed, when Wannier90 starts constructing the MMN matrix.Changes
recip_to_real()andreal_to_recip()interfaces.100_PW_W90GPU case; no new input or reference data is added.Verification
213795on RTX 4090:100_PW_W90: passed all 5 checks.PW_Basis_K::recip2real<double>(), called bytoWannier90_PW::unkdotkb().213879,OMP_NUM_THREADS=1, one MPI rank:100_PW_W90: passed all 5 existing checks.100_PW_W90: passed all 5 existing checks.towannier90=0: exit 0.213880:ERROR SUMMARY: 0 errors.io_advancedcompile target, Slurm job213874: passed.git diff --check: passed.Behavior change
PW-GPU Wannier90 MMN output now uses the FFT interface matching the CUDA backend instead of crashing. The synchronization and two temporary device buffers exist only during post-NSCF Wannier90 MMN output; the SCF/NSCF iteration path is unchanged.
INPUT/documentation impact
None. No INPUT keyword, meaning, default, reference result, or tolerance is changed.
Core-module impact
None. No wave-function, FFT, device-memory, solver, or physics implementation is modified; the fix is confined to the Wannier90 I/O boundary and its call site.
Fixes part of #7770