已合并
【inductor】fix inductor ci bug #30190
kkjocker创建于 1月29日
【inductor】fix inductor ci bug #30190
已合并
共 3 个文件变更+4-5
| @@ -1,4 +1,3 @@ | |||
| 1 | -from unittest import skip | ||
| 2 | import torch | 1 | import torch |
| 3 | from torch.testing._internal.common_utils import run_tests | 2 | from torch.testing._internal.common_utils import run_tests |
| 4 | from testutils import TestUtils | 3 | from testutils import TestUtils |
| @@ -20,7 +19,6 @@ class Test_issue59(TestUtils): | |||
| 20 | mean_2 = rsqrt / torch.numel(rsqrt) | 19 | mean_2 = rsqrt / torch.numel(rsqrt) |
| 21 | return mul, add, mean_2 | 20 | return mul, add, mean_2 |
| 22 | 21 | ||
| 23 | - | ||
| 24 | def test_issue59(self): | 22 | def test_issue59(self): |
| 25 | device = 'npu' | 23 | device = 'npu' |
| 26 | x = torch.randn((1, 1024), device=device, dtype=torch.float32) | 24 | x = torch.randn((1, 1024), device=device, dtype=torch.float32) |
| @@ -1,4 +1,3 @@ | |||
| 1 | -from unittest import skip | ||
| 2 | import torch | 1 | import torch |
| 3 | from torch.testing._internal.common_utils import run_tests, parametrize, instantiate_parametrized_tests | 2 | from torch.testing._internal.common_utils import run_tests, parametrize, instantiate_parametrized_tests |
| 4 | from testutils import TestUtils | 3 | from testutils import TestUtils |
| @@ -10,7 +9,6 @@ class TestVarMean(TestUtils): | |||
| 10 | return torch.var_mean(input_element, dim) | 9 | return torch.var_mean(input_element, dim) |
| 11 | 10 | ||
| 12 | # case:The shape must not be too large | 11 | # case:The shape must not be too large |
| 13 | - | ||
| 14 | 12 | ||
| 15 | 13 | ||
| 16 | 14 | ||
| @@ -1171,7 +1171,10 @@ class NPUIndexTritonKernel(TritonKernel): | |||
| 1171 | ) -> Union[CSEVariable, Tuple[CSEVariable, ...]]: | 1171 | ) -> Union[CSEVariable, Tuple[CSEVariable, ...]]: |
| 1172 | if not self.inside_reduction: | 1172 | if not self.inside_reduction: |
| 1173 | raise RuntimeError("assert self.inside_reduction") | 1173 | raise RuntimeError("assert self.inside_reduction") |
| 1174 | - masks = {f"{node.symbol()}_mask" for node in self.sorted_axis} | 1174 | + if self.persistent_reduction and self.numof_reduction_axis() == 1: |
| 1175 | + masks = {f"{node.symbol()}_mask" for node in self.sorted_axis if node.name[0] != "r"} | ||
| 1176 | + else: | ||
| 1177 | + masks = {f"{node.symbol()}_mask" for node in self.sorted_axis} | ||
| 1175 | self.filter_masks(masks) | 1178 | self.filter_masks(masks) |
| 1176 | masks = sorted(masks) | 1179 | masks = sorted(masks) |
| 1177 | if self._load_mask: | 1180 | if self._load_mask: |