From 35b4b41c7fe453bd2bf912a567e0d89f21bf634e Mon Sep 17 00:00:00 2001 From: fanglanyue Date: Mon, 10 Feb 2025 14:32:34 +0800 Subject: [PATCH] bugfix cluster export type and advisor's cluster dataset --- .../advisor/dataset/cluster/cluster_dataset.py | 4 ++-- .../cluster_data_preprocess/pytorch_data_preprocessor.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/profiler/msprof_analyze/advisor/dataset/cluster/cluster_dataset.py b/profiler/msprof_analyze/advisor/dataset/cluster/cluster_dataset.py index b47f6d4518..4489dde446 100644 --- a/profiler/msprof_analyze/advisor/dataset/cluster/cluster_dataset.py +++ b/profiler/msprof_analyze/advisor/dataset/cluster/cluster_dataset.py @@ -50,8 +50,8 @@ class ClusterDataset(Dataset): if self.is_cluster_analysis_output_exist(): return parameter = { - Constant.COLLECTION_PATH: self.collection_path, - Constant.ANALYSIS_MODE: "all", + Constant.PROFILING_PATH: self.collection_path, + Constant.MODE: "all", Constant.CLUSTER_ANALYSIS_OUTPUT_PATH: self.output_path } logger.info("cluster analysis is in the process, please wait...") diff --git a/profiler/msprof_analyze/cluster_analyse/cluster_data_preprocess/pytorch_data_preprocessor.py b/profiler/msprof_analyze/cluster_analyse/cluster_data_preprocess/pytorch_data_preprocessor.py index d270605906..09a46bc718 100644 --- a/profiler/msprof_analyze/cluster_analyse/cluster_data_preprocess/pytorch_data_preprocessor.py +++ b/profiler/msprof_analyze/cluster_analyse/cluster_data_preprocess/pytorch_data_preprocessor.py @@ -40,8 +40,12 @@ class PytorchDataPreprocessor(DataPreprocessor): if file_name.startswith(self.PROFILER_INFO_HEAD) and file_name.endswith(self.PROFILER_INFO_EXTENSION): file_path = os.path.join(dir_name, file_name) config = FileManager.read_json_file(file_path) - self.data_type.add(config.get(Constant.CONFIG, {}).get(Constant.EXPER_CONFIG, {}). - get(Constant.EXPER_EXPORT_TYPE, Constant.TEXT)) + export_type = (config.get(Constant.CONFIG, {}).get(Constant.EXPER_CONFIG, {}). + get(Constant.EXPER_EXPORT_TYPE, Constant.TEXT)) + if isinstance(export_type, list): + self.data_type.add(Constant.DB if Constant.DB in export_type else Constant.TEXT) + else: + self.data_type.add(export_type) rank_id_map[rank_id].append(dir_name) try: -- Gitee