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

Cleaning up platform and context usage in geometry engine #1091

Merged
merged 2 commits into from
Aug 22, 2022

Conversation

ijpulidos
Copy link
Contributor

@ijpulidos ijpulidos commented Aug 22, 2022

Description

By default the CUDA platform was hardcoded in the geometry engine. Generating contexts that were not handled correctly. This PR is aimed towards making CPU to be the default platform for the geometry engine and cleans explicitly created contexts for a better memory management.

Motivation and context

Resolves #1085

How has this been tested?

Change log

``CUDA`` platform was hardcoded in geometry engine, generating performance issues by not clearing openmm contexts correctly. Fixed by defaulting to using the faster ``CPU`` platform (for the geometry engine) and explicitly deleting context variables after they are used.

@codecov
Copy link

codecov bot commented Aug 22, 2022

Codecov Report

Merging #1091 (9fad690) into main (37da4fb) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@ijpulidos ijpulidos added this to the 0.10.2 Bugfix release milestone Aug 22, 2022
@ijpulidos ijpulidos requested a review from mikemhenry August 22, 2022 19:29
@mikemhenry
Copy link
Contributor

Maybe just a slight change in the change log (to make it clear that we are only setting the platform for the geometry engine:
"CUDA platform was hardcoded in geometry engine, generating performance issues by not clearing openmm contexts correctly. Fixed by defaulting to using the faster CPU platform (for the geometry engine) and explicitly deleting context variables after they are used."

@mikemhenry mikemhenry enabled auto-merge (squash) August 22, 2022 19:43
@mikemhenry
Copy link
Contributor

Not sure why RTD isn't working, builds have been working just fine: https://readthedocs.org/projects/perses/builds/
I will merge this in any way and we can check on RTD later.

@mikemhenry mikemhenry disabled auto-merge August 22, 2022 19:45
@mikemhenry mikemhenry merged commit c96e655 into main Aug 22, 2022
@mikemhenry mikemhenry deleted the 1085-cpu-platform-geometry branch August 22, 2022 19:48
@@ -733,6 +732,9 @@ def _corrected_reduced_potential(self, growth_system_generator, positions, platf
added_energy_components = compute_potential_components(mod_context)
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of changing the DEFAULT_PLATFORM in tests/utils.py, we want to change this line to

added_energy_components = compute_potential_components(mod_context, platform=platform)

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.

CUDA platform hardcoded in geometry engine
3 participants