Skip to content

Consolidate more benchmark code, make ff optimize more robust - #242

Merged
scal444 merged 1 commit into
NVIDIA-BioNeMo:mainfrom
scal444:fix_ff_optimize_bench
Jul 31, 2026
Merged

Consolidate more benchmark code, make ff optimize more robust#242
scal444 merged 1 commit into
NVIDIA-BioNeMo:mainfrom
scal444:fix_ff_optimize_bench

Conversation

@scal444

@scal444 scal444 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Consolidated CPU count with fallback for older python (< 3.13).

Added pre-run checks for MMFF/UFF forcefield compatibility so we don't choke on inputs with a few bad molecules.

@scal444
scal444 requested a review from evasnow1992 July 31, 2026 14:32
@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Consolidates benchmark CPU availability detection and makes force-field optimization more resilient.

  • Adds a cross-version, affinity-aware CPU-count helper and adopts it across benchmark scripts.
  • Adds optional buffered molecule loading to compensate for preparation and force-field filtering losses.
  • Filters molecules lacking MMFF or UFF parameters before conformer generation and optimization.
  • Separates conformer-generation process count from RDKit optimizer thread count.
  • Adds focused tests for candidate buffering and Python 3.12 CPU-count fallback behavior.

Confidence Score: 4/5

The PR is safe to merge, with a non-blocking concern about excessive conformer-generation workers on high-core-count machines.

Loader and force-field behavior remain compatible, while the new force-field benchmark default starts one conformer process per available CPU and can impose avoidable resource overhead.

Files Needing Attention: benchmarks/ff_optimize_bench.py

Important Files Changed

Filename Overview
benchmarks/bench_utils/loaders.py Adds an opt-in 10% candidate reserve while preserving existing loader bounds and sampling behavior by default.
benchmarks/bench_utils/molprep.py Adds a safe Linux-compatible CPU availability helper with fallbacks across supported Python versions.
benchmarks/ff_optimize_bench.py Buffers and filters force-field inputs and adds a dedicated conformer process setting, but its automatic default uses every available CPU rather than the repository's half-CPU convention.
benchmarks/tests/test_loaders.py Covers minimum buffer sizing, buffered SMILES loading, and the pre-Python-3.14 CPU-count fallback.
benchmarks/conformer_rmsd_bench.py Replaces the multiprocessing CPU count with the shared affinity-aware helper.
benchmarks/tfd_bench.py Uses the shared CPU-count helper while retaining the existing half-CPU worker default.
benchmarks/tfd_prepare_mols.py Consolidates default worker calculation through the shared CPU-count helper.

Reviews (1): Last reviewed commit: "Consolidate more benchmark code, make ff..." | Re-trigger Greptile

Comment thread benchmarks/ff_optimize_bench.py

@evasnow1992 evasnow1992 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the consolidation. Changes are clean.

@scal444
scal444 merged commit 797bdb8 into NVIDIA-BioNeMo:main Jul 31, 2026
10 checks passed
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