已合并
add white list for 2.13 #45391
pangjiayi创建于 13 天前
add white list for 2.13 #45391
已合并
pangjiayi创建于 13 天前
4 个文件变更+10-4
@@ -71,7 +71,10 @@ class TestMgr:
71 self.test_files['ut_files'] += [str(i) for i in (BASE_DIR / 'test/distributed').rglob('test_*.py')]71 self.test_files['ut_files'] += [str(i) for i in (BASE_DIR / 'test/distributed').rglob('test_*.py')]
72 72 
73 def load_inductor_ut(self):73 def load_inductor_ut(self):
74- self.test_files['ut_files'] += [str(i) for i in (BASE_DIR / 'test/_inductor').rglob('test_*.py')]74+ self.test_files['ut_files'] = [
75+ str(BASE_DIR / 'test/_inductor/test_add.py'),
76+ str(BASE_DIR / 'test/_inductor/test_abs.py'),
77+ ]
75 78 
76 def load_op_plugin_ut(self):79 def load_op_plugin_ut(self):
77 if not os.path.exists(BASE_DIR / 'third_party/op-plugin/test'):80 if not os.path.exists(BASE_DIR / 'third_party/op-plugin/test'):
@@ -1,14 +1,15 @@
1import torch1import torch
2from torch.testing._internal.common_utils import run_tests, parametrize, instantiate_parametrized_tests2from torch.testing._internal.common_utils import run_tests, parametrize, instantiate_parametrized_tests
3from testutils import TestUtils3from testutils import TestUtils
4-import torch_npu4+import torch_npu # noqa: F401
5- 5+from version_mark import runIfVersion
6 6 
7class TestAbs(TestUtils):7class TestAbs(TestUtils):
8 def op_calc(self, first_element):8 def op_calc(self, first_element):
9 result = torch.abs(first_element)9 result = torch.abs(first_element)
10 return result10 return result
11 11 
12+ @runIfVersion(max="2.13")
12 @parametrize('shape', [(1024, 32), (256, 8)])13 @parametrize('shape', [(1024, 32), (256, 8)])
13 @parametrize('dtype', ['float16', 'float32', 'bfloat16'])14 @parametrize('dtype', ['float16', 'float32', 'bfloat16'])
14 def test_pointwise_cases(self, shape, dtype):15 def test_pointwise_cases(self, shape, dtype):
@@ -1,13 +1,14 @@
1import torch1import torch
2from torch.testing._internal.common_utils import run_tests, parametrize, instantiate_parametrized_tests2from torch.testing._internal.common_utils import run_tests, parametrize, instantiate_parametrized_tests
3from testutils import TestUtils3from testutils import TestUtils
4- 4+from version_mark import runIfVersion
5 5 
6class TestAdd(TestUtils):6class TestAdd(TestUtils):
7 def op_calc(self, first_element, second_element):7 def op_calc(self, first_element, second_element):
8 result = first_element + second_element8 result = first_element + second_element
9 return result9 return result
10 10 
11+ @runIfVersion(max="2.13")
11 @parametrize('shape', TestUtils._pointwise_demo_shapes)12 @parametrize('shape', TestUtils._pointwise_demo_shapes)
12 @parametrize('dtype', ['float32', 'int64'])13 @parametrize('dtype', ['float32', 'int64'])
13 def test_pointwise_cases(self, shape, dtype):14 def test_pointwise_cases(self, shape, dtype):
@@ -435,6 +435,7 @@ class flex_attention:
435 # been reviewed. Unsupported graphs always retain the legacy dK/dV path.435 # been reviewed. Unsupported graphs always retain the legacy dK/dV path.
436 bwd_dkdv_tasklist = True436 bwd_dkdv_tasklist = True
437 437 
438+ 
438flex_attention.bwd_dkdv_tasklist = _read_env_bool(439flex_attention.bwd_dkdv_tasklist = _read_env_bool(
439 "TORCHINDUCTOR_ASCEND_FLEX_ATTENTION_BWD_DKDV_TASKLIST",440 "TORCHINDUCTOR_ASCEND_FLEX_ATTENTION_BWD_DKDV_TASKLIST",
440 "1" if flex_attention.bwd_dkdv_tasklist else "0",441 "1" if flex_attention.bwd_dkdv_tasklist else "0",