-
Notifications
You must be signed in to change notification settings - Fork 48
Reduce local memory usage in int3c2e CUDA kernels #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 41 out of 45 changed files in this pull request and generated 1 comment.
Files not reviewed (4)
- gpu4pyscf/lib/gint/CMakeLists.txt: Language not supported
- gpu4pyscf/lib/gint/bpcache.cu: Language not supported
- gpu4pyscf/lib/gint/g2e.cu: Language not supported
- gpu4pyscf/lib/gint/g2e.h: Language not supported
Comments suppressed due to low confidence (1)
gpu4pyscf/df/grad/uhf.py:174
- [nitpick] The new variable names 'ej' and 'ek' are not self-explanatory. Consider using more descriptive names (e.g., 'grad_j' and 'grad_k') to clearly indicate their purpose.
ej = -ej
examples/00-h2o.py
Outdated
| exit() | ||
|
|
Copilot
AI
Apr 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of 'exit()' here forces an early termination of the example, which may be unintended. Consider removing it to allow the script to complete its execution.
| exit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 39 out of 44 changed files in this pull request and generated no comments.
Files not reviewed (5)
- gpu4pyscf/lib/gint/CMakeLists.txt: Language not supported
- gpu4pyscf/lib/gint/bpcache.cu: Language not supported
- gpu4pyscf/lib/gint/g2e.cu: Language not supported
- gpu4pyscf/lib/gint/g2e.h: Language not supported
- gpu4pyscf/lib/gint/g3c2e.cu: Language not supported
Comments suppressed due to low confidence (2)
gpu4pyscf/df/int3c2e.py:446
- [nitpick] The variable naming has been updated from 'vj' to 'ej' (and similarly for 'vk' to 'ek'). Please update the associated inline comments to reflect this change for clarity.
ej = cupy.zeros([natm,3], order='C')
gpu4pyscf/df/grad/uhf.py:174
- [nitpick] The inline comment about variables remaining in Cartesian coordinates appears to reference the old 'vj/vk' names. Consider updating or removing the comment to avoid confusion given the new 'ej/ek' naming.
ej = -ej
|
Please check the size of the output binary file. If the int3c2e code leads to a very big sized wheel, adjust the unrolling level. |
The issue (see #75)
Current int3c2e kernels allocate a large amount of local memory, which may lead to out of memory when cupy memory pool occupies 90% of global memory. This PR tries to resolve this issue.
TODOs
Additionally
In DF/grad/JK kernels, the intermediates (3,nao) are eliminated. The derivatives w.r.t atomic positions are directly calculated in CUDA kernels.