Skip to content

Commit

Permalink
adjust precision.
Browse files Browse the repository at this point in the history
  • Loading branch information
limin2021 committed Nov 9, 2021
1 parent 6628a3c commit dd063b0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/paddle/fluid/tests/unittests/test_fused_attention_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ def test_fused_attention_op(self):
final_out_ref, x_grad_ref = self.GetBaselineOut()
final_out, x_grad = self.GetFusedAttentionOut()
np.testing.assert_allclose(
final_out_ref, final_out.numpy(), rtol=1e-5, atol=1e-5)
final_out_ref, final_out.numpy(), rtol=1e-5, atol=1e-4)
np.testing.assert_allclose(
x_grad_ref, x_grad.numpy(), rtol=1e-5, atol=1e-5)
x_grad_ref, x_grad.numpy(), rtol=1e-5, atol=1e-4)


class TestFusedAttentionOpPreLn(TestFusedAttentionOp):
Expand Down Expand Up @@ -249,9 +249,9 @@ def test_fused_attention_op(self):
final_out_ref, x_grad_ref = self.GetBaselineOut()
final_out, x_grad = self.GetFusedAttentionOut()
np.testing.assert_allclose(
final_out_ref, final_out.numpy(), rtol=1e-5, atol=1e-5)
final_out_ref, final_out.numpy(), rtol=1e-5, atol=1e-4)
np.testing.assert_allclose(
x_grad_ref, x_grad.numpy(), rtol=1e-5, atol=1e-5)
x_grad_ref, x_grad.numpy(), rtol=1e-5, atol=1e-4)


class TestFusedAttentionOpNoneAttnMask(TestFusedAttentionOp):
Expand Down Expand Up @@ -279,9 +279,9 @@ def test_fused_attention_op(self):
final_out_ref, x_grad_ref = self.GetBaselineOut()
final_out, x_grad = self.GetFusedAttentionOut()
np.testing.assert_allclose(
final_out_ref, final_out.numpy(), rtol=1e-5, atol=1e-5)
final_out_ref, final_out.numpy(), rtol=1e-5, atol=1e-4)
np.testing.assert_allclose(
x_grad_ref, x_grad.numpy(), rtol=1e-5, atol=1e-5)
x_grad_ref, x_grad.numpy(), rtol=1e-5, atol=1e-4)


class TestFusedAttentionOpFp16(TestFusedAttentionOp):
Expand Down

1 comment on commit dd063b0

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.