From ba090d4ac1bb85b83885b9db71f405fcb2a5289e Mon Sep 17 00:00:00 2001 From: l30036321 Date: Sat, 26 Jul 2025 11:13:02 +0800 Subject: [PATCH] fix l2 bug --- debug/accuracy_tools/msprobe/docs/06.data_dump_MindSpore.md | 2 +- .../msprobe/mindspore/debugger/precision_debugger.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debug/accuracy_tools/msprobe/docs/06.data_dump_MindSpore.md b/debug/accuracy_tools/msprobe/docs/06.data_dump_MindSpore.md index 32272668e8..aaf7c8a99b 100644 --- a/debug/accuracy_tools/msprobe/docs/06.data_dump_MindSpore.md +++ b/debug/accuracy_tools/msprobe/docs/06.data_dump_MindSpore.md @@ -88,7 +88,7 @@ PrecisionDebugger(config_path=None, task=None, dump_path=None, level=None, step= #### 6.1.1 start -**功能说明**:启动精度数据采集。如果没有使用 [Model](https://gitee.com/link?target=https%3A%2F%2Fwww.mindspore.cn%2Ftutorials%2Fzh-CN%2Fr2.3.1%2Fadvanced%2Fmodel.html) 高阶 API 进行训练,则需要与 stop 函数一起添加在 for 循环内,否则只有需要传入model参数时,才使用该接口。 +**功能说明**:启动精度数据采集。静态图场景下,必须在mindspore.communication.init 调用前添加。如果没有使用 [Model](https://gitee.com/link?target=https%3A%2F%2Fwww.mindspore.cn%2Ftutorials%2Fzh-CN%2Fr2.3.1%2Fadvanced%2Fmodel.html) 高阶 API 进行训练,则需要与 stop 函数一起添加在 for 循环内,否则只有需要传入model参数时,才使用该接口。 **原型**: diff --git a/debug/accuracy_tools/msprobe/mindspore/debugger/precision_debugger.py b/debug/accuracy_tools/msprobe/mindspore/debugger/precision_debugger.py index ddde912946..eca71a4755 100644 --- a/debug/accuracy_tools/msprobe/mindspore/debugger/precision_debugger.py +++ b/debug/accuracy_tools/msprobe/mindspore/debugger/precision_debugger.py @@ -165,7 +165,7 @@ class PrecisionDebugger(BasePrecisionDebugger): instance.service.stop() else: Runtime.is_running = False - if enable_dynamic_kbyk_dump: + if enable_dynamic_kbyk_dump and instance.config.level_ori == Const.LEVEL_L2: _dump_stop() if cls._is_kernel_dump() and _msprobe_c: _msprobe_c._PrecisionDebugger().stop() @@ -181,7 +181,7 @@ class PrecisionDebugger(BasePrecisionDebugger): instance.service.step() if is_graph_mode_cell_dump_allowed(instance.config): GraphModeCellDump.step() - if enable_dynamic_kbyk_dump: + if enable_dynamic_kbyk_dump and instance.config.level_ori == Const.LEVEL_L2: _dump_step(1) if cls._is_kernel_dump() and _msprobe_c: _msprobe_c._PrecisionDebugger().step() @@ -222,7 +222,7 @@ class PrecisionDebugger(BasePrecisionDebugger): if not instance: raise Exception(MsgConst.NOT_CREATED_INSTANCE) if instance.config.level_ori == Const.LEVEL_L2: - return False + return not instance._is_graph_dump(instance.config) if instance.config.execution_mode != MsConst.PYNATIVE_MODE: return False else: -- Gitee