已合并
[fix][v2.8.0]aclgraph testcase add 910C support #31719
翰萨姆创建于 3月12日
[fix][v2.8.0]aclgraph testcase add 910C support #31719
已合并
共 3 个文件变更+16-16
| @@ -31,7 +31,7 @@ class MyModel(nn.Module): | |||
| 31 | 31 | ||
| 32 | class TestAclgraphLaunchHostFunc(TestCase): | 32 | class TestAclgraphLaunchHostFunc(TestCase): |
| 33 | 33 | ||
| 34 | - @SupportedDevices(['Ascend910B']) | 34 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 35 | def test_launch_host_func(self): | 35 | def test_launch_host_func(self): |
| 36 | torch_npu.npu.set_compile_mode(jit_compile=False) | 36 | torch_npu.npu.set_compile_mode(jit_compile=False) |
| 37 | torch_npu.npu.set_device(0) | 37 | torch_npu.npu.set_device(0) |
| @@ -14,7 +14,7 @@ os.environ["ASCEND_LAUNCH_BLOCKING"] = "1" | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | class TestIFAAclgraphUpdateSupportBlocking(TestCase): | 16 | class TestIFAAclgraphUpdateSupportBlocking(TestCase): |
| 17 | - @SupportedDevices(['Ascend910B', 'Ascend910C']) | 17 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 18 | def test_ifa_update_support_blocking(self): | 18 | def test_ifa_update_support_blocking(self): |
| 19 | torch.npu.set_device(0) | 19 | torch.npu.set_device(0) |
| 20 | length = [29] | 20 | length = [29] |
| @@ -63,7 +63,7 @@ class TestIFAAclgraphUpdateSupportBlocking(TestCase): | |||
| 63 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 63 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 64 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) | 64 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) |
| 65 | 65 | ||
| 66 | - @SupportedDevices(['Ascend910B', 'Ascend910C']) | 66 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 67 | def test_ifa_update_with_auto_dispatch_capture_support_blocking(self): | 67 | def test_ifa_update_with_auto_dispatch_capture_support_blocking(self): |
| 68 | torch.npu.set_device(0) | 68 | torch.npu.set_device(0) |
| 69 | length = [29] | 69 | length = [29] |
| @@ -97,7 +97,7 @@ class TestIFAAclgraphUpdateSupportBlocking(TestCase): | |||
| 97 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 97 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 98 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) | 98 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) |
| 99 | 99 | ||
| 100 | - @SupportedDevices(['Ascend910B', 'Ascend910C']) | 100 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 101 | def test_ifa_update_with_non_out_and_auto_dispatch_capture_support_blocking(self): | 101 | def test_ifa_update_with_non_out_and_auto_dispatch_capture_support_blocking(self): |
| 102 | torch.npu.set_device(0) | 102 | torch.npu.set_device(0) |
| 103 | length = [29] | 103 | length = [29] |
| @@ -15,7 +15,7 @@ from torch_npu.testing.testcase import TestCase, run_tests | |||
| 15 | 15 | ||
| 16 | class TestIFAAclgraphUpdate(TestCase): | 16 | class TestIFAAclgraphUpdate(TestCase): |
| 17 | 17 | ||
| 18 | - @SupportedDevices(['Ascend910B']) | 18 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 19 | def test_ifa_update(self): | 19 | def test_ifa_update(self): |
| 20 | torch.npu.set_device(0) | 20 | torch.npu.set_device(0) |
| 21 | length = [29] | 21 | length = [29] |
| @@ -64,7 +64,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 64 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 64 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 65 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) | 65 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) |
| 66 | 66 | ||
| 67 | - @SupportedDevices(['Ascend910B']) | 67 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 68 | def test_update_stream_globally_unique(self): | 68 | def test_update_stream_globally_unique(self): |
| 69 | torch.npu.set_device(0) | 69 | torch.npu.set_device(0) |
| 70 | 70 | ||
| @@ -72,7 +72,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 72 | g2 = torch.npu.NPUGraph() | 72 | g2 = torch.npu.NPUGraph() |
| 73 | self.assertEqual(g1.graph_dispatch_mode.update_stream, g2.graph_dispatch_mode.update_stream) | 73 | self.assertEqual(g1.graph_dispatch_mode.update_stream, g2.graph_dispatch_mode.update_stream) |
| 74 | 74 | ||
| 75 | - @SupportedDevices(['Ascend910B']) | 75 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 76 | def test_ifa_update_with_auto_dispatch_capture(self): | 76 | def test_ifa_update_with_auto_dispatch_capture(self): |
| 77 | torch.npu.set_device(0) | 77 | torch.npu.set_device(0) |
| 78 | length = [29] | 78 | length = [29] |
| @@ -106,7 +106,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 106 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 106 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 107 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) | 107 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) |
| 108 | 108 | ||
| 109 | - @SupportedDevices(['Ascend910B']) | 109 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 110 | def test_ifa_update_with_non_out_and_auto_dispatch_capture(self): | 110 | def test_ifa_update_with_non_out_and_auto_dispatch_capture(self): |
| 111 | torch.npu.set_device(0) | 111 | torch.npu.set_device(0) |
| 112 | length = [29] | 112 | length = [29] |
| @@ -136,7 +136,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 136 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 136 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 137 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) | 137 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) |
| 138 | 138 | ||
| 139 | - @SupportedDevices(['Ascend910B']) | 139 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 140 | def test_ifa_v2_update_with_auto_dispatch_capture(self): | 140 | def test_ifa_v2_update_with_auto_dispatch_capture(self): |
| 141 | torch.npu.set_device(0) | 141 | torch.npu.set_device(0) |
| 142 | length = [1] | 142 | length = [1] |
| @@ -169,7 +169,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 169 | g.replay() | 169 | g.replay() |
| 170 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 170 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 171 | 171 | ||
| 172 | - @SupportedDevices(['Ascend910B']) | 172 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 173 | def test_ifa_v2_update_with_non_out_and_auto_dispatch_capture(self): | 173 | def test_ifa_v2_update_with_non_out_and_auto_dispatch_capture(self): |
| 174 | torch.npu.set_device(0) | 174 | torch.npu.set_device(0) |
| 175 | length = [1] | 175 | length = [1] |
| @@ -198,7 +198,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 198 | g.replay() | 198 | g.replay() |
| 199 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 199 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 200 | 200 | ||
| 201 | - @SupportedDevices(['Ascend910B']) | 201 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 202 | 202 | ||
| 203 | def test_npu_fused_infer_attention_score_v2(self): | 203 | def test_npu_fused_infer_attention_score_v2(self): |
| 204 | torch.npu.set_device(0) | 204 | torch.npu.set_device(0) |
| @@ -246,7 +246,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 246 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 246 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 247 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) | 247 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) |
| 248 | 248 | ||
| 249 | - @SupportedDevices(['Ascend910B']) | 249 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 250 | def test_fia_out_4in1_with_graph(self, device="npu"): | 250 | def test_fia_out_4in1_with_graph(self, device="npu"): |
| 251 | q = torch.randn(1, 8, 164, 128, dtype=torch.float16).npu() | 251 | q = torch.randn(1, 8, 164, 128, dtype=torch.float16).npu() |
| 252 | k = torch.randn(1, 8, 1024, 128, dtype=torch.float16).npu() | 252 | k = torch.randn(1, 8, 1024, 128, dtype=torch.float16).npu() |
| @@ -301,7 +301,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 301 | self.assertTrue(torch.allclose(output, output2, 1e-4, 1e-4)) | 301 | self.assertTrue(torch.allclose(output, output2, 1e-4, 1e-4)) |
| 302 | self.assertTrue(torch.allclose(softmax_lse, softmax_lse2, 1e-4, 1e-4)) | 302 | self.assertTrue(torch.allclose(softmax_lse, softmax_lse2, 1e-4, 1e-4)) |
| 303 | 303 | ||
| 304 | - @SupportedDevices(['Ascend910B']) | 304 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 305 | 305 | ||
| 306 | def test_npugraph_debug_dump(self): | 306 | def test_npugraph_debug_dump(self): |
| 307 | N, D_in, H, D_out = 640, 4096, 2048, 1024 | 307 | N, D_in, H, D_out = 640, 4096, 2048, 1024 |
| @@ -330,7 +330,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 330 | self.assertTrue(os.path.getsize(file_path) > 0, "npugraph debug dump assert error") | 330 | self.assertTrue(os.path.getsize(file_path) > 0, "npugraph debug dump assert error") |
| 331 | os.remove(file_path) | 331 | os.remove(file_path) |
| 332 | 332 | ||
| 333 | - @SupportedDevices(['Ascend910B']) | 333 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 334 | def test_ifa_update_no_reset(self): | 334 | def test_ifa_update_no_reset(self): |
| 335 | torch.npu.set_device(0) | 335 | torch.npu.set_device(0) |
| 336 | length = [29] | 336 | length = [29] |
| @@ -378,7 +378,7 @@ class TestIFAAclgraphUpdate(TestCase): | |||
| 378 | self.assertEqual(output.cpu(), res_src[0].cpu()) | 378 | self.assertEqual(output.cpu(), res_src[0].cpu()) |
| 379 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) | 379 | self.assertEqual(softmax_lse.cpu(), res_src[1].cpu()) |
| 380 | 380 | ||
| 381 | - @SupportedDevices(['Ascend910B']) | 381 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 382 | 382 | ||
| 383 | def test_npu_fused_infer_attention_score_v2_no_reset(self): | 383 | def test_npu_fused_infer_attention_score_v2_no_reset(self): |
| 384 | torch.npu.set_device(0) | 384 | torch.npu.set_device(0) |
| @@ -548,7 +548,7 @@ class TestPAAclgraphUpdate(TestCase): | |||
| 548 | ) | 548 | ) |
| 549 | return params.output | 549 | return params.output |
| 550 | 550 | ||
| 551 | - @SupportedDevices(['Ascend910B']) | 551 | + @SupportedDevices(['Ascend910B', 'Ascend910_93']) |
| 552 | def test_paged_attention_aclgraph_update(self): | 552 | def test_paged_attention_aclgraph_update(self): |
| 553 | params, golden_output = self.preprocess() | 553 | params, golden_output = self.preprocess() |
| 554 | output = None | 554 | output = None |