-
Notifications
You must be signed in to change notification settings - Fork 21
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
benchmark, direct scf, and improvement #38
Conversation
wxj6000
commented
Oct 12, 2023
- add benchmarks for density fitting and direct SCF
- support grad/rks
- improve dft/numint
gpu4pyscf/dft/gen_grid.py
Outdated
@@ -447,19 +399,19 @@ def arg_group_grids(mol, coords, box_size=GROUP_BOX_SIZE): | |||
atom_coords.max(axis=0) + GROUP_BOUNDARY_PENALTY] | |||
# how many boxes inside the boundary | |||
boxes = ((boundary[1] - boundary[0]) * (1./box_size)).round().astype(int) | |||
tot_boxes = numpy.prod(boxes + 2) | |||
boxes = cupy.asarray(boxes) |
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.
Consider to use numpy for these temporary arrays. Temporary cupy array can lead to more memory fragmentation
|
||
class Gradients(rhf_grad.Gradients, pyscf.grad.rks.Gradients): | ||
device = 'gpu' | ||
get_veff = patch_cpu_kernel(pyscf.grad.rks.Gradients.get_veff)(_get_veff) |
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.
- from gpu4pyscf.lib.utils import to_cpu, to_gpu, device
- remove patch_cpu_kernel
from pyscf import lib, scf | ||
import gpu4pyscf | ||
|
||
lib.num_threads(8) |
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.
Remove this line
from gpu4pyscf.dft import rks | ||
from pyscf.dft import rks | ||
import gpu4pyscf | ||
from gpu4pyscf.dft import numint | ||
|
||
lib.num_threads(8) |
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.
Remove this line