From aa463e556c2f21484c45b76d4e3d6773328883b3 Mon Sep 17 00:00:00 2001 From: s30048155 Date: Tue, 12 Sep 2023 17:14:41 +0800 Subject: [PATCH 1/2] change save path --- debug/accuracy_tools/api_accuracy_checker/common/config.py | 1 - debug/accuracy_tools/api_accuracy_checker/config.yaml | 1 - debug/accuracy_tools/api_accuracy_checker/run_ut/run_ut.py | 6 +++--- .../api_accuracy_checker/run_ut/ut_api_info.py | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/debug/accuracy_tools/api_accuracy_checker/common/config.py b/debug/accuracy_tools/api_accuracy_checker/common/config.py index 07dd4e6bfca..550513d8e34 100644 --- a/debug/accuracy_tools/api_accuracy_checker/common/config.py +++ b/debug/accuracy_tools/api_accuracy_checker/common/config.py @@ -17,7 +17,6 @@ class Config: 'compare_algorithm': str, 'real_data': bool, 'dump_step': int, - 'error_data_path': str, 'enable_dataloader': bool, 'target_iter': int } diff --git a/debug/accuracy_tools/api_accuracy_checker/config.yaml b/debug/accuracy_tools/api_accuracy_checker/config.yaml index 46f0ed8d41a..771e4a897e1 100644 --- a/debug/accuracy_tools/api_accuracy_checker/config.yaml +++ b/debug/accuracy_tools/api_accuracy_checker/config.yaml @@ -4,6 +4,5 @@ compile_option: -O3 compare_algorithm: cosine_similarity real_data: False dump_step: 1000 -error_data_path: './' enable_dataloader: True target_iter: 1 \ No newline at end of file diff --git a/debug/accuracy_tools/api_accuracy_checker/run_ut/run_ut.py b/debug/accuracy_tools/api_accuracy_checker/run_ut/run_ut.py index 26c2f1c4601..f57c5d43e59 100644 --- a/debug/accuracy_tools/api_accuracy_checker/run_ut/run_ut.py +++ b/debug/accuracy_tools/api_accuracy_checker/run_ut/run_ut.py @@ -201,8 +201,8 @@ def run_backward(api_full_name, args, backward_content, grad_index, npu_args, np return grad_out, npu_grad_out, grad, npu_grad -def initialize_save_error_data(): - error_data_path = os.path.realpath(msCheckerConfig.error_data_path) +def initialize_save_error_data(out_path): + error_data_path = os.path.realpath(out_path) check_file_or_directory_path(error_data_path, True) initialize_save_path(error_data_path, 'ut_error_data') @@ -245,7 +245,7 @@ def _run_ut(): out_path = os.path.realpath(args.out_path) if args.out_path else "./" save_error_data = args.save_error_data if save_error_data: - initialize_save_error_data() + initialize_save_error_data(out_path) run_ut(forward_file, backward_file, out_path, save_error_data) diff --git a/debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py b/debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py index d2a29a0f70d..7e9f03268b7 100644 --- a/debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py +++ b/debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py @@ -3,7 +3,7 @@ from api_accuracy_checker.common.base_api import BaseAPIInfo class UtAPIInfo(BaseAPIInfo): - def __init__(self, api_name, element, is_forward=True, is_save_data=True, save_path=msCheckerConfig.error_data_path, + def __init__(self, api_name, element, is_forward=True, is_save_data=True, save_path='./', forward_path='ut_error_data', backward_path='ut_error_data'): super().__init__(api_name, is_forward, is_save_data, save_path, forward_path, backward_path) self.analyze_element(element) -- Gitee From 2cb8953476837fc341bd2a2ea31c1f97e82b2a89 Mon Sep 17 00:00:00 2001 From: s30048155 Date: Thu, 14 Sep 2023 19:31:53 +0800 Subject: [PATCH 2/2] update --- debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py | 1 - 1 file changed, 1 deletion(-) diff --git a/debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py b/debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py index 7e9f03268b7..f4b7f5de317 100644 --- a/debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py +++ b/debug/accuracy_tools/api_accuracy_checker/run_ut/ut_api_info.py @@ -1,4 +1,3 @@ -from api_accuracy_checker.common.config import msCheckerConfig from api_accuracy_checker.common.base_api import BaseAPIInfo -- Gitee