From 93bda29f9de8a4766c1254df04800025639cc572 Mon Sep 17 00:00:00 2001 From: cai-weiwei1989 <734267852@qq.com> Date: Fri, 29 Mar 2024 17:45:22 +0800 Subject: [PATCH] =?UTF-8?q?[ptdbg=5Fascend]=E8=B5=84=E6=96=99=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E6=95=B4=E7=BD=91dump=E7=A9=BA=E9=97=B4=E4=B8=8D?= =?UTF-8?q?=E8=B6=B3=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\203\275\350\257\264\346\230\216_v2.0.md" | 7 +++++++ ...0\203\275\350\257\264\346\230\216_v3.0.md" | 7 +++++++ ...0\203\275\350\257\264\346\230\216_v4.0.md" | 21 ++++++++++++------- ...03\275\350\257\264\346\230\216_v5.0.T4.md" | 7 +++++++ 4 files changed, 35 insertions(+), 7 deletions(-) diff --git "a/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v2.0.md" "b/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v2.0.md" index 9b3227f47a..ce102dd882 100644 --- "a/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v2.0.md" +++ "b/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v2.0.md" @@ -41,10 +41,17 @@ ptdbg_ascend工具的原理及安装请参见《[PyTorch精度工具](https://gi PyTorch训练场景的精度问题分析建议参考以下思路进行精度比对和比对结果分析: 1. 整网比对:dump整网数据并进行精度比对,初步定位异常范围。 + + 不推荐使用整网dump比对,若模型数据庞大(比如达到T级别),整网dump可能导致磁盘不足,需要预留足够的存储空间,或者分多次dump。 + 2. 缩小范围:根据Accuracy Reached or Not找出不符合精度标准的API。 + 3. 范围比对:对不符合精度标准的API重新dump。 + 4. 分析原因并优化:分析API精度不符合标准的原因并进行优化调整。 + 5. 整网比对:重新进行整网比对,判断优化后的API是否已符合精度标准以及是否出现新的精度问题。 + 6. 重复1~5步,直到不存在精度问题为止。 **精度分析示例** diff --git "a/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v3.0.md" "b/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v3.0.md" index 03ed6bb611..f2059fd96e 100644 --- "a/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v3.0.md" +++ "b/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v3.0.md" @@ -41,10 +41,17 @@ ptdbg_ascend工具的原理及安装请参见《[PyTorch精度工具](https://gi PyTorch训练场景的精度问题分析建议参考以下思路进行精度比对和比对结果分析: 1. 整网比对:dump整网数据并进行精度比对,初步定位异常范围。 + + 不推荐使用整网dump比对,若模型数据庞大(比如达到T级别),整网dump可能导致磁盘不足,需要预留足够的存储空间,或者分多次dump。 + 2. 缩小范围:根据Accuracy Reached or Not找出不符合精度标准的API。 + 3. 范围比对:对不符合精度标准的API重新dump。 + 4. 分析原因并优化:分析API精度不符合标准的原因并进行优化调整。 + 5. 整网比对:重新进行整网比对,判断优化后的API是否已符合精度标准以及是否出现新的精度问题。 + 6. 重复1~5步,直到不存在精度问题为止。 **精度分析示例** diff --git "a/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v4.0.md" "b/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v4.0.md" index 9dee9341fc..7e61d9ad51 100644 --- "a/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v4.0.md" +++ "b/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v4.0.md" @@ -43,10 +43,17 @@ ptdbg_ascend工具主要支持PyTorch API精度数据dump、溢出检测、精 PyTorch训练场景的精度问题分析建议参考以下思路进行精度比对和比对结果分析: 1. 整网比对:dump整网数据并进行精度比对,初步定位异常范围。 + + 不推荐使用整网dump比对,若模型数据庞大(比如达到T级别),整网dump可能导致磁盘不足,需要预留足够的存储空间,或者分多次dump。 + 2. 缩小范围:根据Accuracy Reached or Not找出不符合精度标准的API。 + 3. 范围比对:对不符合精度标准的API重新dump详细信息。 + 4. 分析原因并优化:分析API精度不符合标准的原因并进行优化调整。 + 5. 整网比对:重新进行整网比对,判断优化后的API是否已符合精度标准以及是否出现新的精度问题。 + 6. 重复1~5步,直到不存在精度问题为止。 **精度分析示例** @@ -993,18 +1000,18 @@ debugger.stop() from ptdbg_ascend import * debugger = PrecisionDebugger(dump_path="./dump_path", hook_name="overflow_check", step=[0]) # 请勿将以上初始化流程插入到循环代码中 - + # 模型初始化 # 下面代码也可以用PrecisionDebugger.start()和PrecisionDebugger.stop() debugger.start() - + # 需要dump的代码片段1 - + debugger.stop() debugger.start() - + # 需要dump的代码片段2 - + debugger.stop() debugger.step() ``` @@ -1403,9 +1410,9 @@ set_overflow_check_switch(switch, filter_switch='OFF') ```python register_hook(model, overflow_check, dump_mode='acl', dump_config='./dump.json') set_overflow_check_switch("ON") - + ... - + set_overflow_check_switch("OFF") ``` diff --git "a/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v5.0.T4.md" "b/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v5.0.T4.md" index aa88541c3e..b4459173f2 100644 --- "a/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v5.0.T4.md" +++ "b/debug/accuracy_tools/ptdbg_ascend/doc/ptdbg_ascend\347\262\276\345\272\246\345\267\245\345\205\267\345\212\237\350\203\275\350\257\264\346\230\216_v5.0.T4.md" @@ -43,10 +43,17 @@ ptdbg_ascend工具主要支持PyTorch API精度数据dump、溢出检测、精 PyTorch训练场景的精度问题分析建议参考以下思路进行精度比对和比对结果分析: 1. 整网比对:dump整网数据并进行精度比对,初步定位异常范围。 + + 不推荐使用整网dump比对,若模型数据庞大(比如达到T级别),整网dump可能导致磁盘不足,需要预留足够的存储空间,或者分多次dump。 + 2. 缩小范围:根据Accuracy Reached or Not找出不符合精度标准的API。 + 3. 范围比对:对不符合精度标准的API重新dump详细信息。 + 4. 分析原因并优化:分析API精度不符合标准的原因并进行优化调整。 + 5. 整网比对:重新进行整网比对,判断优化后的API是否已符合精度标准以及是否出现新的精度问题。 + 6. 重复1~5步,直到不存在精度问题为止。 **精度分析示例** -- Gitee