Skip to content

Conversation

@jthorton
Copy link
Collaborator

@jthorton jthorton commented Sep 22, 2025

This PR adds partial support for adaptive settings (#974) based on the transformation for the hybrid topology RBFE protocol. This is used to expose the fast settings for net neutral transformations. For these transformations the following settings will be updated:

nonbonded_cutoff = 0.9 nm
time_per_iteration = 2.5 ps
box_shape = "dodecahedron"
solvent_padding = 1 nm (complex) 1.5 nm (solvent)

Questions:

  • Are we happy with the CLI flag being adaptive settings?
  • Do we need to add more warnings about using fast settings?
  • Are we happy with how this is exposed at the API level do we need more guardrails?

I plan on adding tests once we are happy with the proposal.

Checklist

  • Added a news entry

Developers certificate of origin

@jthorton jthorton marked this pull request as draft September 22, 2025 10:37
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Couple of quick thoughts - I'm not really into the flag (i.e. it doesn't feel like it adds anything useful), but it's not a strongly held view.

f"{mapping.componentA.name} and {mapping.componentB.name}. "
"A more expensive protocol with 22 lambda windows, sampled "
"for 20 ns each, will be used here.")
warnings.warn(wmsg)
Copy link
Member

Choose a reason for hiding this comment

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

Thoughts on warning here but not warning on the default behaviour (below)? I.e. should this be just at INFO level since we expect it to be adaptive?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was to maintain the current CLI experience, where this warning is displayed for charge change edges. However, more generally, perhaps an INFO-level log would be better for each edge, indicating if the settings are adapted from the defaults.


else:
# apply the fast settings we have benchmarked
protocol_settings.forcefield_settings.nonbonded_cutoff = 0.9 * unit.nanometer
Copy link
Member

Choose a reason for hiding this comment

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

Probably aim to only merge this PR after fast settings have been validated for net charge transformations - it would be good if we could avoid having to set any of these (or maybe we can set the default to the solvent case).

@jthorton jthorton self-assigned this Sep 22, 2025
@hannahbaumann hannahbaumann self-assigned this Oct 7, 2025
Copy link
Contributor

@hannahbaumann hannahbaumann left a comment

Choose a reason for hiding this comment

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

Thanks @jthorton this looks great! I agree with Irfan that this could also just be the new default without a flag, unless it would be too confusing for our users.

Other than that we'll probably just have to wait to see if we can switch charge changes to fast settings as well and tests.

@jameseastwood jameseastwood added this to the v1.7.0 milestone Oct 7, 2025
@jthorton jthorton marked this pull request as ready for review October 17, 2025 12:51
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Couple of things - we should just update the main settings objects so the changes are reflected everywhere.

equilibration_length=1.0 * unit.nanosecond,
production_length=5.0 * unit.nanosecond,
# fast settings
time_per_iteration=2.5 * unit.picosecond
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this in the underlying settings file? That way it propagates to all the other Protocols: https://github.com/OpenFreeEnergy/openfe/blob/main/openfe/protocols/openmm_utils/omm_settings.py#L553

solvation_settings=OpenMMSolvationSettings(),
solvation_settings=OpenMMSolvationSettings(
# fast settings
box_shape="dodecahedron",
Copy link
Member

Choose a reason for hiding this comment

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

Same thing here, can you update this in the original settings object? that way we can update septop/abfes at the same time automatically

forcefield_settings=settings.OpenMMSystemGeneratorFFSettings(),
forcefield_settings=settings.OpenMMSystemGeneratorFFSettings(
# fast settings
nonbonded_cutoff=0.9 * unit.nanometer
Copy link
Member

Choose a reason for hiding this comment

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

Should we update this in gufe? @atravitz thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That would be great as it is the recommended cutoff for openff so we probably should use that everywhere.

Copy link
Member

Choose a reason for hiding this comment

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

updated in gufe

# fast settings
box_shape="dodecahedron",
# make the default padding work for all cases
solvent_padding=1.5 * unit.nanometer
Copy link
Member

Choose a reason for hiding this comment

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

I've raised #1589 for us to update settings in SepTop & AFEs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has broken some of the SetTop tests, is it best to update the solvent padding for SepTop here as well?

Copy link
Member

Choose a reason for hiding this comment

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

Sure!

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

lgtm (putting aside needed changes in gufe)

@atravitz
Copy link
Contributor

just a reminder to check that any changes are included on the CLI side, where applicable. #1591

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 98.36066% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.38%. Comparing base (3ebf7e3) to head (d3c4688).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ork_planner/relative_alchemical_network_planner.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1523      +/-   ##
==========================================
- Coverage   95.45%   93.38%   -2.08%     
==========================================
  Files         174      174              
  Lines       14553    14564      +11     
==========================================
- Hits        13892    13600     -292     
- Misses        661      964     +303     
Flag Coverage Δ
fast-tests 93.38% <98.36%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

jthorton and others added 3 commits October 20, 2025 14:30
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
# Conflicts:
#	openfe/tests/protocols/openmm_ahfe/test_ahfe_protocol.py
#	openfe/tests/protocols/openmm_rfe/test_hybrid_top_protocol.py
Copy link
Contributor

@atravitz atravitz left a comment

Choose a reason for hiding this comment

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

just an opinion on the news entry

atravitz and others added 3 commits October 20, 2025 11:29
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
@github-actions
Copy link

No API break detected ✅

@atravitz atravitz merged commit 774c42e into main Oct 20, 2025
10 of 12 checks passed
@atravitz atravitz deleted the fast_settings branch October 20, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants