Skip to content
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

Merged
merged 2 commits into from
Oct 13, 2023
Merged

Conversation

wxj6000
Copy link
Collaborator

@wxj6000 wxj6000 commented Oct 12, 2023

  • add benchmarks for density fitting and direct SCF
  • support grad/rks
  • improve dft/numint

@wxj6000 wxj6000 requested a review from sunqm October 12, 2023 17:13
@@ -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)
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

@wxj6000 wxj6000 merged commit 96230a5 into pyscf:master Oct 13, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants