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

Replace min(blksize, MIN_BLKSIZE) by max(blksize, MIN_BLKSIZE) #287

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DerkKooi
Copy link

@DerkKooi DerkKooi commented Dec 17, 2024

numint.py contains the line

blksize = min(blksize, MIN_BLK_SIZE)

Now either min or MIN here should be replaced by max/MAX to make this correct. My suggestion is that it should be blksize = max(blksize, MIN_BLK_SIZE) as right now the behavior is such that that much too small block sizes are selected for small systems. On the other hand, a minimum block size seems like it would run out of memory for larger systems (?).

@DerkKooi
Copy link
Author

CC: @awvwgk @tvogels @jhrmnn

@wxj6000
Copy link
Collaborator

wxj6000 commented Dec 17, 2024

Hi @DerkKooi, thank you for opening the discussion.

When your device has less than 16 GB memory, the default MIN_BLKSIZE is 4096 which is pretty small. We probably can use MIN_BLKSIZE = 16384 for better performance. But the configurations of those devices can be very diverse, MIN_BLKSIZE = 4096 is just for safety.

MIN_BLKSIZE is for the sparsity of AO on grids. Smaller blksize benefits the sparsity of atomic orbitals on grids, therefore improves the performance.
On the other hand, the values of atomic orbitals on grids should fit in the memory. Based on these two constraints, we set blksize = min(blksize, MIN_BLK_SIZE).

Can you provide your device info? And how the block sizes are selected for a small system?

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