Bug in CUDA exx ek screening
I experimented with GauXC to compute semi-numerical exchange using NVIDIA GPUs and found that, for large systems and large batch sizes, the computed exchange matrix is incorrect. Results obtained with the host integrator were correct. Interestingly, the CUDA results were also correct when using extremely tight screening thresholds, which suggests that something may be wrong with the Exx screening on CUDA.
Tracing the issue indicates that the problem lies in how batches of batches are generated in the exx_ek_screening function.
https://github.com/wavefunction91/GauXC/blob/fe45b3b795c586cf6c733b3eec8fe3c9392deca6/src/xc_integrator/integrator_util/exx_screening.cxx#L256-L304
This function contains a nested loop over batches that is structured in such a way that, if the number of batches in a task is smaller than task_batch_size (which is hardcoded to 10000), some internal data buffers (bfn_max_device) will be overwritten in the next iteration of the inner loop. This can occur when there are many large batches and the GPU memory cannot fit a task of 10000 batches.
After removing the double loop structure and using the same batching strategy as in other functions, the results became correct.
0 条评论