已合并
fix some failed testcases #37673
fgd_dragon创建于 6月5日
fix some failed testcases #37673
已合并
共 2 个文件变更+8-6
| @@ -1,6 +1,5 @@ | |||
| 1 | import torch | 1 | import torch |
| 2 | import torch.nn.functional as F | 2 | import torch.nn.functional as F |
| 3 | -import unittest | ||
| 4 | 3 | ||
| 5 | import torch_npu | 4 | import torch_npu |
| 6 | from torch_npu.testing.common_utils import create_common_tensor | 5 | from torch_npu.testing.common_utils import create_common_tensor |
| @@ -58,8 +57,14 @@ class TestMultiHeadAttention(TestCase): | |||
| 58 | query_bias, key_bias, value_bias, out_proj_bias, drop_mask, | 57 | query_bias, key_bias, value_bias, out_proj_bias, drop_mask, |
| 59 | attn_head_num, attn_dim_per_head, src_len, tgt_len, dropout_prob, softmax_use_float) | 58 | attn_head_num, attn_dim_per_head, src_len, tgt_len, dropout_prob, softmax_use_float) |
| 60 | 59 | ||
| 61 | - | ||
| 62 | def test_npu_multi_head_attention(self): | 60 | def test_npu_multi_head_attention(self): |
| 61 | + try: | ||
| 62 | + torch.npu.config.allow_internal_format = True | ||
| 63 | + self._test_npu_multi_head_attention() | ||
| 64 | + finally: | ||
| 65 | + torch.npu.config.allow_internal_format = False | ||
| 66 | + | ||
| 67 | + def _test_npu_multi_head_attention(self): | ||
| 63 | batch = 8 | 68 | batch = 8 |
| 64 | attn_head_num = 16 | 69 | attn_head_num = 16 |
| 65 | attn_dim_per_head = 64 | 70 | attn_dim_per_head = 64 |
| @@ -32089,8 +32089,5 @@ | |||
| 32089 | "test_upsampling_bfloat16 (__main__.TestNN)": ["", [""]], | 32089 | "test_upsampling_bfloat16 (__main__.TestNN)": ["", [""]], |
| 32090 | "test_grad_with_v_schedule (__main__.TestScheduleLowering)": ["", [""]], | 32090 | "test_grad_with_v_schedule (__main__.TestScheduleLowering)": ["", [""]], |
| 32091 | "test_data_parallel_rnn (__main__.TestDataParallel)": ["", ["Disabled during A1 to A2 chip transition"]], | 32091 | "test_data_parallel_rnn (__main__.TestDataParallel)": ["", ["Disabled during A1 to A2 chip transition"]], |
| 32092 | - "test_alltoall_single_2p_size_dist (__main__.HcclAlltoAllSingleTest)": ["", ["Disabled during A1 to A2 chip transition"]], | 32092 | + "test_alltoall_single_2p_size_dist (__main__.HcclAlltoAllSingleTest)": ["", ["Disabled during A1 to A2 chip transition"]] |
| 32093 | - "test_compare_cpu__chunk_cat_npu_float32 (__main__.TestCommonPRIVATEUSE1)": ["", [""]], | ||
| 32094 | - "test_variant_consistency_eager__chunk_cat_npu_float32 (__main__.TestCommonPRIVATEUSE1)": ["", [""]], | ||
| 32095 | - "test_operator__chunk_cat_npu_float32 (__main__.TestCompositeComplianceNPU)": ["", [""]] | ||
| 32096 | } | 32093 | } |