Unverified Commit e6e06030 authored by Charlene Yang's avatar Charlene Yang Committed by GitHub
Browse files

[PyTorch] Lower atol/rtol for F16 attention tests (#1157)



* reduce atol/rtol for F16 tests
Signed-off-by: default avatarCharlene Yang <8636796+cyanguwa@users.noreply.github.com>

* relax the tols for Ampere
Signed-off-by: default avatarCharlene Yang <8636796+cyanguwa@users.noreply.github.com>

---------
Signed-off-by: default avatarCharlene Yang <8636796+cyanguwa@users.noreply.github.com>
parent 2d57db8b
...@@ -233,9 +233,9 @@ def test_dot_product_attention( ...@@ -233,9 +233,9 @@ def test_dot_product_attention(
"""Test DotProductAttention module""" """Test DotProductAttention module"""
# Get configs # Get configs
tols = dict(atol=5e-3, rtol=5e-3) tols = dict(atol=1e-3, rtol=1e-3)
if dtype == torch.bfloat16: if dtype == torch.bfloat16:
tols = dict(atol=2.5e-2, rtol=2.5e-2) tols = dict(atol=1.5e-2, rtol=1.5e-2)
config = model_configs[model] config = model_configs[model]
is_mla = config.head_dim_qk != config.head_dim_v is_mla = config.head_dim_qk != config.head_dim_v
if qkv_layout is None: if qkv_layout is None:
...@@ -1035,7 +1035,7 @@ def test_transformer_layer( ...@@ -1035,7 +1035,7 @@ def test_transformer_layer(
# Get configs # Get configs
config = model_configs[model] config = model_configs[model]
tols = dict(atol=5e-1, rtol=5e-2) tols = dict(atol=5e-2, rtol=5e-2)
workspace_opt = True workspace_opt = True
# Test backend availability # Test backend availability
......
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