feat: add enhanced-sampling PR1 - #159
Open
samarjeet wants to merge 10 commits into
Open
Conversation
…riable Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Contributor
Greptile SummaryThe PR introduces the initial enhanced-sampling API, including detached bias results, autograd-derived forces and virials, pair-distance collective variables, and result aggregation.
Important Files Changed
Reviews (1): Last reviewed commit: "fixing non-periodic case" | Re-trigger Greptile |
Comment on lines
+519
to
+522
| if r.stress is not None: | ||
| stress_total = r.stress if stress_total is None else stress_total + r.stress | ||
| if r.virial is not None: | ||
| virial_total = r.virial if virial_total is None else virial_total + r.virial |
Contributor
Comment on lines
+514
to
+536
| for r in results: | ||
| if r.energy is not None: | ||
| energy_total = r.energy if energy_total is None else energy_total + r.energy | ||
| if r.forces is not None: | ||
| forces_total = r.forces if forces_total is None else forces_total + r.forces | ||
| if r.stress is not None: | ||
| stress_total = r.stress if stress_total is None else stress_total + r.stress | ||
| if r.virial is not None: | ||
| virial_total = r.virial if virial_total is None else virial_total + r.virial | ||
| for key, val in r.observables.items(): | ||
| if key in observables_total: | ||
| raise ValueError( | ||
| f"aggregate_bias_results: duplicate observable key {key!r}. " | ||
| "Apply 'bias/<name>/<key>' namespacing before aggregation." | ||
| ) | ||
| observables_total[key] = val | ||
|
|
||
| return BiasResult( | ||
| energy=energy_total, | ||
| forces=forces_total, | ||
| stress=stress_total, | ||
| virial=virial_total, | ||
| observables=observables_total, |
Contributor
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ALCHEMI Toolkit Pull Request
Description
Adds the PR1 enhanced-sampling foundation:
BiasPotential, detached and validatedBiasResult,ConservativeBiasautograd support for forces and canonical virials,pair_distanceas the first collective variable, and bias-result aggregation.This PR also records the compile-spike outcome.
pair_distance, aggregation, and biasenergy()functions compile withtorch.compile(fullgraph=True)on CPU and CUDA.ConservativeBias.evaluate()remains the eager orchestration layer becauserequires_grad_()causes a Dynamo graph break;compile_biases=Trueshould compileeach bias
energy()override instead.Scope notes:
pair_distancesupports nonperiodic systems and Minkowski-reduced triclinic MIC.torch.compile.Type of Change
Related Issues
Changes Made
Testing
make pytest)make lint)Checklist
Additional Notes
Tip
This repository uses Greptile, an AI code review service, to help conduct
pull request reviews. We encourage contributors to read and consider suggestions
made by Greptile, but note that human maintainers will provide the necessary
reviews for merging: Greptile's comments are not a qualitative judgement
of your code, nor is it an indication that the PR will be accepted/rejected.
We encourage the use of emoji reactions to Greptile comments, depending on
their usefulness and accuracy.