已合并
test update ut #32255
huangyunlong创建于 3月24日
test update ut #32255
已合并
共 4 个文件变更+6-4
| @@ -118,6 +118,7 @@ class TestONNXRuntime_npu(onnx_test_common._TestONNXRuntime): | |||
| 118 | 118 | ||
| 119 | # ONNX supports bfloat16 for opsets >= 13 | 119 | # ONNX supports bfloat16 for opsets >= 13 |
| 120 | # Add, Sub and Mul ops don't support bfloat16 cpu in onnxruntime. | 120 | # Add, Sub and Mul ops don't support bfloat16 cpu in onnxruntime. |
| 121 | + | ||
| 121 | 122 | ||
| 122 | 123 | ||
| 123 | def test_arithmetic_bfp16(self): | 124 | def test_arithmetic_bfp16(self): |
| @@ -725,6 +725,7 @@ class TestUtilityFuns(_BaseTestCase): | |||
| 725 | onnx_model = onnx.load(io.BytesIO(f.getvalue())) | 725 | onnx_model = onnx.load(io.BytesIO(f.getvalue())) |
| 726 | self.assertEqual(len(onnx_model.graph.initializer), 0) | 726 | self.assertEqual(len(onnx_model.graph.initializer), 0) |
| 727 | 727 | ||
| 728 | + # onnx need protobuf | ||
| 728 | def test_verbose(self): | 729 | def test_verbose(self): |
| 729 | class MyModule(torch.nn.Module): | 730 | class MyModule(torch.nn.Module): |
| 730 | def forward(self, input_): | 731 | def forward(self, input_): |
| @@ -1244,7 +1244,7 @@ class TestMemoryProfilerE2E(TestCase): | |||
| 1244 | aten::add_.Tensor 3 (PARAMETER), 11 (OPTIMIZER_STATE) -> 3 (PARAMETER)""", | 1244 | aten::add_.Tensor 3 (PARAMETER), 11 (OPTIMIZER_STATE) -> 3 (PARAMETER)""", |
| 1245 | ) | 1245 | ) |
| 1246 | 1246 | ||
| 1247 | - @unittest.skip("skip test_categories_e2e_sequential_fwd now") | 1247 | + @unittest.skipIf(platform.machine().lower().startswith(('arm', 'aarch')), "Skip this test on ARM-based architectures") |
| 1248 | def test_categories_e2e_sequential_fwd(self) -> None: | 1248 | def test_categories_e2e_sequential_fwd(self) -> None: |
| 1249 | model = torch.nn.Sequential( | 1249 | model = torch.nn.Sequential( |
| 1250 | torch.nn.Linear(2, 4, bias=True), | 1250 | torch.nn.Linear(2, 4, bias=True), |
| @@ -1266,7 +1266,7 @@ class TestMemoryProfilerE2E(TestCase): | |||
| 1266 | aten::detach 8 (ACTIVATION) -> ???""", | 1266 | aten::detach 8 (ACTIVATION) -> ???""", |
| 1267 | ) | 1267 | ) |
| 1268 | 1268 | ||
| 1269 | - @unittest.skip("skip test_categories_e2e_sequential_fwd_bwd now") | 1269 | + @unittest.skipIf(platform.machine().lower().startswith(('arm', 'aarch')), "Skip this test on ARM-based architectures") |
| 1270 | def test_categories_e2e_sequential_fwd_bwd(self) -> None: | 1270 | def test_categories_e2e_sequential_fwd_bwd(self) -> None: |
| 1271 | model = torch.nn.Sequential( | 1271 | model = torch.nn.Sequential( |
| 1272 | torch.nn.Linear(2, 4, bias=True), | 1272 | torch.nn.Linear(2, 4, bias=True), |
| @@ -1342,7 +1342,6 @@ class TestMemoryProfilerE2E(TestCase): | |||
| 1342 | aten::detach 29 (GRADIENT) -> ???""", | 1342 | aten::detach 29 (GRADIENT) -> ???""", |
| 1343 | ) | 1343 | ) |
| 1344 | 1344 | ||
| 1345 | - | ||
| 1346 | def test_memory_timeline(self) -> None: | 1345 | def test_memory_timeline(self) -> None: |
| 1347 | model = torch.nn.Sequential( | 1346 | model = torch.nn.Sequential( |
| 1348 | torch.nn.Linear(64, 512, bias=True), | 1347 | torch.nn.Linear(64, 512, bias=True), |
| @@ -1405,7 +1404,7 @@ class TestMemoryProfilerE2E(TestCase): | |||
| 1405 | for _, action, (key, version), size in prof._memory_profile().timeline | 1404 | for _, action, (key, version), size in prof._memory_profile().timeline |
| 1406 | # We generally don't care about tiny allocations during memory | 1405 | # We generally don't care about tiny allocations during memory |
| 1407 | # profiling and they add a lot of noise to the unit test. | 1406 | # profiling and they add a lot of noise to the unit test. |
| 1408 | - if size > 1024 | 1407 | + if size > 1024 and isinstance(key, _memory_profiler.TensorKey) |
| 1409 | ] | 1408 | ] |
| 1410 | 1409 | ||
| 1411 | self.assertExpectedInline( | 1410 | self.assertExpectedInline( |