deepmodeling / deepmd-kit

A deep learning package for many-body potential energy representation and molecular dynamics
https://docs.deepmodeling.com/projects/deepmd/
GNU Lesser General Public License v3.0
1.41k stars 487 forks source link

[BUG] recent occasional UT failure #3833

Closed njzjz closed 1 month ago

njzjz commented 1 month ago
 =========================== short test summary info ============================
FAILED source/tests/pt/model/test_trans.py::TestEnergyModelHybrid::test - AssertionError: Tensor-likes are not close!

Mismatched elements: 1 / 9 (11.1%)
Greatest absolute difference: 1.9291310085836622e-10 at index (0,) (up to 1e-10 allowed)
Greatest relative difference: 5.051167175729902e-08 at index (0,) (up to 1e-10 allowed)
= 1 failed, 719 passed, 901 skipped, 8096 deselected, 124 warnings in 408.48s (0:06:48) =
         for key in test_keys:
            if key in ["energy", "force", "force_mag"]:
                torch.testing.assert_close(ret0[key], ret1[key], rtol=prec, atol=prec)
            elif key == "virial":
                if not hasattr(self, "test_virial") or self.test_virial:
>                   torch.testing.assert_close(
                        ret0[key], ret1[key], rtol=prec, atol=prec
                    )
E                   AssertionError: Tensor-likes are not close!
E                   
E                   Mismatched elements: 1 / 9 (11.1%)
E                   Greatest absolute difference: 1.9291310085836622e-10 at index (0,) (up to 1e-10 allowed)
E                   Greatest relative difference: 5.051167175729902e-08 at index (0,) (up to 1e-10 allowed)

source/tests/pt/model/test_trans.py:73: AssertionError

from https://github.com/deepmodeling/deepmd-kit/actions/runs/9276252769/job/25522908653?pr=3829