Commit 39f9958b authored by jnwei's avatar jnwei
Browse files

Change test_compare_model in deepspeed test to use mean instead of max

parent 561333f2
...@@ -274,7 +274,7 @@ class TestDeepSpeedKernel(unittest.TestCase): ...@@ -274,7 +274,7 @@ class TestDeepSpeedKernel(unittest.TestCase):
Run full model with and without using DeepSpeed Evoformer attention kernel Run full model with and without using DeepSpeed Evoformer attention kernel
and compare output coordinates. and compare output coordinates.
""" """
eps = 0.5 eps = 0.2
with open("tests/test_data/sample_feats.pickle", "rb") as fp: with open("tests/test_data/sample_feats.pickle", "rb") as fp:
batch = pickle.load(fp) batch = pickle.load(fp)
...@@ -316,7 +316,7 @@ class TestDeepSpeedKernel(unittest.TestCase): ...@@ -316,7 +316,7 @@ class TestDeepSpeedKernel(unittest.TestCase):
out_repro = out_repro["sm"]["positions"][-1].squeeze(0) out_repro = out_repro["sm"]["positions"][-1].squeeze(0)
out_repro_ds = out_repro_ds["sm"]["positions"][-1].squeeze(0) out_repro_ds = out_repro_ds["sm"]["positions"][-1].squeeze(0)
err = torch.max(torch.abs(out_repro - out_repro_ds)) err = torch.mean(torch.abs(out_repro - out_repro_ds))
self.assertTrue(err < eps, f'Error: {err}') self.assertTrue(err < eps, f'Error: {err}')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment