已合并
Can load the UT from the op warehouse separately. #31857
haiyan8创建于 3月16日
Can load the UT from the op warehouse separately. #31857
已合并
共 2 个文件变更+5-4
| @@ -101,6 +101,8 @@ class TestMgr: | |||
| 101 | self.test_files['ut_files'].append(str(test_file)) | 101 | self.test_files['ut_files'].append(str(test_file)) |
| 102 | 102 | ||
| 103 | def load_op_plugin_ut(self): | 103 | def load_op_plugin_ut(self): |
| 104 | + if not os.path.exists(BASE_DIR / 'third_party/op-plugin/test'): | ||
| 105 | + raise Exception("The path of op-plugin did not exist, check whether it had been pulled.") | ||
| 104 | version_path = get_test_torch_version_path() | 106 | version_path = get_test_torch_version_path() |
| 105 | file_hash = {} | 107 | file_hash = {} |
| 106 | for file_path in (BASE_DIR / 'third_party/op-plugin/test').rglob('test_*.py'): | 108 | for file_path in (BASE_DIR / 'third_party/op-plugin/test').rglob('test_*.py'): |
| @@ -121,10 +123,7 @@ class TestMgr: | |||
| 121 | if include_distributed_case: | 123 | if include_distributed_case: |
| 122 | self.load_distributed_ut() | 124 | self.load_distributed_ut() |
| 123 | if include_op_plugin_case: | 125 | if include_op_plugin_case: |
| 124 | - if os.path.exists(BASE_DIR / 'third_party/op-plugin/test'): | 126 | + self.load_op_plugin_ut() |
| 125 | - self.load_op_plugin_ut() | ||
| 126 | - else: | ||
| 127 | - raise Exception("The path of op-plugin did not exist, check whether it had been pulled.") | ||
| 128 | 127 | ||
| 129 | def split_test_files(self, rank, world_size): | 128 | def split_test_files(self, rank, world_size): |
| 130 | if rank > world_size: | 129 | if rank > world_size: |
| @@ -132,6 +132,8 @@ if __name__ == "__main__": | |||
| 132 | test_mgr.load_all_ut(options.distributed, options.network_ops) | 132 | test_mgr.load_all_ut(options.distributed, options.network_ops) |
| 133 | elif options.distributed: | 133 | elif options.distributed: |
| 134 | test_mgr.load_distributed_ut() | 134 | test_mgr.load_distributed_ut() |
| 135 | + elif options.network_ops: | ||
| 136 | + test_mgr.load_op_plugin_ut() | ||
| 135 | elif options.inductor: | 137 | elif options.inductor: |
| 136 | test_mgr.load_inductor_ut() | 138 | test_mgr.load_inductor_ut() |
| 137 | elif options.inductor_a5: | 139 | elif options.inductor_a5: |