@@ -1796,7 +1796,9 @@ def _test_untrained_hessian(checkpoint_path, device):
17961796 # Get predictions
17971797 preds = predictor .predict (batch )
17981798
1799- assert any (parameter .requires_grad for parameter in predictor .model .parameters ())
1799+ assert all (
1800+ not parameter .requires_grad for parameter in predictor .model .parameters ()
1801+ )
18001802
18011803 # Verify energy, forces, and hessian are present
18021804 assert "energy" in preds , "Energy prediction missing"
@@ -1819,22 +1821,25 @@ def _test_untrained_hessian(checkpoint_path, device):
18191821
18201822
18211823@pytest .mark .gpu ()
1822- def test_fast_gpu_frozen_parameters_preserve_input_derivatives (
1823- conserving_mole_checkpoint , monkeypatch
1824+ @pytest .mark .parametrize ("execution_mode" , ["general" , "umas_fast_gpu" ])
1825+ def test_frozen_parameters_preserve_input_derivatives (
1826+ conserving_mole_checkpoint , monkeypatch , execution_mode
18241827):
18251828 _test_frozen_parameters_preserve_input_derivatives (
1826- conserving_mole_checkpoint [0 ], monkeypatch
1829+ conserving_mole_checkpoint [0 ], monkeypatch , execution_mode
18271830 )
18281831
18291832
1830- def _test_frozen_parameters_preserve_input_derivatives (checkpoint_path , monkeypatch ):
1833+ def _test_frozen_parameters_preserve_input_derivatives (
1834+ checkpoint_path , monkeypatch , execution_mode
1835+ ):
18311836 settings = InferenceSettings (
18321837 predict_untrained_forces = {"omol" },
18331838 predict_untrained_stress = {"omol" },
18341839 predict_untrained_hessian = {"omol" },
18351840 activation_checkpointing = False ,
18361841 merge_mole = True ,
1837- execution_mode = "umas_fast_gpu" ,
1842+ execution_mode = execution_mode ,
18381843 hessian_vmap = False ,
18391844 )
18401845
0 commit comments