Skip to content

⚡ Bolt: Optimize conformer benchmark loops#590

Closed
alinelena wants to merge 1 commit into
mainfrom
bolt/optimize-mpconf-loops-11023888217711457893
Closed

⚡ Bolt: Optimize conformer benchmark loops#590
alinelena wants to merge 1 commit into
mainfrom
bolt/optimize-mpconf-loops-11023888217711457893

Conversation

@alinelena
Copy link
Copy Markdown
Collaborator

💡 What:
Replaced df.iterrows() with df.itertuples() for parsing reference energies. In the MPCONF196 and solvMPCONF196 benchmark logic, cached the parsed ase.Atoms structures to avoid repeatedly reading the same structures from disk. Hoisted np.mean calculations out of the main loop. Explicitly cleared atoms.calc on the cached structures right before writing the metadata-annotated versions to disk.

🎯 Why:
The application was performing redundant disk operations by calling get_atoms() (which reads an .xyz file) in consecutive loops over the same set of molecules. Additionally, computing np.mean inside a loop results in redundant $O(N)$ work inside an $O(N)$ loop. df.iterrows() is notoriously slow compared to df.itertuples().

📊 Impact:
Significantly reduces file I/O operations during the conformer benchmarks (reduces reads by exactly half per target) and reduces redundant arithmetic, dropping the calculation logic's runtime.

🔬 Measurement:
Run the conformer calculation pipelines using uv run pytest ml_peg/calcs/conformers/MPCONF196/calc_MPCONF196.py and uv run pytest ml_peg/calcs/conformers/solvMPCONF196/calc_solvMPCONF196.py. The output geometries will be exactly the same as before.


PR created automatically by Jules for task 11023888217711457893 started by @alinelena

…d hoisting means

Replaced slow pandas `iterrows` with `itertuples` during benchmark reference energy parsing. Cached the heavy `get_atoms` operations to avoid redundant file I/O operations and translated calculations, and hoisted $O(N)$ calculations (e.g. `np.mean()`) out of inner loops. Cleared `atoms.calc` before disk write to avoid regenerating stale calculators.

Co-authored-by: alinelena <3306823+alinelena@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@joehart2001 joehart2001 closed this Jun 5, 2026
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