Skip to content

Reuse GenBonded parameter lookups - #500

Open
kierandidi wants to merge 1 commit into
uw-ipd:masterfrom
kierandidi:experiment/genbonded-lookup-cache
Open

Reuse GenBonded parameter lookups#500
kierandidi wants to merge 1 commit into
uw-ipd:masterfrom
kierandidi:experiment/genbonded-lookup-cache

Conversation

@kierandidi

@kierandidi kierandidi commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • reuse immutable GenBonded torsion and improper database lookup results across residue types
  • cache both matching entries and misses for the lifetime of one energy term
  • preserve lookup ordering, offset calculation, output assembly, and all device paths

The default 142 residue types issue 7,574 torsion queries with only 359 unique keys and 562 improper queries with only 47 unique keys. The two small per-term dictionaries remove those repeated hierarchy and permutation searches without global state, device branches, or changes to score-term controls.

Performance

Exact post-#499, alternating three-process medians:

  • one-thread CPU block annotation: 28.05 ms to 18.49 ms (1.517x)
  • one-thread CPU complete GenBonded setup: 42.52 ms to 32.53 ms (1.307x)
  • H200 block annotation: 30.23 ms to 18.98 ms (1.593x)
  • H200 complete GenBonded setup: 47.55 ms to 36.94 ms (1.287x)
  • complete cold one-thread CPU setup: 682.10 ms to 662.39 ms (1.030x)
  • complete cold H200 setup: 747.36 ms to 711.67 ms (1.050x)

H200 peak allocation is unchanged at 41,096,192 bytes.

A follow-up that also cached assembled parameter rows was rejected: it improved CPU complete term setup by only 0.3% and regressed the noisy H200 median. This PR retains the smaller lookup-only cache.

Validation

  • all packed GenBonded parameter SHA-256 digests are identical
  • the focused reuse test passes on CPU- and CUDA-backed fixture variants
  • the complete score-function directory passes 69 tests with 8 device skips
  • Black, Flake8, and diff checks pass

Benchmark drivers, profiles, and outputs remain external to the repository.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.42%. Comparing base (05c1d67) to head (bf357dd).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #500       +/-   ##
===========================================
+ Coverage   74.11%   92.42%   +18.30%     
===========================================
  Files         455      456        +1     
  Lines       40173    40255       +82     
===========================================
+ Hits        29775    37204     +7429     
+ Misses      10398     3051     -7347     
Flag Coverage Δ
cpu 90.97% <100.00%> (?)
cuda 74.11% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant