From f45ce80ce59dbdd6db11910be3dedee4d7dd9146 Mon Sep 17 00:00:00 2001 From: l30036321 Date: Fri, 17 Nov 2023 15:18:49 +0800 Subject: [PATCH] fix distributed dump bug in backward dump mode --- .../ptdbg_ascend/src/python/ptdbg_ascend/dump/dump.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debug/accuracy_tools/ptdbg_ascend/src/python/ptdbg_ascend/dump/dump.py b/debug/accuracy_tools/ptdbg_ascend/src/python/ptdbg_ascend/dump/dump.py index 87eee25f1..6e9a7f7b7 100644 --- a/debug/accuracy_tools/ptdbg_ascend/src/python/ptdbg_ascend/dump/dump.py +++ b/debug/accuracy_tools/ptdbg_ascend/src/python/ptdbg_ascend/dump/dump.py @@ -180,8 +180,13 @@ def dump_api_tensor(dump_step, in_feat, name_template, out_feat): if Const.PRE_FORWARD in name_template: name_template = name_template.replace(Const.PRE_FORWARD, Const.FORWARD) else: - dump_tensor(in_feat, name_template.format("output"), dump_step) - return + if Const.BACKWARD in name_template and Const.BACKWARD in DumpUtil.dump_mode: + return + elif Const.BACKWARD not in name_template and Const.FORWARD in DumpUtil.dump_mode: + if "output" in DumpUtil.dump_mode: + dump_tensor(in_feat, name_template.format("output"), dump_step) + if "input" in DumpUtil.dump_mode: + return if Const.BACKWARD in name_template and Const.BACKWARD in DumpUtil.dump_mode: if 'input' in DumpUtil.dump_mode: -- Gitee