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

Add an option to run PBC in single system mode #795

Merged
merged 5 commits into from
Aug 6, 2024
Merged

Conversation

misko
Copy link
Collaborator

@misko misko commented Aug 5, 2024

There is an issue when running PBC across multiple systems. The current code takes the number of expansions in each direction for the worst case system in each batch. This can result in a very large amount of GPU memory required for expansion 50GB+

This PR adds an option "use_pbc_single" that runs PBC expansion for each system, one at a time.
The runtime is approximately 10% slower for PBC construction, but does not seem significant for the overall runtime.

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.

Files Patch % Lines
src/fairchem/core/models/gemnet_gp/gemnet.py 0.00% 1 Missing ⚠️
Files Coverage Δ
src/fairchem/core/models/base.py 87.96% <100.00%> (+0.96%) ⬆️
src/fairchem/core/models/dimenet_plus_plus.py 97.33% <100.00%> (+0.01%) ⬆️
...airchem/core/models/equiformer_v2/equiformer_v2.py 88.51% <100.00%> (+0.03%) ⬆️
src/fairchem/core/models/escn/escn.py 96.77% <100.00%> (+<0.01%) ⬆️
src/fairchem/core/models/gemnet/gemnet.py 93.95% <100.00%> (+0.02%) ⬆️
src/fairchem/core/models/gemnet_oc/gemnet_oc.py 90.04% <100.00%> (+0.02%) ⬆️
src/fairchem/core/models/painn/painn.py 90.78% <100.00%> (+0.03%) ⬆️
src/fairchem/core/models/schnet.py 98.03% <100.00%> (+0.03%) ⬆️
src/fairchem/core/models/scn/scn.py 93.89% <100.00%> (+0.01%) ⬆️
src/fairchem/core/models/gemnet_gp/gemnet.py 16.93% <0.00%> (-0.10%) ⬇️

kyonofx
kyonofx previously approved these changes Aug 5, 2024
Copy link
Collaborator

@kyonofx kyonofx left a comment

Choose a reason for hiding this comment

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

LGTM!

@misko misko marked this pull request as ready for review August 5, 2024 23:31
@misko misko added this pull request to the merge queue Aug 5, 2024
@misko misko removed this pull request from the merge queue due to a manual request Aug 5, 2024
lbluque
lbluque previously approved these changes Aug 6, 2024
Copy link
Collaborator

@lbluque lbluque left a comment

Choose a reason for hiding this comment

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

lgtm. Question though, how do you use pbc_single? Do I need to specify use_pbc_single: True to the model parameters in the config?

@misko misko dismissed stale reviews from lbluque and kyonofx via 0252178 August 6, 2024 00:11
@misko
Copy link
Collaborator Author

misko commented Aug 6, 2024

lgtm. Question though, how do you use pbc_single? Do I need to specify use_pbc_single: True to the model parameters in the config?

I just pushed those changes! Realized it wasn't connected. The way we connect parameters to generate_graph is a bit interesting!

@misko misko enabled auto-merge August 6, 2024 00:12
@misko misko added this pull request to the merge queue Aug 6, 2024
Merged via the queue into main with commit b2eebb6 Aug 6, 2024
7 checks passed
@misko misko deleted the pbc_single_option branch August 6, 2024 03:00
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.

3 participants