proteneer / timemachine

Differentiate all the things!
Other
140 stars 17 forks source link

Speed up slow tests in test_md.py #609

Closed maxentile closed 2 years ago

maxentile commented 2 years ago

From https://github.com/proteneer/timemachine/pull/607#issue-1123513657

319.21s call     tests/test_md.py::test_reference_langevin_integrator_with_custom_ops
120.34s call     tests/test_md.py::test_reference_langevin_integrator

~7 minutes in these two tests alone

maxentile commented 2 years ago

Locally these appear much faster:

Propose to:

proteneer commented 2 years ago

sgtm - pr welcome!

maxentile commented 2 years ago

After https://github.com/proteneer/timemachine/pull/610, the timings above ~10 seconds are now:

tests/

============================ slowest 100 durations =============================
207.71s call     tests/test_rabfe.py::TestRABFEModels::test_predict_complex_decouple
181.34s call     tests/test_rabfe.py::TestRABFEModels::test_predict_complex_conversion
117.47s call     tests/test_nonbonded.py::TestNonbonded::test_nonbonded
98.91s call     tests/test_nonbonded.py::TestNonbondedDHFR::test_correctness
84.95s call     tests/test_parameter_interpolation.py::TestInterpolatedPotential::test_nonbonded_advanced
78.59s call     tests/test_jit.py::TestJIT::test_random_directory
48.57s call     tests/test_nonbonded.py::TestNonbondedWater::test_nblist_box_resize
38.24s call     tests/test_parameter_interpolation.py::TestInterpolatedPotential::test_nonbonded
28.45s call     tests/test_nonbonded.py::TestNonbondedDHFR::test_nblist_hilbert
25.86s call     tests/test_nonbonded.py::TestNonbonded::test_nonbonded_with_box_smaller_than_cutoff
22.89s call     tests/test_jax_nonbonded.py::test_jax_nonbonded_easy
21.57s call     tests/test_estimator.py::test_free_energy_estimator_with_endpoint_correction
20.01s call     tests/test_parallel.py::TestGRPCClient::test_unavailable_host
19.62s call     tests/test_jax_nonbonded.py::test_jax_nonbonded
18.23s call     tests/test_nonbonded.py::TestNonbondedDHFR::test_nblist_rebuild
17.07s call     tests/test_nonbonded.py::TestNonbonded::test_fma_compiler_bug
13.61s call     tests/test_nonbonded.py::TestNonbonded::test_exclusion
10.71s call     tests/test_handlers.py::test_compute_or_load_am1_charges
9.60s call     tests/test_nblist.py::test_neighborlist
...

slow_tests/

============================ slowest 100 durations =============================
99.64s call     slow_tests/test_docking.py::TestDocking::test_rigorous_work
90.38s call     slow_tests/test_mtm.py::test_optimized_MTM
81.96s call     slow_tests/test_free_energy.py::test_relative_free_energy
68.08s call     slow_tests/test_benchmark.py::test_hif2a
62.06s call     slow_tests/test_free_energy.py::test_absolute_free_energy
45.42s call     slow_tests/test_endpoint_correction.py::test_endpoint_correction
43.17s call     slow_tests/test_docking.py::TestDocking::test_relative_docking
41.75s call     slow_tests/test_determinism.py::test_deterministic_energies
35.13s call     slow_tests/test_rbfe.py::TestRBFEModel::test_predict
34.89s call     slow_tests/test_docking.py::TestDocking::test_dock_and_equilibrate
26.37s call     slow_tests/test_minimizer.py::test_minimizer
22.30s call     slow_tests/test_rbfe.py::TestRBFEModel::test_pre_equilibration
18.90s call     slow_tests/test_benchmark.py::test_dhfr
15.31s call     slow_tests/test_free_energy.py::test_construct_differentiable_interface_fast
15.06s call     slow_tests/test_docking.py::TestDocking::test_pose_dock
14.52s call     slow_tests/test_reference_langevin_integrator.py::test_reference_langevin_integrator
11.11s call     slow_tests/test_free_energy.py::test_functional
10.44s call     slow_tests/test_barostat.py::test_barostat_varying_pressure
9.70s call     slow_tests/test_barostat.py::test_barostat_is_deterministic
...