已合并
[sync] PR-35715: [feat]profiler dyno support rank list #37338
ascend-robot创建于 6月1日
[sync] PR-35715: [feat]profiler dyno support rank list #37338
已合并
ascend-robot创建于 6月1日
2 个文件变更+11-2
@@ -150,7 +150,11 @@ class ConfigContext:
150 self.with_modules = False150 self.with_modules = False
151 151 
152 def _parse_ranks(self, json_data: dict):152 def _parse_ranks(self, json_data: dict):
153- self.is_rank = json_data.get("is_rank", False)153+ if not self._is_dyno:
154+ self.is_rank = json_data.get("is_rank", False)
155+ else:
156+ self.is_rank = json_data.get("PROFILE_IS_RANK", 'false')
157+ self.is_rank = self.BOOL_MAP.get(self.is_rank.lower(), False)
154 if not isinstance(self.is_rank, bool):158 if not isinstance(self.is_rank, bool):
155 self.is_rank = False159 self.is_rank = False
156 DynamicProfilerUtils.out_log("Set is_rank failed, is_rank must be bool!",160 DynamicProfilerUtils.out_log("Set is_rank failed, is_rank must be bool!",
@@ -159,7 +163,11 @@ class ConfigContext:
159 if not self.is_rank:163 if not self.is_rank:
160 return164 return
161 DynamicProfilerUtils.out_log("Set is_rank success!", DynamicProfilerUtils.LoggerLevelEnum.INFO)165 DynamicProfilerUtils.out_log("Set is_rank success!", DynamicProfilerUtils.LoggerLevelEnum.INFO)
162- ranks = json_data.get("rank_list", False)166+ if not self._is_dyno:
167+ ranks = json_data.get("rank_list", False)
168+ else:
169+ ranks = DynamicProfilerUtils.parse_str_params_to_list(json_data.get('PROFILE_RANK_LIST', None))
170+ ranks = [int(rank) for rank in ranks if rank.strip().isdigit()]
163 if not isinstance(ranks, list):171 if not isinstance(ranks, list):
164 DynamicProfilerUtils.out_log("Set rank_list failed, rank_list must be list!",172 DynamicProfilerUtils.out_log("Set rank_list failed, rank_list must be list!",
165 DynamicProfilerUtils.LoggerLevelEnum.WARNING)173 DynamicProfilerUtils.LoggerLevelEnum.WARNING)
@@ -21,6 +21,7 @@ class DynamicProfilerShareMemory:
21 "activities": ["CPU", "NPU"],21 "activities": ["CPU", "NPU"],
22 "prof_dir": "./",22 "prof_dir": "./",
23 "analyse": False,23 "analyse": False,
24+ "async_mode": False,
24 "record_shapes": False,25 "record_shapes": False,
25 "profile_memory": False,26 "profile_memory": False,
26 "with_stack": False,27 "with_stack": False,