diff --git a/debug/accuracy_tools/msprobe/mindspore/dump/kernel_kbyk_dump.py b/debug/accuracy_tools/msprobe/mindspore/dump/kernel_kbyk_dump.py index 987b80ef1256331731ebff741ac9e3eae128dd12..b892bf664ad1f471847dc25580c679c4385e5afd 100644 --- a/debug/accuracy_tools/msprobe/mindspore/dump/kernel_kbyk_dump.py +++ b/debug/accuracy_tools/msprobe/mindspore/dump/kernel_kbyk_dump.py @@ -84,7 +84,7 @@ class KernelKbykDump: common_set["statistic_category"] = [mode] elif isinstance(config.summary_mode, list): common_set["statistic_category"] = list({ - self._process_hash("avg" if mode == Const.MEAN else mode) + self._process_hash("avg" if mode == "mean" else mode) for mode in config.summary_mode }) diff --git a/debug/accuracy_tools/msprobe/test/mindspore_ut/test_kernel_kbyk_dump.py b/debug/accuracy_tools/msprobe/test/mindspore_ut/test_kernel_kbyk_dump.py index 1132cc4d73c4bcfade89a46d90274081eafbd3ed..c3e2076483094264293ec4ac454e669ff842dd8a 100644 --- a/debug/accuracy_tools/msprobe/test/mindspore_ut/test_kernel_kbyk_dump.py +++ b/debug/accuracy_tools/msprobe/test/mindspore_ut/test_kernel_kbyk_dump.py @@ -398,7 +398,7 @@ class TestKernelKbykDump(TestCase): "list": [], "data_mode": ["all"], "device": "host", - "summary_mode": ["hash", "md5", "max"] + "summary_mode": ["hash", "md5", "max", "mean"] } } @@ -409,9 +409,9 @@ class TestKernelKbykDump(TestCase): self.assertEqual(dumper.dump_json["e2e_dump_settings"]["stat_calc_mode"], "host") self.assertEqual(dumper.dump_json["common_dump_settings"]["saved_data"], "statistic") if ms_version > "2.7.0": - self.assertEqual(Counter(dumper.dump_json["common_dump_settings"]["statistic_category"]), Counter(["max", "hash", "hash:md5"])) + self.assertEqual(Counter(dumper.dump_json["common_dump_settings"]["statistic_category"]), Counter(["max", "hash", "hash:md5", "avg"])) else: - self.assertEqual(Counter(dumper.dump_json["common_dump_settings"]["statistic_category"]), Counter(["max", "md5"])) + self.assertEqual(Counter(dumper.dump_json["common_dump_settings"]["statistic_category"]), Counter(["max", "md5", "avg"])) os.environ["MS_ACL_DUMP_CFG_PATH"] = "path" with patch("msprobe.mindspore.dump.kernel_kbyk_dump.create_directory"), \ patch("msprobe.mindspore.dump.kernel_kbyk_dump.logger.info") as mock_info, \