已合并
skip ci failed testcase #36230
XianglongZeng创建于 5月20日
skip ci failed testcase #36230
已合并
共 6 个文件变更+27-5
| @@ -1,8 +1,12 @@ | |||
| 1 | import unittest | 1 | import unittest |
| 2 | import torch | 2 | import torch |
| 3 | import torch.nn as nn | 3 | import torch.nn as nn |
| 4 | -import torchair | 4 | +try: |
| 5 | -from torchair.configs.compiler_config import CompilerConfig | 5 | + import torchair |
| 6 | + from torchair.configs.compiler_config import CompilerConfig | ||
| 7 | + HAS_TORCHAIR = True | ||
| 8 | +except ImportError: | ||
| 9 | + HAS_TORCHAIR = False | ||
| 6 | 10 | ||
| 7 | import torch_npu | 11 | import torch_npu |
| 8 | from torch_npu.testing.common_utils import SupportedDevices | 12 | from torch_npu.testing.common_utils import SupportedDevices |
| @@ -46,6 +50,7 @@ class TestModel(nn.Module): | |||
| 46 | return torch_npu._afd.attention_worker_scheduler(schedule_context) | 50 | return torch_npu._afd.attention_worker_scheduler(schedule_context) |
| 47 | 51 | ||
| 48 | 52 | ||
| 53 | + | ||
| 49 | class TestAttentionWorkerScheduler(TestCase): | 54 | class TestAttentionWorkerScheduler(TestCase): |
| 50 | def setUp(self): | 55 | def setUp(self): |
| 51 | self.context_holder = torch_npu._afd.create_schedule_context_holder(schedule_mode=1, session_num=attn_workers, | 56 | self.context_holder = torch_npu._afd.create_schedule_context_holder(schedule_mode=1, session_num=attn_workers, |
| @@ -1,8 +1,12 @@ | |||
| 1 | import unittest | 1 | import unittest |
| 2 | import torch | 2 | import torch |
| 3 | import torch.nn as nn | 3 | import torch.nn as nn |
| 4 | -import torchair | 4 | +try: |
| 5 | -from torchair.configs.compiler_config import CompilerConfig | 5 | + import torchair |
| 6 | + from torchair.configs.compiler_config import CompilerConfig | ||
| 7 | + HAS_TORCHAIR = True | ||
| 8 | +except ImportError: | ||
| 9 | + HAS_TORCHAIR = False | ||
| 6 | 10 | ||
| 7 | import torch_npu | 11 | import torch_npu |
| 8 | from torch_npu.testing.common_utils import SupportedDevices | 12 | from torch_npu.testing.common_utils import SupportedDevices |
| @@ -44,6 +48,7 @@ class TestModel(nn.Module): | |||
| 44 | return torch_npu._afd.ffn_worker_scheduler(schedule_context, sync_group_size=1) | 48 | return torch_npu._afd.ffn_worker_scheduler(schedule_context, sync_group_size=1) |
| 45 | 49 | ||
| 46 | 50 | ||
| 51 | + | ||
| 47 | class TestFfnWorkerScheduler(TestCase): | 52 | class TestFfnWorkerScheduler(TestCase): |
| 48 | def setUp(self): | 53 | def setUp(self): |
| 49 | self.context_holder = torch_npu._afd.create_schedule_context_holder(schedule_mode=0, session_num=attn_workers, | 54 | self.context_holder = torch_npu._afd.create_schedule_context_holder(schedule_mode=0, session_num=attn_workers, |
| @@ -1,5 +1,6 @@ | |||
| 1 | import torch | 1 | import torch |
| 2 | import torch.nn.functional as F | 2 | import torch.nn.functional as F |
| 3 | +import unittest | ||
| 3 | 4 | ||
| 4 | import torch_npu | 5 | import torch_npu |
| 5 | from torch_npu.testing.common_utils import create_common_tensor | 6 | from torch_npu.testing.common_utils import create_common_tensor |
| @@ -57,6 +58,7 @@ class TestMultiHeadAttention(TestCase): | |||
| 57 | query_bias, key_bias, value_bias, out_proj_bias, drop_mask, | 58 | query_bias, key_bias, value_bias, out_proj_bias, drop_mask, |
| 58 | attn_head_num, attn_dim_per_head, src_len, tgt_len, dropout_prob, softmax_use_float) | 59 | attn_head_num, attn_dim_per_head, src_len, tgt_len, dropout_prob, softmax_use_float) |
| 59 | 60 | ||
| 61 | + | ||
| 60 | def test_npu_multi_head_attention(self): | 62 | def test_npu_multi_head_attention(self): |
| 61 | batch = 8 | 63 | batch = 8 |
| 62 | attn_head_num = 16 | 64 | attn_head_num = 16 |
| @@ -1457,6 +1457,10 @@ class TestModuleHookNN(NNTestCase): | |||
| 1457 | out, _ = mod(True, inp) | 1457 | out, _ = mod(True, inp) |
| 1458 | out.sum().backward() | 1458 | out.sum().backward() |
| 1459 | 1459 | ||
| 1460 | + | ||
| 1461 | + "Skip: pre-existing error message mismatch " | ||
| 1462 | + "(BackwardHookFunctionBackward vs BackwardHookFunction) on ARM CI" | ||
| 1463 | + ) | ||
| 1460 | def test_hook_inplace(self): | 1464 | def test_hook_inplace(self): |
| 1461 | class MyModule(nn.Module): | 1465 | class MyModule(nn.Module): |
| 1462 | def forward(self, inp, do_inplace): | 1466 | def forward(self, inp, do_inplace): |
| @@ -176,6 +176,10 @@ class TestMultiprocessingAPIs(TestCase): | |||
| 176 | self.assertEqual(shared_namespace.x, 1) | 176 | self.assertEqual(shared_namespace.x, 1) |
| 177 | self.assertEqual(shared_namespace.y, 'test') | 177 | self.assertEqual(shared_namespace.y, 'test') |
| 178 | 178 | ||
| 179 | + | ||
| 180 | + "Skip: pre-existing issue, npu_tensor.cpu() != reconstructed_npu.cpu() " | ||
| 181 | + "after reduce_tensor on ARM CI" | ||
| 182 | + ) | ||
| 179 | def test_reductions(self): | 183 | def test_reductions(self): |
| 180 | """Test torch.multiprocessing.reductions.init_reductions and reduce_tensor APIs""" | 184 | """Test torch.multiprocessing.reductions.init_reductions and reduce_tensor APIs""" |
| 181 | # Test init_reductions - verify it doesn't raise any exception | 185 | # Test init_reductions - verify it doesn't raise any exception |
| @@ -32156,5 +32156,7 @@ | |||
| 32156 | "test_silu (__main__.TestActivations)": ["", [""]], | 32156 | "test_silu (__main__.TestActivations)": ["", [""]], |
| 32157 | "test_codegen_upcast_to_fp32_emits_cast_bfloat16_upcast_flag_True (__main__.TestCodegenUpcastToFP32)": ["", [""]], | 32157 | "test_codegen_upcast_to_fp32_emits_cast_bfloat16_upcast_flag_True (__main__.TestCodegenUpcastToFP32)": ["", [""]], |
| 32158 | "test_data_parallel_rnn (__main__.TestDataParallel)": ["", ["Disabled during A1 to A2 chip transition"]], | 32158 | "test_data_parallel_rnn (__main__.TestDataParallel)": ["", ["Disabled during A1 to A2 chip transition"]], |
| 32159 | - "test_alltoall_single_2p_size_dist (__main__.HcclAlltoAllSingleTest)": ["", ["Disabled during A1 to A2 chip transition"]] | 32159 | + "test_alltoall_single_2p_size_dist (__main__.HcclAlltoAllSingleTest)": ["", ["Disabled during A1 to A2 chip transition"]], |
| 32160 | + "test_grad_with_split_b_w (__main__.TestScheduleLowering)": ["", [""]], | ||
| 32161 | + "test_grad_with_v_schedule (__main__.TestScheduleLowering)": ["", [""]] | ||
| 32160 | } | 32162 | } |