已合并
[fix]profiler fix config cache when analyse multi card #40002
hhz0创建于 7月3日
[fix]profiler fix config cache when analyse multi card #40002
已合并
共 3 个文件变更+13-0
| @@ -69,6 +69,15 @@ class TestProfilerConfig(TestCase): | |||
| 69 | self.assertEqual(config._rank_id, -1) | 69 | self.assertEqual(config._rank_id, -1) |
| 70 | self.assertEqual(config._activities, []) | 70 | self.assertEqual(config._activities, []) |
| 71 | 71 | ||
| 72 | + def test_reset_is_load_will_reset_is_load_to_false(self): | ||
| 73 | + config = profiler_config.ProfilerConfig() | ||
| 74 | + config._rank_id = 1 | ||
| 75 | + config._is_load = True | ||
| 76 | + | ||
| 77 | + config.reset_is_load() | ||
| 78 | + | ||
| 79 | + self.assertEqual(config._rank_id, 1) | ||
| 80 | + self.assertFalse(config._is_load) | ||
| 72 | 81 | ||
| 73 | def test_load_syscnt_info_json_decode_error(self): | 82 | def test_load_syscnt_info_json_decode_error(self): |
| 74 | config = profiler_config.ProfilerConfig() | 83 | config = profiler_config.ProfilerConfig() |
| @@ -82,6 +82,9 @@ class ProfilerConfig: | |||
| 82 | self._activities = [] | 82 | self._activities = [] |
| 83 | self._is_load = False | 83 | self._is_load = False |
| 84 | 84 | ||
| 85 | + def reset_is_load(self): | ||
| 86 | + self._is_load = False | ||
| 87 | + | ||
| 85 | 88 | ||
| 86 | def data_simplification(self): | 89 | def data_simplification(self): |
| 87 | return self._data_simplification | 90 | return self._data_simplification |
| @@ -109,6 +109,7 @@ class ProfilingParser: | |||
| 109 | self.logger = ProfilerLogger.get_instance() | 109 | self.logger = ProfilerLogger.get_instance() |
| 110 | print_info_msg(f"Start parsing profiling data in " | 110 | print_info_msg(f"Start parsing profiling data in " |
| 111 | f"{'async' if self._kwargs.get('async_mode') else 'sync'} mode at: {self._profiler_path}") | 111 | f"{'async' if self._kwargs.get('async_mode') else 'sync'} mode at: {self._profiler_path}") |
| 112 | + ProfilerConfig().reset_is_load() | ||
| 112 | ProfilerConfig().load_info(self._profiler_path) | 113 | ProfilerConfig().load_info(self._profiler_path) |
| 113 | self.update_export_type() | 114 | self.update_export_type() |
| 114 | self.delete_previous_cann_db_files() | 115 | self.delete_previous_cann_db_files() |